00:04:21 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:07:33 | shashlick | how do you get the nimcache directory in the VM |
00:33:31 | zachcarter | anyone have any insight into? |
00:33:34 | zachcarter | https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim#L33 |
00:49:03 | FromGitter | <Varriount> zachcarter: Isn't the region deallocated when the block exits? |
01:04:50 | * | theelous3_ quit (Ping timeout: 268 seconds) |
01:13:09 | zachcarter | @Varriount: I'm not sure... |
01:13:25 | zachcarter | I'm also not sure about how to move stacks b/w threads |
01:14:20 | zachcarter | @Varriount - I don't believe it's deallocated unless you're using `withScratchRegion` |
01:14:30 | zachcarter | at least that's what I'm seeing in the code |
02:03:10 | * | vlad1777d quit (Ping timeout: 272 seconds) |
02:20:42 | FromDiscord_ | <demotomohiro> Hi, anyone know how to do "cc = vcc" in project.nims file? |
02:21:27 | leorize | `switch("cc", "vcc")` |
02:21:34 | leorize | or `--cc:vcc` |
02:21:37 | leorize | your choice |
02:25:15 | FromDiscord_ | <demotomohiro> leorize, thank you! it worked! |
02:27:29 | FromDiscord_ | <demotomohiro> I thought cc value should be changed with put proc but didn't work |
02:28:22 | leorize | http://nim-lang.github.io/Nim/nims.html |
02:28:31 | leorize | ^ that's the NimScript documentation |
02:33:55 | * | ng0_ joined #nim |
02:34:10 | FromDiscord_ | <demotomohiro> Thank you |
02:35:34 | FromDiscord_ | <demotomohiro> I know compiler switch can be set with switch proc or `--` template, but I thought cc was not compiler switch |
02:36:09 | FromDiscord_ | <demotomohiro> nim --fullhelp do not list --cc option |
02:36:28 | leorize | well, every assignment in the default `nim.cfg` is a compiler switch |
02:37:05 | FromDiscord_ | <demotomohiro> https://nim-lang.github.io/Nim/nimc.html#compiler-selection |
02:37:11 | * | ng0 quit (Ping timeout: 256 seconds) |
02:37:17 | FromDiscord_ | <demotomohiro> that explains --cc switch |
02:37:34 | leorize | guess it's not documented in the `--fullhelp` |
02:39:45 | FromDiscord_ | <demotomohiro> so, cc = gcc in nim.cfg is a compiler switch, but 'gcc.options.always' is not? |
02:40:06 | leorize | probably? try to pass it on the command line |
02:44:06 | FromDiscord_ | <demotomohiro> I can set --gcc.options.always:-wall and I got |
02:44:21 | FromDiscord_ | <demotomohiro> gcc.exe: error: unrecognized command line option '-wall'; did you mean '-Wall'? |
02:46:09 | FromDiscord_ | <demotomohiro> so, it seems every assignment in `nim.cfg` are compiler switch |
02:46:34 | leorize | now you'd wonder why `put` is there |
02:47:18 | FromDiscord_ | <demotomohiro> Document of `put` says "Sets a configuration 'key' like 'gcc.options.always' to its value." |
02:47:54 | FromDiscord_ | <demotomohiro> but `put` cannot be used to set cc |
02:48:09 | leorize | maybe it's a bug? |
02:48:24 | leorize | try to see if you can actually set `gcc.options.always` with it |
02:52:21 | FromDiscord_ | <demotomohiro> I can write `put "gcc.options.always", "-wall"` in project.nims and I got error message from gcc about it. |
02:53:03 | FromDiscord_ | <demotomohiro> so put works to set `gcc.options.always` value |
02:57:28 | FromDiscord_ | <demotomohiro> `switch` proc can set both `cc` and `gcc.options.always`. `put` can set `gcc.options.always` but not `cc`. |
03:05:44 | * | banc quit (Quit: ZNC - http://znc.in) |
03:07:46 | * | dddddd quit (Remote host closed the connection) |
03:16:03 | * | kapil____ joined #nim |
03:29:11 | xace | does anyone know how your suppose to read the output from nimprof? i dont understand the inof in profiler_results |
03:29:32 | * | banc joined #nim |
04:03:40 | * | matti joined #nim |
04:34:05 | FromGitter | <gogolxdong> > BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. |
04:46:57 | * | leorize quit (Quit: WeeChat 2.2) |
05:00:38 | * | leorize joined #nim |
05:24:33 | * | nsf joined #nim |
05:57:08 | * | narimiran joined #nim |
06:57:07 | * | narimiran quit (Remote host closed the connection) |
07:37:52 | * | ng0_ is now known as ng0 |
07:49:17 | * | krux02 joined #nim |
08:05:28 | * | stefanos82 joined #nim |
08:10:47 | FromGitter | <tim-st> the following code only fails for `i64`, what is the reason it works for other types like i8,i16,i32? `var x: int = 0; inc(x, 1i64)` |
08:17:12 | * | shpx quit (Excess Flood) |
08:17:18 | * | PMunch joined #nim |
08:24:50 | leorize | !eval var x: int = 0; inc x, 1'i64 |
08:24:51 | NimBot | Compile failed: in.nim(1, 21) Error: type mismatch: got <int, int64> |
08:27:05 | leorize | !eval var x: int = 0; inc x, 1'i32 |
08:27:09 | NimBot | <no output> |
08:27:32 | FromGitter | <narimiran> !eval var x: int = 0; inc x, 1'i16; echo x |
08:27:34 | NimBot | 1 |
08:27:41 | * | PMunch quit (Quit: Leaving) |
08:27:57 | * | PMunch joined #nim |
08:28:00 | FromGitter | <narimiran> !eval var x: int64 = 0; inc x, 1'i32; echo x |
08:28:03 | NimBot | 1 |
08:28:49 | leorize | I think the compiler assumed that `int` will be 32bit |
08:29:01 | leorize | could be a bug |
08:34:41 | FromGitter | <tim-st> the idea behind it could be some kind of safety check, to make the code more cross plattform, but then I dont understand why other non int64 types work |
08:36:27 | leorize | ping Araq I guess |
08:38:34 | FromGitter | <narimiran> !eval var x: int16 = 0; inc x, 1'i32; echo x |
08:38:37 | NimBot | 1 |
08:39:11 | FromGitter | <narimiran> ok, there goes my guess.... i thought this might not work |
08:41:18 | * | leorize quit (Ping timeout: 264 seconds) |
08:42:49 | * | leorize joined #nim |
08:45:54 | * | Trustable joined #nim |
08:51:34 | FromGitter | <alehander42> can i say that i want seq to be indexed by distinct type |
08:52:01 | leorize | no |
08:52:35 | leorize | you can always use tables for that |
08:54:09 | FromGitter | <alehander42> well, it wouldn't be very optimal |
08:54:58 | FromGitter | <alehander42> maybe I can do a distinct seq and a custom `[]` |
08:54:58 | FromGitter | <alehander42> :D |
08:54:59 | leorize | well, you can make your distinct seq type |
08:55:44 | leorize | with custom `[]` and `[]=` |
08:59:35 | FromGitter | <narimiran> @alehander42 i think there was a similar question couple of days ago |
09:00:11 | FromGitter | <narimiran> ...and i don't remember the answer :D sorry :) |
09:00:37 | FromGitter | <alehander42> yeah leorize is righ |
09:00:38 | FromGitter | <alehander42> t |
09:00:43 | * | Sembei joined #nim |
09:01:07 | * | Pisuke quit (Ping timeout: 240 seconds) |
09:01:32 | * | PMunch left #nim (#nim) |
09:01:36 | * | PMunch joined #nim |
09:03:39 | * | PMunch quit (Quit: Leaving) |
09:03:51 | * | PMunch joined #nim |
09:04:38 | PMunch | Well you don't need a distinct seq type |
09:05:00 | PMunch | It would be enough with just [] that takes a seq and your distinct type |
09:05:31 | PMunch | Unless you want it to only be able to slice it with your distinct type |
09:05:46 | FromGitter | <alehander42> well yeah |
09:05:48 | FromGitter | <alehander42> that's the point |
09:06:06 | FromGitter | <alehander42> i want to make sure i don't index it with the wrong value |
09:06:12 | FromGitter | <alehander42> as i have like 4 kinds of indexes |
09:07:06 | * | floppydh joined #nim |
09:13:44 | FromGitter | <alehander42> awesome, it seems it works |
09:14:48 | FromGitter | <alehander42> one can create a macro distinctSeq too, but it would require some configurability (e.g. if you don't want `[]=` etc), not sure if worth it |
09:15:23 | leorize | who needs configurability anw |
09:15:40 | leorize | if you wanna fork, fork the entire thing ;) |
09:21:50 | FromGitter | <yglukhov> Araq: ever thought of how to make channels respect the `=` proc? |
09:23:45 | FromGitter | <alehander42> leorize, yeah, if you need customization, you can just write down the types manually |
09:24:53 | FromGitter | <alehander42> @mratsim I decided i'll just do a very simple symbolic lib only for my purposes, i'll still release it if somebody finds it useful |
09:55:03 | FromGitter | <bung87> can I treat seqA[0].addr as c++ vec.data() ? |
09:58:05 | serialdev[m] | catching up from helsinki, I was reading the discussion on symbolic computation |
09:58:17 | serialdev[m] | it might be worthwhile reaching out to #clasp on irc |
09:59:02 | serialdev[m] | drmeister has done alot of symbolic computation work in cpp that gets directly loaded onto clasp. maybe we could re-use it as a symbolic computation engine in nim |
09:59:42 | serialdev[m] | https://m.youtube.com/watch?v=mbdXeRBbgDM << worth watching imo |
10:01:16 | * | ajibade joined #nim |
10:01:31 | * | brainproxy quit (Ping timeout: 246 seconds) |
10:01:54 | * | kklas joined #nim |
10:03:09 | FromGitter | <bung87> not talk to me,right? |
10:04:19 | leorize | bung87: technically yes |
10:04:38 | leorize | you can use it like that |
10:05:48 | * | Vladar joined #nim |
10:06:33 | FromGitter | <bung87> so it store elements in memory continuous? |
10:06:50 | leorize | yea, that's how it's implemented |
10:07:34 | FromGitter | <bung87> good ,then I can use it withou worry |
10:13:54 | FromGitter | <alehander42> @serialdev[m] thank you, I am not even sure yet most symbolic libs support what I need: i am mostly interested in summation expansions(no idea if that's correct) and similar stuff |
10:16:15 | * | dom96_w joined #nim |
10:20:46 | * | dom96_w quit (Changing host) |
10:20:46 | * | dom96_w joined #nim |
10:22:38 | * | brainproxy joined #nim |
10:26:35 | * | blarghz joined #nim |
10:30:45 | * | brainproxy quit (Ping timeout: 252 seconds) |
10:34:18 | * | ajibade quit (Remote host closed the connection) |
10:40:43 | * | blarghz quit (Quit: leaving) |
10:45:44 | FromGitter | <alehander42> btw Araq, can we merge https://github.com/nim-lang/Nim/pull/8627 |
10:46:39 | * | vlad1777d joined #nim |
11:10:30 | * | kklas quit (Quit: Textual IRC Client: www.textualapp.com) |
11:15:07 | * | kapil____ quit (Quit: Connection closed for inactivity) |
11:44:57 | * | dddddd joined #nim |
12:18:23 | FromGitter | <mratsim> I’d like something to extract reliably the generic params in macro merged as well :P - https://github.com/nim-lang/Nim/pull/8554 |
12:37:09 | serialdev[m] | https://github.com/SerialDev/inim-mode |
12:37:22 | serialdev[m] | Emacs lisp nim repl support basic support is done |
12:37:34 | serialdev[m] | Emacs lisp nim repl basic support is done |
12:40:06 | hohlerde | what should I use for the removed unchecked pragma? |
12:43:47 | Araq | hohlerde, system.UncheckedArray |
12:44:06 | hohlerde | thx |
12:46:37 | FromGitter | <arnetheduck> seen this, about forking compiler to do incremental compiles? https://blog.thecybershadow.net/2018/11/18/d-compilation-is-too-slow-and-i-am-forking-the-compiler/ |
12:47:52 | * | stefanos82_ joined #nim |
12:48:14 | * | stefanos82_ quit (Client Quit) |
12:48:42 | * | stefanos82 quit (Ping timeout: 252 seconds) |
12:50:57 | FromGitter | <mratsim> posted that yesterday ;) |
12:52:32 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:54:36 | FromGitter | <arnetheduck> oh. maybe that's where I got it from then :) |
12:57:06 | FromGitter | <alehander42> it was in HN too |
13:11:40 | FromGitter | <yyyc514> `Error: expression 'inc(p.last_id, 1)' has no type (or is ambiguous)` what am i missing |
13:11:47 | FromGitter | <yyyc514> last_id is uint64 |
13:14:37 | FromGitter | <alehander42> you're probably trying to use it as a value? |
13:14:43 | FromGitter | <alehander42> inc doesn't return anything |
13:14:56 | FromGitter | <alehander42> also, you can just `inc(p.last_id)` |
13:15:04 | FromGitter | <alehander42> default is 1 |
13:15:12 | FromGitter | <yyyc514> yeah, that didn't work at first but because the property wasn't public :) |
13:15:13 | FromGitter | <yyyc514> thanks |
13:17:26 | * | ajibade joined #nim |
13:18:01 | * | dom96_w joined #nim |
13:27:59 | zachcarter | was inquiring about this yesterday evening, but there weren't a lot of folks online |
13:28:16 | zachcarter | does anyone have any insight into how this works - https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim#L33 |
13:28:46 | zachcarter | I wrote a simple app that uses regions and I can see the memory allocations happening in valgrind with massif |
13:29:02 | zachcarter | but I still have no idea how to move a stack assocated with a memregion to another thread |
13:31:04 | * | ajibade quit (Remote host closed the connection) |
13:32:57 | FromGitter | <tim-st> just found out untyped.repr is even better than nimpretty :0 |
13:33:09 | FromGitter | <tim-st> (for a given code block) |
13:34:50 | * | Vladar quit (Remote host closed the connection) |
13:46:45 | * | dddddd quit (Ping timeout: 252 seconds) |
14:11:55 | * | dddddd joined #nim |
14:13:36 | * | flyx quit (Ping timeout: 260 seconds) |
14:15:12 | * | flyx joined #nim |
14:23:26 | * | kapil____ joined #nim |
14:26:06 | * | vlad1777d quit (Ping timeout: 250 seconds) |
14:27:10 | * | nsf quit (Quit: WeeChat 2.3) |
14:29:43 | * | stefanos82 joined #nim |
14:37:55 | * | enthus1ast quit (Quit: WeeChat 1.6) |
14:38:30 | * | enthus1ast joined #nim |
14:39:21 | FromGitter | <yyyc514> so are `var` arguemnts impossible to pass in a closure? |
14:40:00 | Araq | yes |
14:40:40 | FromGitter | <yyyc514> hmmm |
14:44:15 | FromGitter | <yyyc514> ref object works just fine though it seems? |
14:44:45 | Araq | yes |
14:46:23 | FromGitter | <yyyc514> becase youc an't be sure that var isn't on someone elses stack that might disappear? |
14:46:43 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:51:31 | Araq | exactly. |
14:58:30 | * | dom96_w joined #nim |
15:15:09 | * | Vladar joined #nim |
15:20:19 | FromGitter | <Varriount> Araq: Do we have any documentation on using the region gc? zacharycarter is having some trouble with it. |
15:23:20 | * | floppydh quit (Quit: WeeChat 2.3) |
15:24:06 | Araq | no... :-/ |
15:33:12 | * | krux02 quit (Remote host closed the connection) |
15:34:55 | * | krux02 joined #nim |
15:35:03 | * | krux02 quit (Remote host closed the connection) |
15:39:20 | * | PMunch quit (Quit: Leaving) |
15:41:55 | FromGitter | <tim-st> should this code work in a file called `test.nim`? https://gist.github.com/tim-st/f4fdaf5eb2b784491d860a4d8af99140 |
15:44:01 | * | enthus1ast quit (Ping timeout: 260 seconds) |
15:44:45 | Araq | no |
15:44:52 | Araq | or maybe, I dunno |
15:45:15 | FromGitter | <tim-st> when I hover over it it says `test.test.B` but it then assumes it is `test.B` |
15:46:06 | FromGitter | <tim-st> in the global scope `test` from `test.nim` is accepted as scope name |
15:47:27 | FromGitter | <tim-st> I need to know this for fixing the recursive alias type crash, but I'm not sure what should work |
15:48:25 | FromGitter | <alehander42> is it possible to define a type inside a proc ? |
15:48:36 | FromGitter | <alehander42> when is this useful |
15:49:12 | FromGitter | <tim-st> yes, I tried to find all valid type definition scopes, it's useful where also nested proc definitions are useful |
15:51:32 | Araq | alehander42, btw what happened to your new JS codegen? |
15:55:44 | * | Perkol joined #nim |
15:55:53 | * | neinVolta_ joined #nim |
15:56:05 | * | neinVolta_ left #nim (#nim) |
15:58:57 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:59:50 | * | enthus1ast joined #nim |
16:02:21 | * | dom96_w joined #nim |
16:06:55 | * | narimiran joined #nim |
16:18:53 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:26:03 | leorize | if I should not close the `inputStream` of a `Process`, then is there anyway to signify that process that I don't have any input left to feed it? |
16:26:45 | Araq | a good question |
16:27:45 | Araq | execCmdEx disagrees with the docs and closes it earlier to signal EOF |
16:27:57 | Araq | and I've been told that is what should be used on Unix |
16:28:07 | Araq | it blocks the process on Windows though |
16:30:32 | Araq | I think you should go ahead and close it and let us fix the Windows variant and update the docs |
16:30:52 | Araq | on the other hand |
16:31:12 | Araq | it might require a new proc close(p: Process; s: Stream) |
16:31:57 | Araq | or a more explicit signalStdinEof(p: Process) |
16:34:34 | FromGitter | <alehander42> Araq, well it is somewhere: probably around 50-60% done(maybe most in the ast->ast, the more easy renderer is less developed) |
16:35:07 | Araq | ok, what happened? Too much work? No real benefits? |
16:35:56 | * | Vladar quit (Remote host closed the connection) |
16:36:01 | leorize | Araq: I think signalStdinEof would be useful |
16:36:20 | FromGitter | <alehander42> it's just not very interesting after a while, as one mostly repeats similar code transformations |
16:36:25 | leorize | pretty sure no one would need to close output streams |
16:36:27 | FromGitter | <alehander42> and not a lot of free time lately |
16:36:34 | FromGitter | <alehander42> but I'll try to finish it |
16:37:03 | Araq | leorize, I just tested it on windows |
16:37:10 | Araq | inp.close() works |
16:37:42 | Araq | but so does not closing, hmmm |
16:38:14 | FromGitter | <alehander42> Araq, do you need it soon? Or just checking |
16:38:23 | Araq | nah, I was curious |
16:38:36 | Araq | since at one point I would like to do the same for the cgen |
16:39:49 | FromGitter | <alehander42> well, it's mostly a matter of doing it, there were some annoying things to translate as everything assumed it would generate strings (as the magic ops), but with a macro or two or a bit of refactoring it seemed to be sufficient |
16:40:10 | Araq | windows does line buffering |
16:40:17 | Araq | and doesn't need the close() |
16:42:05 | * | dom96_w joined #nim |
16:45:50 | * | Trustable quit (Remote host closed the connection) |
16:57:45 | * | nsf joined #nim |
16:57:58 | * | natrys joined #nim |
16:58:24 | * | rockcavera quit (Remote host closed the connection) |
17:01:33 | ldlework | geom/poly.nim(3, 12) Error: cannot open 'geom/line' |
17:01:38 | ldlework | aww my nim game bit-rotted |
17:02:01 | leorize | just remove the `geom` part and it'll be fine |
17:02:55 | leorize | Araq: are the PFloat* and PInt* in system.nim actually used anywhere? |
17:02:58 | ldlework | yeah that got me a bit further |
17:07:18 | ldlework | diamond.nim(164, 13) Error: attempting to call undeclared routine: 'drawStipple' |
17:07:19 | ldlework | hmm |
17:07:36 | ldlework | graphics lib changed i guess |
17:07:50 | ldlework | the word "stipple" doesn't appear in https://github.com/nim-lang/graphics/blob/master/graphics.nim |
17:10:40 | ldlework | strange |
17:16:55 | ldlework | I'm trying to build an graphics/SDL app on NixOS and I'm getting |
17:16:56 | ldlework | could not load: libSDL.so(|.1|.0) |
17:17:05 | ldlework | how can I tell nim where sdl is? |
17:17:22 | leorize | it should be in LD_LIBRARY_PATH |
17:17:26 | leorize | if you're using Nix |
17:17:33 | leorize | you'd need to open a nix-env with sdl |
17:17:54 | ldlework | hmm i did nix-shell -p nim SDL |
17:18:02 | ldlework | which worked, and compiled but it wont run |
17:18:42 | leorize | does your LD_LIBRARY_PATH got SDL lib folder? |
17:18:56 | ldlework | hmm, it is set to /run/opengl-driver/lib |
17:19:03 | ldlework | in and out of nix-shell |
17:19:45 | leorize | can you run sdl-config? |
17:20:05 | ldlework | it gives me the usage string |
17:20:09 | ldlework | not sure how to use that |
17:22:02 | leorize | try passing this to the compiler: `--dynlibOverride:libSDL -l:"$(sdl-config --libs)"` |
17:22:46 | ldlework | leorize: nice, now it wants sdl-ttf |
17:22:57 | ldlework | i'll use the same trick |
17:23:04 | ldlework | well |
17:23:10 | ldlework | does sdl-config work for things like sdl-ttf |
17:23:22 | leorize | no, you'd need pkg-config for that |
17:23:32 | leorize | welcome to the world of Linux packaging :P |
17:24:31 | leorize | ldlework: ok it's simpler for sdl-ttf |
17:24:37 | ldlework | alright |
17:24:53 | leorize | just add "-lSDL_ttf" to the `-l:` switch above |
17:25:09 | leorize | and add `--dynlibOverride:libSDL_ttf` also |
17:26:50 | ldlework | leorize: hey I got it working |
17:27:43 | leorize | it's rather weird that the `{.dynlib.}` doesn't work for Nix |
17:27:59 | leorize | can you give me the output of `readelf -d` on the generated binary |
17:28:14 | leorize | I'd like to take a look at how Nix does things |
17:28:26 | ldlework | leorize: someone in #nix told me i should use patchelf |
17:28:41 | ldlework | which i guess would be a generic solution |
17:28:47 | ldlework | neat to know there are multiple ways to go about it |
17:28:57 | leorize | ah, yes, heard about it |
17:29:44 | ldlework | leorize: https://gist.github.com/dustinlacewell/580cd4ac43ab2878ad58be1eb850d8a8 |
17:30:21 | ldlework | i wonder where the stipple drawing function went though ^_^' |
17:30:43 | leorize | I see, they used `rpath` |
17:30:59 | leorize | in that case then only patchelf or this manual way would work on Nix |
17:39:26 | ldlework | nice i got another one of my nim apps working too |
17:40:28 | ldlework | lib/core/macros.nim(376, 41) Error: type mismatch: got (string) but expected one of: macro to(node: JsonNode; T: typedesc): untyped |
17:40:53 | ldlework | I guess my ECS would need to refurbished though |
17:42:40 | ldlework | i bet there are good game engines for Nim by now though |
17:43:11 | * | thomasross quit (Quit: Leaving) |
17:53:24 | FromGitter | <arnetheduck> when exactly is the last expression in a block taken as the result of that block? ⏎ ⏎ ```func f(v: seq[int]): int = ⏎ if v.len == 3: ⏎ x() ⏎ v[0]``` ⏎ ⏎ this will return `v[0]`, but when does that happen? when the magic `result` is not used elsewhere? [https://gitter.im/nim-lang/Nim?at=5bf83e9497a8982b9a527618] |
17:56:47 | leorize | it's somewhere in the Manual |
17:56:56 | leorize | but iirc, it happens when: |
17:57:32 | leorize | - the last statement of the block is an expression |
17:57:40 | leorize | - the result variable weren't used |
17:57:59 | leorize | - the return statement weren't used |
18:07:56 | FromGitter | <tim-st> should this work? `type A = string or int` |
18:10:02 | leorize | pretty sure `type A = string|int` work better |
18:10:14 | leorize | !eval type A = string or int |
18:10:17 | NimBot | <no output> |
18:10:22 | leorize | !eval type A = string|int |
18:10:25 | NimBot | <no output> |
18:10:31 | leorize | the compiler is fine with both |
18:10:46 | * | Perkol quit (Quit: Leaving) |
18:11:34 | FromGitter | <tim-st> yes, also thought `|` is better |
18:12:37 | FromGitter | <tim-st> ok, seems to be a working syntax |
18:17:10 | Araq | arnetheduck: https://nim-lang.org/docs/manual.html#statements-and-expressions-void-context |
18:18:11 | Araq | the section could be expanded a bit |
18:18:46 | FromGitter | <tim-st> this is also valid? `type A = string | int or float` |
18:19:58 | leorize | !eval type A = string | int or float |
18:20:00 | NimBot | <no output> |
18:20:07 | leorize | tim-st: you could always try :P |
18:20:33 | leorize | \!eval works from gitter too |
18:20:35 | FromGitter | <tim-st> I already tried it, just want to make sure that my implementation checks only the correct syntax |
18:20:51 | FromGitter | <arnetheduck> thanks @leorize and @Araq yeah a note about how that works for if/for/block would probably be helpful |
18:28:41 | Araq | true but it does the "obvious" thing, an if statement that has a block of type T needs to have an 'else' and all branches also have to be of type T and then the full if is of T |
18:29:02 | Araq | likewise for 'case' |
18:29:27 | Araq | and a for loop body always has to be of type 'void' |
18:29:39 | Araq | same for 'while' |
18:34:07 | FromGitter | <tim-st> good that I tested it; found another crash creator: `type T = not string; echo T is T` |
18:36:56 | leorize | !eval type T = not string; echo T is T |
18:36:59 | NimBot | true |
18:37:13 | leorize | tim-st: confirmed regression? |
18:37:19 | leorize | !eval echo NimVersion |
18:37:22 | NimBot | 0.18.0 |
18:37:46 | FromGitter | <tim-st> yes, good catch |
18:37:51 | FromGitter | <tim-st> 1) 19.9 windows |
18:38:34 | FromGitter | <tim-st> also try: `type T = not not T` |
18:46:05 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:54:20 | * | zachk joined #nim |
19:06:55 | * | zachk quit (Changing host) |
19:06:55 | * | zachk joined #nim |
19:08:21 | * | nsf quit (Quit: WeeChat 2.3) |
19:26:22 | * | vlad1777d joined #nim |
19:43:33 | * | natrys quit (Quit: natrys) |
20:01:14 | Araq | yglukhov[m]: I missed your PR ;-) |
20:04:14 | FromGitter | <arnetheduck> @Araq but there are subtleties I guess for when the if is a bit more comples.. ie `if x != nil: x.member else: nil` - there needs to be a type resolution rule in such a case (at least it would be nice if there was, haven't checked if that particular statement works) |
20:04:45 | Araq | yeah indeed, the type relation is called "commonType" in the compiler |
20:04:55 | Araq | and handles the cases you outlined |
20:10:29 | FromGitter | <arnetheduck> bah. the choice between nothing, `return` and `result` is one I'd rather not have, `result` is the least useful on average |
20:11:07 | FromGitter | <arnetheduck> but I like the last-expression-is-return thing in general |
20:23:52 | * | Ven`` joined #nim |
20:24:56 | * | Ven` joined #nim |
20:25:51 | FromGitter | <yglukhov> Araq: you mean the test pr? |
20:26:13 | Araq | jo |
20:27:34 | FromGitter | <yglukhov> not sure i follow... jo? |
20:27:58 | Araq | yes |
20:28:29 | * | Ven`` quit (Ping timeout: 268 seconds) |
20:28:58 | FromGitter | <yglukhov> but you havent merged your branch either. the pr should be merged afterwards. or just pull it into the branch |
20:29:07 | Araq | arnetheduck: actually 'result' is the most useful of the 3 |
20:29:20 | Araq | yglukhov: I thought you take my branch and finish it |
20:30:33 | FromGitter | <yglukhov> oh, sure i can do that. but i told you "done", once i was done with that :) |
20:30:37 | FromGitter | <yglukhov> ok, ill do the pr |
20:32:29 | FromGitter | <arnetheduck> it's the one that's the easiest to explicitly add in the cases it's necessary, though I tend to prefer a more functional style for.. er.. functions that return stuff - limits the surface area for mistakes.. specially nasty when refactoring, where it's easy to end up with code that uses both result and return, makes for some nasty reading |
20:34:19 | Araq | yeah, the solution is to avoid 'return' :P |
20:34:53 | * | mosORadi joined #nim |
20:37:18 | FromGitter | <arnetheduck> well, make return not take an argument.. but then it's easy to forget to assign result first |
20:37:51 | FromGitter | <arnetheduck> choice is bad :) |
20:38:26 | zachcarter | thanks @Varriount - it's not that Im necessarily having trouble with it - it's working |
20:38:43 | zachcarter | but the docs state there is a way to pass the stacks associated with a mem region b/w threads |
20:38:46 | zachcarter | or at least use them across threads |
20:39:02 | zachcarter | does ANYONE know how this is supposed to work haha? |
20:39:16 | zachcarter | if not - is there a point in having a GC / feature that no one knows how / is going to use? |
20:39:34 | zachcarter | it doesn't seem lik they're being used in any code on github, besides in the Nim stdlib itself |
20:40:13 | zachcarter | I've found one library using them - and I don't think they're being used properly - plus they're only using `withScratchRegion` |
20:40:29 | FromGitter | <yglukhov> Araq: done https://github.com/nim-lang/Nim/pull/9790 :) |
20:59:56 | * | banc quit (Ping timeout: 268 seconds) |
21:01:37 | * | banc joined #nim |
21:05:33 | * | theelous3_ joined #nim |
21:19:01 | * | Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:22:44 | * | stefanos82 quit (Quit: Quitting for now...) |
21:27:44 | zachcarter | how is this possible - https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim#L214 - when the return type isn't exported? |
21:33:06 | zachcarter | well, maybe the question isn't how is this possible, maybe it is - should StackPtr and associated fields be exported? |
21:44:46 | * | narimiran quit (Remote host closed the connection) |
22:00:15 | * | wildlander joined #nim |
22:17:15 | * | rlr quit (Quit: quitting) |
22:17:23 | * | rlr joined #nim |
22:41:51 | * | kapil____ quit (Quit: Connection closed for inactivity) |
22:42:28 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:44:24 | * | mosORadi quit (Quit: Connection closed for inactivity) |
23:11:26 | * | enthus1ast quit (Ping timeout: 260 seconds) |
23:26:57 | * | enthus1ast joined #nim |
23:38:14 | * | lukd quit (Quit: WeeChat 2.3) |
23:42:26 | * | lukd joined #nim |
23:49:21 | * | enthus1ast quit (Ping timeout: 260 seconds) |