00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:01:24 | GordonBGood | manual says the Nim strings are compatible with cstring, so there would need to be the terminating null |
00:04:02 | * | Hideki_ quit (Ping timeout: 276 seconds) |
00:04:48 | * | junland joined #nim |
00:07:51 | * | setenforce joined #nim |
00:08:30 | GordonBGood | cast[ptr int8](cast[int](s[0].unsafeAddr) + 5)[].echo shows that the zero terminator is there |
00:09:02 | * | FromGitter quit (Remote host closed the connection) |
00:09:21 | * | FromGitter joined #nim |
00:10:10 | * | zedeus joined #nim |
00:10:11 | GordonBGood | To get the entire memory used by a string, likely that isn't correct either... |
00:10:53 | GordonBGood | As you would have the space occupied by the "len" are shown in "hello".sizeof.echo... |
00:11:29 | GordonBGood | plus the size on the stack occupied by the other parts of the header as in capacity and any other reserved bytes... |
00:11:45 | GordonBGood | size on the heap |
00:12:07 | GordonBGood | reserved fields |
00:13:08 | GordonBGood | in short, there is no exact way to get a string size that isn't guaranteed to break with new versions of compiler changes to the definition of string |
00:14:04 | GordonBGood | But getting the memory used by cstring is as per what I wrote with the plus 1 |
00:16:41 | lmariscal | Hi jken |
00:17:09 | lmariscal | I pushed today the changes to ImGui and released a new version |
00:17:13 | lmariscal | sorry for the delay |
00:18:42 | lmariscal | also would like to know your opinion on: For making the Vulkan bindings is it okay if it depends on the SDK provided on LunarG or would bindings like vulkano that pretty much reimplement everything would be better? |
00:35:09 | jken | lmariscal, sweet ill check it out! |
00:35:09 | * | snooptek quit (Remote host closed the connection) |
00:36:00 | jken | regarding vulkano vs lunarg, I am probably not the right person to provide an opinion |
00:36:25 | jken | I am still fairly new to both graphics programming and nim |
00:36:53 | jken | I did get your imgui package rendering and updating in my sdl2 + opengl application :) |
00:36:55 | * | snooptek joined #nim |
00:57:39 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:59:42 | disruptek | i dreamt in nim last night. |
01:00:04 | disruptek | i know, right? |
01:00:26 | disruptek | i lived in a house with some teenagers. they weren't my kids. |
01:00:33 | disruptek | i think maybe they were my drug dealers. |
01:00:54 | disruptek | oh, and the house was, like, suspended. floating. floating down the road. |
01:01:04 | disruptek | and we just hung out and ate frogs all day. |
01:01:08 | disruptek | actually, i think they were toads. |
01:01:15 | disruptek | no electricity in the house. |
01:01:24 | disruptek | it's okay, it was pretty comfortable, weather-wise. |
01:01:34 | jken | wow, that's a vivid dream |
01:01:55 | disruptek | yeah, i think there was an earthquake or something but it was cool. |
01:01:59 | disruptek | we just floating right over it. |
01:02:24 | disruptek | toads aren't that bad. you get used to the crunch. |
01:02:38 | disruptek | admittedly, you don't ever really get used to the juicy part. |
01:02:52 | jken | I couldn't tell you the last dream I had, never remember them |
01:03:27 | disruptek | i only dream during withdrawal. |
01:03:41 | disruptek | usually it's just nameless nameful. |
01:04:17 | disruptek | logic puzzles and exhaustive mind games. nothing based on reality or even a system of logic in our reality. no cause and effect. mostly just terror. |
01:06:35 | disruptek | i never want to eat big toads. |
01:06:51 | disruptek | just little ones. i couldn't possible eat properly large toads. |
01:08:41 | * | baysao quit (Remote host closed the connection) |
01:09:49 | disruptek | i want toads that are, like, not packaged for individual sale. |
01:11:08 | disruptek | like they better not come in a 6-pack unless they are, like, $2.69. i want like a bag full or something. |
02:00:08 | * | Manny8888 joined #nim |
02:15:17 | jken | Is it possible to match only part the value of an enum type in a case statement? |
02:15:39 | * | NimBot joined #nim |
02:15:51 | * | disruptek o7 NimBot |
02:16:02 | jken | I suppose I could check that the ord is within a range, and have my enum ordered to for that |
02:16:15 | disruptek | what are you trying to do? |
02:16:28 | jken | I was wondering if there might be any type of wildcard or regex stuff baked into case |
02:16:32 | jken | like a match statement |
02:17:00 | jken | of Enum.ParitialKey*: |
02:17:17 | jken | where a matching key might be Enum.PartialKeyExample |
02:17:31 | disruptek | oh, it's easier to use ranges or sets. |
02:18:00 | disruptek | you can $SomeEnum and set the string value of the enum, optionally, if it helps, but that rarely makes sense. |
02:18:21 | jken | oh yeah, sets |
02:18:22 | disruptek | i do some enum-fu in here: https://github.com/disruptek/gully/blob/master/src/gully.nim -- sets and ranges. |
02:20:10 | jken | thanks |
02:51:53 | disruptek | !eval import os, md5; echo readFile(getApplicationPath()).toMD5 |
02:51:56 | NimBot | Compile failed: /usercode/in.nim(1, 31) Error: undeclared identifier: 'getApplicationPath' |
02:52:45 | disruptek | !eval import os, md5; echo readFile(getAppFilename()).toMD5 |
02:52:49 | NimBot | ef78fee758b7f22a8f1a8e9ed8eb7ab6 |
02:52:51 | disruptek | c'mon goat licker |
03:21:12 | * | ftsf joined #nim |
03:23:20 | * | ftsf quit (Client Quit) |
04:01:13 | * | Hideki_ joined #nim |
04:05:43 | * | Hideki_ quit (Ping timeout: 245 seconds) |
04:18:39 | * | chemist69 quit (Ping timeout: 264 seconds) |
04:20:03 | * | chemist69 joined #nim |
05:07:59 | * | GordonBGood quit (Excess Flood) |
05:09:43 | * | GordonBGood joined #nim |
05:10:59 | * | GordonBGood quit (Excess Flood) |
05:11:58 | * | GordonBGood joined #nim |
05:13:38 | * | narimiran joined #nim |
05:34:14 | FromDiscord | <badassiel> so I just installed nim from snapstore on brand new manjaro, it created all binaries with nim-lang prefix, it was fine when i installed it on arch linux? anyone tried snap before? |
05:48:23 | narimiran | there is a known problem with snaps. why don't you install it via pacman, manjaro has nim 1.0.0 |
05:48:45 | narimiran | *pamac |
05:49:48 | FromDiscord | <badassiel> okay will try, on aur it was outdated so i didn't think to check via pacman. thanks |
05:50:33 | narimiran | general tip: first check manjaro repos, and if nothing's there then use aur |
06:03:48 | FromDiscord | <badassiel> ok, will keep in mind |
06:06:21 | * | dddddd quit (Read error: Connection reset by peer) |
06:12:10 | * | Romanson joined #nim |
06:18:18 | * | theelous3_ quit (Ping timeout: 268 seconds) |
06:20:58 | * | theelous3 joined #nim |
06:37:39 | * | Trustable joined #nim |
06:42:15 | * | solitudesf joined #nim |
07:00:00 | * | gmpreussner_ quit (Quit: kthxbye) |
07:04:55 | * | gmpreussner joined #nim |
07:09:29 | * | theelous3 quit (Ping timeout: 268 seconds) |
07:40:35 | * | Vladar joined #nim |
08:02:51 | * | Hideki_ joined #nim |
08:03:33 | * | gmpreussner_ joined #nim |
08:03:38 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:07:27 | * | Hideki_ quit (Ping timeout: 268 seconds) |
08:18:22 | * | filcuc joined #nim |
08:20:40 | * | tklohna_ joined #nim |
08:24:45 | * | Trustable quit (Remote host closed the connection) |
08:29:17 | * | jjido joined #nim |
08:34:10 | * | narimiran quit (Remote host closed the connection) |
09:35:54 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:38:45 | FromGitter | <alehander42> kodkuce |
09:38:47 | FromGitter | <alehander42> is in our place |
09:38:55 | FromGitter | <alehander42> disruptek |
09:39:35 | FromGitter | <alehander42> if you can call the best geographic region east of texas "our place" |
09:45:37 | * | solitudesf quit (Ping timeout: 240 seconds) |
09:47:42 | * | jjido joined #nim |
09:54:48 | * | solitudesf joined #nim |
09:56:24 | * | ng0 joined #nim |
09:56:56 | * | nsf joined #nim |
10:05:50 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:06:25 | * | fanta1 joined #nim |
10:18:27 | * | jjido joined #nim |
10:28:08 | FromDiscord | <kodkuce> kodkuce==athome |
10:29:30 | * | clyybber joined #nim |
10:31:14 | FromGitter | <alehander42> wow actually true |
10:31:19 | FromGitter | <alehander42> didnt have any idea |
10:33:54 | FromGitter | <alehander42> i thought it means something like "code dog" |
10:34:02 | FromGitter | <alehander42> because thats what it is in bulgarian |
10:34:44 | * | filcuc quit (Ping timeout: 246 seconds) |
10:35:17 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:36:02 | Araq | GordonBGood, https://github.com/nim-lang/Nim/pull/12533 |
10:39:44 | clyybber | Araq: Should https://github.com/nim-lang/Nim/pull/12520#event-2746564912 really be backported? |
10:39:56 | clyybber | Looks like a breaking change to me. |
10:40:25 | GordonBGood | Araq: thank you, looking at it... |
10:43:14 | FromDiscord | <kodkuce> oh its empty 😦 |
10:52:30 | Araq | clyybber, yeah we decided pragmatism wins for this |
10:52:44 | Araq | your code shouldn't rely on our wrong compile-time engine |
11:06:22 | clyybber | k |
11:06:53 | clyybber | though arguably wrong is subjective here |
11:11:27 | FromDiscord | <kodkuce> it can mean that too , kod = code , kuce = puppy/dog 🙂 |
11:21:28 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
11:22:26 | * | ng0 joined #nim |
11:25:18 | * | ng0 quit (Client Quit) |
11:26:18 | * | ng0 joined #nim |
11:31:14 | * | Romanson quit (Quit: Connection closed for inactivity) |
11:33:53 | * | tklohna_ quit (Ping timeout: 246 seconds) |
11:35:15 | GordonBGood | Araq: see your PR does what we tested plus a few refinements... |
11:35:40 | GordonBGood | Araq: re your comment "I'm beginning to like it, it won't break nearly as much code as 'owned' would break", where do we go from here? |
11:36:28 | GordonBGood | I had originally intended to do something within "newruntime" that built on "owned", adding something like biased ref counts... |
11:36:57 | GordonBGood | But if you are starting to not like "owned" then maybe we need to start with something else as base? |
11:37:43 | * | lritter joined #nim |
11:39:03 | GordonBGood | Starting from default as we tested doesn't seem to provide ref destructor hook at end of proc? |
11:39:27 | GordonBGood | Some would seem to apply to starting from --gc:destructors... |
11:39:57 | GordonBGood | Same would... |
11:42:19 | * | clyybber quit (Quit: WeeChat 2.6) |
11:42:29 | * | Hideki_ joined #nim |
11:58:14 | FromDiscord | <mratsim> clyyber that made compile-time produce different result than runtime |
11:58:25 | FromDiscord | <mratsim> @Clyybber* |
11:59:44 | Araq | GordonBGood, use --newruntime but disable optOwnedRefs |
12:00:49 | Araq | and then in liftdestructors.nim you adapt the logic |
12:01:11 | Araq | bbl |
12:01:22 | * | krux02 joined #nim |
12:29:21 | GordonBGood | Araq: okay, will try... |
12:33:32 | * | lbartoletti is now known as lbart |
12:43:39 | * | Hideki_ quit (Remote host closed the connection) |
12:44:32 | * | Hideki_ joined #nim |
12:45:32 | federico3 | dom96: does Nimble have a way to compare version numbers? |
12:48:10 | * | Hideki_ quit (Remote host closed the connection) |
12:48:23 | * | Hideki_ joined #nim |
12:51:09 | federico3 | findLatest, getLatestByTag |
12:58:38 | * | Hideki_ quit (Remote host closed the connection) |
12:59:56 | * | Hideki_ joined #nim |
13:00:47 | * | filcuc joined #nim |
13:04:41 | * | Hideki_ quit (Ping timeout: 268 seconds) |
13:04:50 | * | filcuc quit (Ping timeout: 240 seconds) |
13:09:13 | federico3 | is there something like Python's zip() ? |
13:09:57 | federico3 | ahem, sequtils.zip |
13:17:30 | planetis[m] | federico3: try https://github.com/b3liever/looper |
13:20:24 | federico3 | " invalid integer: Just use our own `csize`" |
13:25:28 | * | Hideki_ joined #nim |
13:26:50 | enthus1ast | has someone used cligen to make multiple subcommands? |
13:27:11 | enthus1ast | like: ./app keys list |
13:28:12 | enthus1ast | to me it seems that it's not supporting multiple subcommands |
13:30:46 | * | GordonBGood quit (Remote host closed the connection) |
13:32:17 | FromDiscord | <exelotl> is there any way to support compound assignment and such with 'setter' procs/templates? |
13:33:08 | FromDiscord | <Rika> what do you mean? |
13:33:25 | FromDiscord | <exelotl> if I have ``` template foo() ``` and ``` template `foo=`() ``` |
13:33:40 | FromDiscord | <exelotl> it doesn't seem like i can do ``` a.foo += 1 ``` |
13:33:55 | FromDiscord | <exelotl> i have to do ``` a.foo = a.foo + 1 ``` |
13:34:08 | FromDiscord | <Rika> add a `+=` proc? |
13:34:39 | FromDiscord | <Rika> i think theres a good reason augmented assignment isnt automatically generated when normal operations are defined |
13:35:01 | FromDiscord | <Rika> oh, its a method |
13:35:06 | FromDiscord | <exelotl> yeah |
13:35:40 | FromDiscord | <Rika> i think you still need a `+=` proc (or i think it would be `foo+=` proc) |
13:35:45 | FromDiscord | <Rika> or template sorry |
13:37:08 | solitudesf | does your template takes and returns a `var`? |
13:39:16 | FromDiscord | <exelotl> no but it doesn't really matter whether I use a proc with a var parameter or a template |
13:39:26 | FromDiscord | <exelotl> I think `foo+=` just isn't a thing |
13:40:25 | dom96 | federico3, yep, its got a version module that you can reuse |
13:40:53 | Zevv | exelotl: what is your problem, does proc `+=`(...) not work for you? |
13:41:32 | Zevv | because it just works as you'd expect: http://ix.io/1ZYm |
13:43:22 | federico3 | dom96: the tracebacks from async + jester are extremely messy. Any tip on making them readable? |
13:43:40 | * | Hideki_ quit (Remote host closed the connection) |
13:44:26 | * | Hideki_ joined #nim |
13:44:36 | dom96 | nope, we need a pass in the async code that filters out the duplication |
13:44:45 | dom96 | and outputs a nicer stack trace |
13:44:53 | dom96 | if you'd like you can contribute that |
13:44:54 | FromDiscord | <exelotl> Zevv: https://gist.github.com/exelotl/0b50b4465daa4eb22035bbce507ab18c |
13:45:27 | FromDiscord | <exelotl> basically I'm treating a distinct uint32 as a bitfield, so I want getters and setters for each group of bits |
13:46:52 | FromDiscord | <exelotl> nim's bitsize pragma for object fields doesn't cut it for me because sizeof() stops working if you use it, which breaks other parts of my code. |
13:47:55 | * | nif quit (Quit: ...) |
13:48:06 | * | nif joined #nim |
13:49:05 | * | Hideki_ quit (Ping timeout: 268 seconds) |
14:01:37 | federico3 | dom96: why this names? https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageparser.nim#L19 |
14:01:53 | * | luis_ joined #nim |
14:04:19 | Zevv | exeltl: well, that's nasty stuff you're doing there :) |
14:05:07 | disruptek | you have my attention now. |
14:05:24 | disruptek | had another nim dream last night. |
14:06:35 | jken | disruptek, how were the toads? |
14:06:59 | Zevv | exelotl: the `+=` that matches your call here is proc `+=`(v1: int, v2: int) |
14:07:26 | Zevv | So the source is lost. It first calls your `objCount=`, gets the result (int) and then calls `+=` on that. |
14:08:04 | Zevv | disruptek: you dream with syntax highlighting? |
14:08:48 | disruptek | on second thought, i had better not share this dream. |
14:09:04 | * | theelous3_ joined #nim |
14:11:18 | disruptek | Zevv: are you keeping track of my longest uncomfortable silence on irc? |
14:11:32 | disruptek | i feel like i need a dashboard or something. |
14:14:47 | Zevv | disruptek: no, the other day was long enough |
14:20:20 | disruptek | if you walk into a store and you're missing a shoe/sock on one foot, and you've peeled the wrapped back on a bar of soap and eat half of it while you shop, you can walk out with three 10lb. bags of kitty litter without paying for 'em and no one will blink an eye. |
14:20:50 | disruptek | i mean, it's not toads, but hey, that's good kitty litter. |
14:22:23 | * | ng0 quit (Remote host closed the connection) |
14:23:58 | * | ng0 joined #nim |
14:24:49 | * | filcuc_ joined #nim |
14:25:52 | jken | Ill have one of what you've had, disruptek |
14:25:53 | * | Hideki_ joined #nim |
14:27:24 | * | filcuc__ joined #nim |
14:29:14 | * | filcuc_ quit (Ping timeout: 240 seconds) |
14:29:48 | * | luis__ joined #nim |
14:30:47 | * | luis_ quit (Read error: Connection reset by peer) |
14:32:20 | * | Hideki_ quit (Remote host closed the connection) |
14:32:36 | * | Hideki_ joined #nim |
14:34:12 | jken | How can I convert a char to a unicode codepoint? I found runeAt in the unicode module but i don't think that's exactly what I want.. or I am using it wrong |
14:34:40 | jken | 'a'.ord appears to produce 97, which is ascii i think |
14:36:07 | FromGitter | <auxym> ascii == utf8 for codepoints < 127 |
14:38:17 | jken | hmm, okay! I must have another issue somewhere else then |
14:38:48 | * | filcuc joined #nim |
14:38:51 | FromDiscord | <Rika> i dont understand the issue |
14:41:24 | * | dddddd joined #nim |
14:42:23 | * | filcuc__ quit (Ping timeout: 245 seconds) |
14:44:33 | * | Hideki_ quit (Remote host closed the connection) |
14:45:14 | * | Hideki_ joined #nim |
14:49:45 | * | Hideki_ quit (Ping timeout: 265 seconds) |
14:52:35 | * | luis__ quit (Ping timeout: 276 seconds) |
14:53:43 | lqdev[m] | does `macros.sameType` work exactly like `is`? |
15:00:58 | * | stefantalpalaru quit (Quit: ZNC 1.7.5 - https://znc.in) |
15:01:07 | * | stefantalpalaru joined #nim |
15:04:19 | * | stefantalpalaru_ joined #nim |
15:06:14 | * | stefantalpalaru quit (Ping timeout: 276 seconds) |
15:06:16 | * | stefantalpalaru_ is now known as stefantalpalaru |
15:06:26 | * | stefantalpalaru quit (Changing host) |
15:06:26 | * | stefantalpalaru joined #nim |
15:11:36 | lqdev[m] | hm, doesn't seem to work. I have a symbol `ty` and running `sameType(ty, ident"SomeNumber")` doesn't seem to work |
15:12:12 | lqdev[m] | wait, this compares the underlying types of the nodes, right? |
15:15:15 | * | seni joined #nim |
15:16:36 | lqdev[m] | is there any way I can check if two symbols represent the same type? |
15:16:57 | lqdev[m] | including aliases, of course, so `bindSym"int" == bindSym"SomeNumber"` should be true. |
15:19:26 | * | Hideki_ joined #nim |
15:20:06 | FromDiscord | <badassiel> I'm following following Nim in Action, I just got to part where you have generate html code using filters, found out my editor (vscode) extension highlights all code (prefixed with #) as commented block |
15:20:56 | FromDiscord | <badassiel> I was wondering if its vscode extension or all other editors highlight it the same? |
15:27:47 | * | filcuc_ joined #nim |
15:30:39 | * | filcuc quit (Ping timeout: 264 seconds) |
15:34:32 | * | Hideki_ quit (Ping timeout: 268 seconds) |
15:47:40 | jken | lmariscal, you around? |
15:57:08 | FromGitter | <xmonader> is there a tracker for ⏎ "are we X yet" like the rust guys? |
15:57:16 | disruptek | yes. |
15:57:29 | disruptek | https://github.com/nim-lang/needed-libraries |
15:58:29 | FromGitter | <xmonader> thank you @disruptek |
15:59:17 | * | solitudesf quit (Ping timeout: 240 seconds) |
15:59:39 | FromGitter | <xmonader> lots of things i still need to give nim another shot in the company :'( |
15:59:46 | disruptek | such as? |
16:00:38 | FromGitter | <xmonader> crypto, tls, webdav |
16:00:57 | disruptek | what kinda crypto? |
16:01:32 | FromGitter | <xmonader> nothing fancy reliable public key encryption & sodium |
16:01:57 | disruptek | there's a sodium wrapper, also nimcrypto works for me. |
16:02:54 | * | solitudesf joined #nim |
16:03:08 | FromGitter | <xmonader> i'll check, but the issue itself isn't resolved in the tracker |
16:04:49 | FromGitter | <xmonader> @Willyboar I'm planning to write a template engine if you want to jump in |
16:04:51 | disruptek | the issue might represent more ambition than need. |
16:08:32 | * | fanta1 quit (Quit: fanta1) |
16:15:47 | * | filcuc_ quit (Ping timeout: 276 seconds) |
16:22:10 | * | krux02 quit (Remote host closed the connection) |
16:23:37 | FromGitter | <Willyboar> @xmonader i would like to help with any way i can. |
16:26:55 | FromGitter | <xmonader> perfect thank you so much |
16:39:14 | * | mal`` quit (Ping timeout: 240 seconds) |
16:40:18 | * | mal`` joined #nim |
16:45:17 | lqdev[m] | anyone could help me with my problem perhaps? |
16:45:45 | lqdev[m] | I'm trying to compare two types in a macro. |
16:48:10 | * | filcuc_ joined #nim |
16:51:58 | * | nsf quit (Quit: WeeChat 2.6) |
16:52:54 | FromDiscord | <Rika> got code? |
17:05:07 | * | solitudesf quit (Remote host closed the connection) |
17:09:38 | * | solitudesf joined #nim |
17:18:29 | * | filcuc_ quit (Quit: Konversation terminated!) |
17:18:47 | * | filcuc_ joined #nim |
17:22:53 | * | jjido joined #nim |
17:24:52 | * | filcuc joined #nim |
17:27:23 | * | filcuc_ quit (Ping timeout: 268 seconds) |
17:30:43 | * | filcuc quit (Ping timeout: 245 seconds) |
17:33:32 | * | narimiran joined #nim |
17:41:34 | FromDiscord | <badassiel> my dir structure |
17:41:34 | FromDiscord | <badassiel> root |
17:41:34 | FromDiscord | <badassiel> views |
17:41:35 | FromDiscord | <badassiel> user.nim |
17:41:40 | lqdev[m] | @Rika https://play.nim-lang.org/#ix=1ZZY |
17:41:42 | lqdev[m] | I want it to return true, because `int is SomeNumber` |
17:42:07 | * | lqdev joined #nim |
17:42:31 | FromDiscord | <badassiel> i'm getting `cannot open file: view/user` |
17:42:31 | FromDiscord | <badassiel> my dir structure |
17:42:31 | FromDiscord | <badassiel> root |
17:42:31 | FromDiscord | <badassiel> src |
17:42:32 | FromDiscord | <badassiel> main.nim |
17:42:32 | FromDiscord | <badassiel> views |
17:42:32 | FromDiscord | <badassiel> user.nim |
17:42:33 | FromDiscord | <badassiel> any ideas? |
17:42:47 | disruptek | naïveté is a wonderful thing. |
17:43:12 | lqdev | and matrix is lagging again |
17:43:15 | narimiran | view != views |
17:43:33 | lqdev | anyways, how can I compare two types, so that this: https://play.nim-lang.org/#ix=1ZZY returns true? |
17:43:39 | lqdev | as in `int is SomeNumber` |
17:44:04 | FromDiscord | <badassiel> oh sorry, typing mistake its `cannot open file: views/user` |
17:45:00 | narimiran | do you need to do `../views/user` maybe? i don't know where are you starting from |
17:45:25 | FromDiscord | <badassiel> running `nim c src/main.nim` |
17:45:46 | * | solitudesf quit (Read error: Connection reset by peer) |
17:46:06 | FromDiscord | <badassiel> well... `../views/user` worked. hmm.. |
17:47:26 | * | solitudesf joined #nim |
17:47:46 | FromDiscord | <badassiel> did import strategy changed since Nim in Action? also why `..` is needed when I'm in root already, is it because my starting point is in `src` dir? |
17:48:07 | * | zyklon joined #nim |
17:48:16 | lqdev | @badassiel: the import resolution hasn't changed since then, what you're doing should work fine |
17:48:21 | * | uvegbot quit (Ping timeout: 268 seconds) |
18:00:46 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:01:23 | lqdev | anyone? please, I've been sitting there for a long while now. even a "no" would be appreciated. |
18:04:07 | lqdev | currently I just have an array enumerating all the possible number types, but I don't like that solution |
18:05:23 | disruptek | https://play.nim-lang.org/#ix=2002 |
18:05:50 | disruptek | https://play.nim-lang.org/#ix=2003 |
18:06:12 | disruptek | why isn't this acceptable? |
18:06:38 | lqdev | well, I'm doing this in an `if` statement branch |
18:06:42 | lqdev | so it's not really viable |
18:06:54 | lqdev | sorry for the bad example, should've considered that |
18:07:52 | mipri | https://play.nim-lang.org/#ix=2005 |
18:08:51 | lqdev | mipri: not viable either, `x` is a NimNode of kind nnkSym |
18:08:58 | lqdev | not a typedesc |
18:09:46 | * | Hideki_ joined #nim |
18:11:04 | lqdev | guess I'll stick with my overly verbose solution for the time being. |
18:11:07 | Araq | lqdev: what's the problem? |
18:12:29 | mipri | sounds like you're doing string comparison in an untyped matter, which makes SomeNumber annoying because "SomeNumber" isn't a string that matches all the possible string representations of numerical types. |
18:13:19 | lqdev | Araq: I'm trying to check if a type sym is referring to SomeNumber |
18:14:02 | * | Hideki_ quit (Ping timeout: 240 seconds) |
18:14:30 | Araq | getType(x).kind in {ntyInt, ...} |
18:14:56 | Araq | getType(x).typeKind in {ntyInt, ...} |
18:15:01 | Araq | something like that |
18:15:09 | lqdev | that's roughly what I'm doing right now, but your solution seems better |
18:15:34 | disruptek | it's almost like he knows how to do it. |
18:16:28 | lqdev | disruptek: I know how to do it, I was just looking for a more compact solution. |
18:18:22 | Araq | well wrap it in a helper and create a PR for macros.nim |
18:18:44 | mipri | the direction I'd go in, is having the macro generate code that does the test, and deferring the decision. templates and 'when T is SomeNumber' are part of the language, too. macros can produce that. |
18:18:52 | Araq | or even better: write a getType() tutorial, nobody really knows about it |
18:19:17 | lqdev | Araq: I didn't need getType() here, the NimNode I have is already a type |
18:19:27 | lqdev | and I don't think it needs a helper |
18:19:32 | Araq | mipri: that's also a very good solution but produces some code bloat that the compiler then optimizes away |
18:21:35 | * | nsf joined #nim |
18:24:04 | * | jjido joined #nim |
18:36:04 | dom96 | badassiel: is your `views` folder inside `src`? |
18:36:34 | dom96 | here is the code for chapter 7 for reference if you want to compare: https://github.com/dom96/nim-in-action-code/tree/master/Chapter7/Tweeter |
19:00:02 | * | ng0 quit (Remote host closed the connection) |
19:01:26 | * | ng0 joined #nim |
19:02:54 | * | Balu_ quit (Quit: Leaving) |
19:12:46 | FromGitter | <auxym> so... what's the currently recommended tool to use for tests? unittest? einheit? unittest2? testament? |
19:16:53 | * | lqdev quit (Ping timeout: 252 seconds) |
19:19:25 | FromDiscord | <Chiqqum_Ngbata> From what I've gathered: unittest if it works for you, unittest2 if it doesn't, and almost certainly not testament |
19:23:22 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:23:53 | * | exelotl joined #nim |
19:27:26 | * | clyybber joined #nim |
19:28:41 | * | jjido joined #nim |
19:30:34 | FromGitter | <auxym> funny how the first thing in the official unittest docs is recommending testament. Then it's almost impossible to find good information on testament. |
19:30:59 | disruptek | testament docs are in the compiler section. |
19:42:22 | * | lqdev joined #nim |
19:51:58 | lmariscal | Hi jken I'm now |
19:53:42 | clyybber | Hi now I'm dad |
19:54:25 | * | lqdev quit (Remote host closed the connection) |
19:55:02 | narimiran | clyybber: joke theft is not a joke! miiichaaaeeel!!! |
19:56:13 | clyybber | its only a gaem y u haf 2 be maad |
19:57:14 | narimiran | (i don't know that reference, and now i'll go to bed ashamed) |
19:59:46 | clyybber | lemme help you: https://www.youtube.com/watch?v=SQvb2Oy0ph8 |
20:04:38 | * | narimiran quit (Ping timeout: 268 seconds) |
20:21:37 | * | clyybber quit (Quit: WeeChat 2.6) |
20:31:04 | * | nsf quit (Quit: WeeChat 2.6) |
20:32:14 | * | thomasross quit (Remote host closed the connection) |
20:32:34 | * | thomasross joined #nim |
20:35:12 | * | clyybber joined #nim |
20:53:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:01:58 | * | GordonBGood joined #nim |
21:14:42 | GordonBGood | Araq and all: I'd like to raise the issue of a couple of compiler switch names that are a little ambiguous or don't really describe what they do... |
21:15:15 | GordonBGood | Such as the new --seq2v2 that has be pulled out of --gc:destructors... |
21:15:27 | * | krux02 joined #nim |
21:15:59 | GordonBGood | Which actually also applies to strings and not just seqs in making them also destructor based... |
21:16:39 | GordonBGood | So should we name it --seqsstrsv2? or --seqstrv2? |
21:17:44 | GordonBGood | And since this has been extracted from --gc:destructors, what remains doesn't have much left to do with destructors... |
21:18:45 | GordonBGood | --gc:destructors is now really --gc:noCruftGCPlugin or --gc:noCruftGCHooks... |
21:19:13 | GordonBGood | Although it currently only works when --seqsv2 is also turned on... |
21:19:32 | * | clyybber quit (Quit: WeeChat 2.6) |
21:19:43 | GordonBGood | It could actually be backported to also work with version 1 seqs and strings |
21:19:56 | * | Vladar quit (Quit: Leaving) |
21:21:00 | GordonBGood | Changing --seqsv2 to something else isn't a problem as it isn't released yet and is still barely usable... |
21:21:56 | GordonBGood | But --gc:destructors is in version 1.0; however, it isn't usable with ref's unless one supplies the hooks; and... |
21:22:30 | GordonBGood | until araq finishes "araqsgc", I don't know that there are any others uses... |
21:23:28 | GordonBGood | One can hook newObjHook with alloc and traverseObjHook with discard to get a cruft-less --gc:none, but... |
21:23:44 | GordonBGood | I doubt anyone has done that other than to "play around" |
21:25:15 | GordonBGood | --newruntime isn't an issue as it is entirely destructor based and thus turns --...v2 when enabled |
21:25:38 | GordonBGood | *turns on --...v2 |
21:38:20 | hashbjorn | Does nim have something similar to what I know as a "Discriminated Union" type from F#? |
21:38:36 | hashbjorn | I'm want to have a type `Shape` |
21:38:53 | hashbjorn | which could be an instance of e.g. `Rect` `Circle`, `Triangle`, etc |
21:39:02 | disruptek | that sounds like a variant object. |
21:39:08 | hashbjorn | but I'm tryoing to avoid using inheritance |
21:39:22 | * | hashbjorn looks up variant objects |
21:39:28 | disruptek | aka `case object`. |
21:41:28 | hashbjorn | that looks like exactly what i need, thanks! |
21:41:37 | disruptek | yep. |
21:42:15 | hashbjorn | in case it interests anyone, I'm making a "tanks"-style multiplayer game in nim |
21:42:25 | disruptek | trajectory tanks or...? |
21:42:35 | hashbjorn | like top-down view of tanks |
21:42:49 | hashbjorn | walls in between, projectiles ricochet from walls. |
21:43:14 | hashbjorn | anyway I've been making it with a friend, and we've been writing it in a strictly functional style |
21:43:26 | disruptek | neat. |
21:43:29 | hashbjorn | so far we don't have a single `proc`, heh |
21:43:33 | hashbjorn | it's been a ton of fun |
21:43:42 | disruptek | is it oss? |
21:43:48 | hashbjorn | yeah |
21:43:56 | hashbjorn | https://github.com/kofoednielsen/pure-tanks |
21:44:03 | hashbjorn | it's not playable at all yet |
21:44:15 | disruptek | thanks, i will watch your progress. 😁 |
21:44:43 | hashbjorn | the idea is also to not include a front-end, but just expose a UDP port that players can send packets to |
21:44:49 | hashbjorn | and then send json objects back representing game state |
21:44:59 | hashbjorn | (we have a pretty tight hacker group who likes this kind of stuff - heh) |
21:45:18 | disruptek | i mean, who the hell wants to play a game with a front-end? |
21:45:39 | hashbjorn | more like: who wants to write a good front end 😂 |
21:46:16 | hashbjorn | but no I'm looking forward to writing a couple clients (bots?) in different languages. think the first one will be in elm |
21:48:59 | disruptek | sounds pretty fun. |
21:49:37 | disruptek | i spent hours and hours playing tank wars back in the day. scorched earth always felt like a rip off, though it was better in a lot of ways. |
21:53:12 | hashbjorn | i played a flash version of those games a bunch |
21:53:47 | disruptek | i get it, i'm old. 😝 |
21:54:30 | hashbjorn | hah I'm feeling old myself right now looking for my flash game. doesn't seem to be online anymore, but it's /flash/ so eh anyways |
21:55:09 | disruptek | yeah, plus never meet your heroes. |
21:56:51 | disruptek | there was a really simply one for commodore and another for apple ][ i played around the same time, but those EGA graphics, man. |
22:10:03 | * | sagax quit (Read error: Connection reset by peer) |
22:11:20 | * | Hideki_ joined #nim |
22:15:48 | * | Hideki_ quit (Ping timeout: 246 seconds) |
22:39:05 | * | luis_ joined #nim |
22:50:58 | * | nif quit (Quit: ...) |
22:51:09 | * | nif joined #nim |
22:59:26 | * | solitudesf quit (Ping timeout: 276 seconds) |
23:01:21 | * | Hideki_ joined #nim |
23:01:26 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
23:01:39 | * | pbb joined #nim |
23:22:56 | * | stefantalpalaru quit (Ping timeout: 240 seconds) |
23:23:39 | * | GordonBGood quit (Ping timeout: 260 seconds) |
23:23:50 | * | exelotl quit (Quit: Leaving) |
23:25:29 | * | xace quit (Ping timeout: 252 seconds) |
23:26:52 | * | luis_ quit (Quit: luis_) |
23:27:20 | * | luis_ joined #nim |
23:27:21 | * | xace joined #nim |
23:34:28 | * | seni quit (Quit: Leaving) |
23:44:50 | * | lritter quit (Ping timeout: 240 seconds) |
23:46:24 | * | Hideki_ quit (Remote host closed the connection) |
23:46:41 | * | Hideki_ joined #nim |
23:57:12 | * | Hideki_ quit () |
23:59:38 | * | Hideki_ joined #nim |