00:28:09 | * | xet7 quit (Quit: Leaving) |
00:28:47 | * | xet7 joined #nim |
00:37:05 | FromGitter | <luka-mikec> hi, is there something like "with some_long_expr as a: a.f" in Nim? I do not want deep copy of the result of some_long_expr to happen, and there are no C++-like references in Nim... |
00:38:01 | dom96 | template a: expr = some_long_expr |
00:38:23 | FromGitter | <RedBeard0531> `let myRef = addr some_long_expr` is pretty close although as the manual notes, that can be unsafe |
00:38:56 | FromGitter | <RedBeard0531> @dom96: doesn't that re-evaluate the expr every time a is used? |
00:39:49 | dom96 | yeah, it will |
00:40:20 | dom96 | You can also do something like this: var x: ref int; new(x); x[] = 42 |
00:40:20 | * | Yardanico quit (Read error: Connection reset by peer) |
00:40:32 | FromGitter | <RedBeard0531> when I've wanted that in the past, its been for something moderately expensive like `let node = table.mgetOrDefault(key); if node[].isNil: node[] = some_init_expr; use(node[])` |
00:40:59 | FromGitter | <RedBeard0531> err pretend I put `addr` before `table` |
00:42:18 | * | Yardanico joined #nim |
00:43:09 | FromGitter | <RedBeard0531> That's the best pattern I've found for lookups into a hash table with lazy construction of missing elements, that will only do a single lookup no matter what. But I'm still kinda new to this language. Is there a better pattern? |
00:45:14 | dom96 | `addr` is unsafe |
00:45:31 | dom96 | so I would be wary about using it |
00:46:08 | dom96 | I would just use a template for that case I think |
00:46:27 | dom96 | but yeah, it would lookup the key each time which isn't ideal |
00:47:17 | FromGitter | <RedBeard0531> I've been treating it similarly to C++ T&/const T&. It is safe for short borrows when you know the referent outlives the reference. Is that the wrong way to think of it? |
00:48:51 | dom96 | I just treat every use of 'addr', 'ptr', 'unsafe*' as unsafe no matter in what situation it's used. |
00:49:06 | dom96 | It's sort of like an unsafe subset of Nim |
00:54:34 | FromGitter | <RedBeard0531> Unfortunately unsafeAddr seems to be necessary in order to use vector intrinsics in nim. And even that doesn't work with const arrays. |
00:55:39 | dom96 | Well, just like with Rust's unsafe blocks you should minimise it to where it's necessary |
00:55:48 | dom96 | and try to wrap that code in safe abstractions |
00:59:08 | dom96 | but that's just how I view things |
00:59:13 | dom96 | Araq might have a different opinion |
01:04:56 | * | willprice quit (Ping timeout: 252 seconds) |
01:08:50 | FromGitter | <luka-mikec> @dom96, @RedBeard0531, thank you! |
01:11:01 | * | dddddd quit (Remote host closed the connection) |
01:11:11 | Yardanico | Clang (5.0.1) vs GCC (7.2.1) - time to bootstrap nim from csources: ~2min30sec vs ~4min30sec |
01:11:26 | Yardanico | On aarch64 (arm8) |
01:12:52 | * | gokr quit (Ping timeout: 268 seconds) |
01:18:13 | * | Kingsquee joined #nim |
01:27:41 | GitDisc | <Lite5h4dow> im wondering how would i go about running other programs with operators from nim in linux |
01:28:05 | GitDisc | <Lite5h4dow> i want to make a wallpaper randomiser in nim |
01:28:17 | GitDisc | <Lite5h4dow> i know its overkill but i want to give it a try |
01:29:46 | Yardanico | What do you mean "running other programs with operators"? |
01:30:27 | Yardanico | Maybe you just need osproc module? |
01:31:08 | GitDisc | <Lite5h4dow> hold on let me give you an example |
01:31:56 | GitDisc | <Lite5h4dow> `feh --bg-scale /path/to/random/image` |
01:32:04 | GitDisc | <Lite5h4dow> i want to run that command from nim |
01:32:21 | GitDisc | <Lite5h4dow> selecting a random image with nim |
01:32:32 | GitDisc | <Lite5h4dow> and have it change every half an hour or so |
01:32:53 | Yardanico | Yeah |
01:32:59 | Yardanico | Just use osproc module |
01:33:23 | GitDisc | <Lite5h4dow> sweet |
01:33:24 | Yardanico | It allows you to run other processes |
01:33:38 | Yardanico | https://nim-lang.org/docs/osproc.html |
01:33:41 | GitDisc | <Lite5h4dow> ❤ |
01:33:43 | GitDisc | <Lite5h4dow> love you |
01:34:37 | * | endragor joined #nim |
01:36:15 | * | endragor_ joined #nim |
01:37:00 | GitDisc | <Lite5h4dow> one more thing |
01:37:14 | GitDisc | <Lite5h4dow> looking for files in a folder |
01:37:24 | GitDisc | <Lite5h4dow> any idea how i would go about that? |
01:37:35 | * | MJCaley joined #nim |
01:37:43 | GitDisc | <Lite5h4dow> like jpgs, pngs to ad to a sequence later |
01:37:52 | GitDisc | <Lite5h4dow> like jpgs, pngs to add to a sequence later |
01:39:43 | * | endragor quit (Ping timeout: 248 seconds) |
01:53:51 | * | zielmicha_ quit (Read error: Connection reset by peer) |
01:55:21 | * | zielmicha_ joined #nim |
01:57:10 | GitDisc | <Lite5h4dow> nvm |
01:57:23 | GitDisc | <Lite5h4dow> walkDir should have what i need |
02:04:27 | * | vlad1777d quit (Ping timeout: 240 seconds) |
02:17:03 | * | vivus quit (Quit: Leaving) |
02:21:24 | * | Yardanico quit (Ping timeout: 272 seconds) |
02:31:13 | * | iAmSlow quit (Remote host closed the connection) |
02:33:20 | * | Yardanico joined #nim |
02:42:18 | * | chemist69 quit (Ping timeout: 272 seconds) |
02:42:52 | * | MJCaley quit (Quit: MJCaley) |
02:53:14 | * | MJCaley joined #nim |
02:55:37 | * | chemist69 joined #nim |
03:04:05 | * | fvs joined #nim |
03:05:47 | fvs | trying to set {.callconv: cdecl.} pragma before procs in header fails: invalid pragma - any ideas? |
03:08:12 | fvs | as per: https://nim-lang.org/docs/manual.html#pragmas-compilation-option-pragmas |
03:08:44 | * | marenz__ joined #nim |
03:12:33 | * | marenz_ quit (Ping timeout: 248 seconds) |
03:36:48 | * | MJCaley quit (Quit: Bye) |
03:41:19 | FromGitter | <zacharycarter> in header? |
03:41:33 | FromGitter | <zacharycarter> you're supposed to use pragmas in nim files |
03:41:52 | FromGitter | <zacharycarter> fvs ^ |
03:42:27 | fvs | yes in nim header. solved using {.push callconv: cdel} ... {.pop.} |
03:43:14 | fvs | *cdecl |
03:43:59 | fvs | trying to wrap dislin and too lazy to add this to each proc - there are hundreds :) |
03:46:22 | FromGitter | <zacharycarter> nim doesn't have headers but whatev :) |
04:08:20 | fvs | crap, dislin needs Motif under linux :( |
04:13:44 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
04:23:43 | * | jonafato joined #nim |
04:38:08 | * | noonien quit (Quit: Connection closed for inactivity) |
04:57:27 | * | Yardanico quit (Ping timeout: 240 seconds) |
05:41:58 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:17:04 | * | S1t1Schu quit (Read error: Connection reset by peer) |
06:17:20 | * | S1t1Schu joined #nim |
06:30:09 | * | Yardanico joined #nim |
06:36:22 | * | miran joined #nim |
06:44:36 | GitDisc | <Edoardo La Greca> To add nim to PATH I edited the ~/.bashrc file by adding 'export PATH="PATH:/home/edoardo/.nimble/bin" '. Is it ok? |
07:02:39 | miran | Edoardo: the best thing you can do is try to see if it is working.... |
07:03:41 | miran | don't forget `source ~/.bashrc` if you didn't do that already |
07:12:06 | * | marenz__ quit (Ping timeout: 260 seconds) |
07:12:30 | * | yglukhov joined #nim |
07:15:22 | * | nsf joined #nim |
07:16:47 | * | yglukhov quit (Ping timeout: 248 seconds) |
07:17:24 | FromGitter | <survivorm> @alehander42 Not like this, but i'd like to see this info (or link to it) on nim site. It contains many useful info, even if some of it in some way is on the nim site allready. ⏎ I meant something more like editor notes, like great things in the world You'd like to see in nim. Someday. Not NEED, only like to. That's the difference with needed-libraries, they are, by def, things people need for their "life" with nim. |
07:17:25 | FromGitter | ... Theese are not, that's more like a list of good ideas for memory and, maybe, someone interested in their realization too. I'm quite shure it need to be strongly diversed from "needed libraries", but I'd rather see it as a separate list. ⏎ Just a suggestion |
07:24:20 | * | dddddd joined #nim |
07:27:56 | * | mitescug1 quit (Ping timeout: 272 seconds) |
07:36:21 | * | Arrrr joined #nim |
07:36:21 | * | Arrrr quit (Changing host) |
07:36:21 | * | Arrrr joined #nim |
08:02:36 | * | gokr joined #nim |
08:14:51 | miran | arrays cannot be keys in the tables? |
08:24:03 | * | claudiuinberlin joined #nim |
08:24:45 | Arrrr | Yes |
08:24:50 | Arrrr | they can |
08:26:14 | FromGitter | <Varriount> (Just don't go around mutating them) |
08:27:21 | FromGitter | <survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a45fc69ba39a53f1ab359ff] |
08:27:22 | Arrrr | But not the fastest thing since it has to compute the hash everytime. |
08:27:37 | FromGitter | <survivorm> but the exutable is not installed |
08:27:50 | FromGitter | <survivorm> any idea why? |
08:33:54 | Arrrr | better call dom96 |
08:34:03 | FromGitter | <Varriount> survivorm: Do you mean not installed, or not built? |
08:34:37 | FromGitter | <survivorm> i dunno. The nimble output posted before |
08:36:00 | FromGitter | <survivorm> I don't even know there to look as i have not got the need to look into nimble-installed modules (yet) |
08:36:57 | FromGitter | <survivorm> How to determine nimble path& |
08:38:26 | FromGitter | <survivorm> oh, found it |
08:38:51 | FromGitter | <survivorm> looks like it is build, but not copied to system path |
08:39:47 | FromGitter | <survivorm> Made it by hands |
08:41:48 | FromGitter | <survivorm> great tool :) |
08:42:12 | Yardanico | It shouldn't be copied to system path |
08:42:30 | Yardanico | You should have ~/.nimble/bin in your path |
08:42:38 | FromGitter | <survivorm> hm |
08:43:07 | FromGitter | <survivorm> first time i hear it :) Is it written somethere? |
08:45:02 | Yardanico | Of course |
08:45:09 | Yardanico | https://github.com/nim-lang/nimble/blob/master/readme.markdown#installation |
08:45:32 | FromGitter | <survivorm> hm |
08:46:25 | FromGitter | <survivorm> I've installed nimble as an arch nim package part. Looks like it's not done here. My bad |
08:51:22 | miran | Arrrr: omg, i forgot () at the end of `initTable` - that was the problem not arrays as keys |
08:51:45 | miran | sometimes i'm insanely stupid |
09:03:29 | * | gmpreussner quit (Ping timeout: 248 seconds) |
09:05:23 | * | gmpreussner joined #nim |
09:08:59 | Araq | https://github.com/nim-lang/Nim/pull/6985/files#diff-8289a169b6577f02926b315643f46020R348 "semantic" syntax highlighting is dumb. |
09:09:18 | Araq | "len" is not a keyword in Nim, "or" is, this reads like shit |
09:09:45 | FromGitter | <survivorm> @dom96 jester tests are broken on nim 0.17.2 |
09:10:17 | FromGitter | <survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a460679b48e8c3566798b09] |
09:11:02 | Araq | just how hard is it to look at the manual and extract the keywords and ta-da! everything else is **not** a keyword |
09:11:57 | FromGitter | <survivorm> I think it's about responsibility, Araq |
09:12:27 | * | Yardanico quit (Ping timeout: 240 seconds) |
09:12:28 | Araq | in my VSCode I have the colors blue, pink and yellow applied randomly |
09:12:39 | FromGitter | <survivorm> Community is small -> responsibility is small -> you may make things "as is" |
09:13:00 | Araq | dirExists "dsymPath" is rendered differently than |
09:13:07 | FromGitter | <survivorm> It's often the case |
09:13:08 | Araq | dirExists("dsymPath") |
09:14:24 | Araq | syntax highlighting used to work 10 years ago. then some fool came around and made it "semantic", totally misunderstanding that most editors do not parse, they only lex |
09:14:25 | * | Yardanico joined #nim |
09:14:57 | Araq | and the highlighting never was the same and became broken everywhere. |
09:15:56 | Araq | 'case' is pink and 'of' is blue |
09:16:00 | FromGitter | <survivorm> And he himself thinks him as a genius, i bet :) |
09:16:20 | Araq | 'if' is blue and 'elif' is blue, what's the rationale? |
09:17:04 | * | yglukhov joined #nim |
09:17:10 | FromGitter | <survivorm> Coloring makes your life more funny |
09:17:23 | FromGitter | <survivorm> that's the rationale :) |
09:18:09 | FromGitter | <survivorm> Thank god they didn't add more colors to the palette :D |
09:18:17 | Araq | indeed. |
09:18:27 | * | Yardanico quit (Ping timeout: 240 seconds) |
09:18:54 | Araq | 'of' is also an operator so it renders like 'is' |
09:19:11 | Araq | hint: 'of' in a 'case' is not an operator. |
09:20:26 | Araq | newException is blue, because it's in system.nim? |
09:20:45 | Araq | should everything from system.nim be blue then? |
09:20:55 | FromGitter | <survivorm> Don't ask |
09:21:02 | Araq | is system.nim so much more special than strutils.nim? |
09:21:12 | Araq | I use both equally often |
09:59:22 | FromGitter | <Yardanico> btw, it's nim plugin fault |
09:59:23 | FromGitter | <Yardanico> https://github.com/pragmagic/vscode-nim/blob/master/syntaxes/nim.json#L171 |
09:59:37 | FromGitter | <Yardanico> well if you call that a "fault" |
10:02:41 | * | gokr quit (Ping timeout: 248 seconds) |
10:05:44 | * | Yardanico joined #nim |
10:12:59 | * | endragor_ quit (Remote host closed the connection) |
10:16:15 | * | vlad1777d joined #nim |
10:17:18 | FromGitter | <survivorm> strange bug |
10:17:39 | FromGitter | <survivorm> nimsuggest works for the first time and then just stops |
10:17:59 | Araq | "storage.type.concrete.nim" and "keyword.other.common.function.nim" indicate a taxonomy that was pulled out of somebody's ass |
10:18:36 | Araq | arbitrary nonsense and it's reflected in the coloring. |
10:19:43 | FromGitter | <survivorm> Can someone supply comand for nimsuggest (to run it by hands and debug it) and the right output for it? |
10:20:32 | * | endragor joined #nim |
10:21:43 | * | gokr joined #nim |
10:23:40 | FromGitter | <survivorm> ah, no, looks like it's a lot weirder |
10:34:17 | FromGitter | <mratsim> @survivorm nimsuggest can and will freeze, VScode sometimes spawns a dozen of nimsuggest. |
10:35:39 | Yardanico | one nimsuggest process per file AFAIK |
10:35:58 | FromGitter | <survivorm> i'm debugging it right now |
10:36:42 | FromGitter | <survivorm> file is relatively simple: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a461abaedd2230811ed4eee] |
10:36:53 | FromGitter | <nc-x> Well, nimsuggest gives wrong Go To Definition as well - https://github.com/nim-lang/nimsuggest/issues/72, and as you already experienced sometimes it just doesn't work at all. |
10:36:59 | Arrrr | Is it possible to define in scope? |
10:36:59 | FromGitter | <survivorm> `nimsuggest ~/g-engine/personnel/biography/utils.nim` |
10:37:14 | FromGitter | <survivorm> sug utils.nim:20:7 |
10:37:24 | FromGitter | <survivorm> and output is none |
10:37:58 | FromGitter | <survivorm> > use utils.nim:20:17 ⏎ ⏎ > |
10:38:38 | FromGitter | <survivorm> just what am i doing wrong? |
10:39:32 | FromGitter | <alehander42> do we have something similar to |
10:39:35 | FromGitter | <alehander42> python's casefold |
10:39:49 | FromGitter | <data-man> https://github.com/libfirm/cparser - (warning: the amd64 backend is experimental and unfinished (consider the ia32 backend)) |
10:40:09 | FromGitter | <data-man> Interesting stuff :-) |
10:41:06 | miran | can anybody tell me the difference between 0.17.2 and 0.17.3 on this example: https://gist.github.com/anonymous |
10:41:18 | miran | https://gist.github.com/anonymous/8d179d004d1219e2483a0a9f62984f7c |
10:41:26 | miran | this is input file: https://gist.githubusercontent.com/anonymous/e20c2178fc1cc1bd8a404b3d46b692d3/raw/57f7b09828921c100aa86f0d2d181d6ca0287cde/playground.nim |
10:41:36 | miran | on 0.17.2 i get the answers in 0.1 sec |
10:41:44 | miran | on 0.17.3 i see a lots of random characters and it doesn't terminate in a reasonable amount of time |
10:44:53 | FromGitter | <gogolxdong> @Araq |
10:49:05 | Yardanico | miran, as always - can you please share input file ? :) |
10:49:34 | miran | Yardanico: the link is above |
10:49:43 | Yardanico | ah sorry |
10:55:35 | Arrrr | !eval echo "Hi" |
10:55:35 | NimBot | Compile failed: <no output> |
11:02:12 | Yardanico | not agaain |
11:02:16 | FromGitter | <survivorm> Ok guys, happy holidays! It's unlikely i'll be here up to 9-th jan |
11:03:19 | * | willprice joined #nim |
11:04:26 | * | vlad1777d quit (Ping timeout: 252 seconds) |
11:05:14 | Yardanico | :P |
11:05:25 | Yardanico | will you be alive on 1th of january? :D |
11:05:32 | Yardanico | (you get me because you're russian too) |
11:11:32 | * | xkapastel quit (Quit: Connection closed for inactivity) |
11:14:00 | FromGitter | <nc-x> On windows, if you ctrl+c out of a cli app, is the app supposed to crash with an access violation (Exception code: 0xc0000005) ? |
11:14:56 | FromGitter | <nc-x> because nimsuggest is doing it for me. |
11:16:06 | FromGitter | <nc-x> (https://files.gitter.im/nim-lang/Nim/jJwN/nimsuggest.png) |
11:17:50 | Yardanico | nc-x: well it can happen |
11:17:52 | FromGitter | <nc-x> Okay, this happens if nimsuggest is compiled in debug mode. |
11:18:13 | FromGitter | <nc-x> In release mode, it doesn't crash this way. |
11:18:22 | FromGitter | <nc-x> Yardanico: Okay. |
11:19:53 | * | Vladar joined #nim |
11:26:09 | * | Trustable joined #nim |
11:29:32 | FromGitter | <nc-x> > In release mode, it doesn't crash this way. ⏎ ⏎ It does. |
12:02:10 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
12:04:07 | * | xet7 quit (Ping timeout: 265 seconds) |
12:09:55 | GitDisc | <Lite5h4dow> i cant seem to find any documentation for launching a program with opperands |
12:10:06 | GitDisc | <Lite5h4dow> from a CLI |
12:10:18 | GitDisc | <Lite5h4dow> idk if im just dumb or what |
12:12:41 | Araq | execShellCmd, runProcess, execProcess, execProcesses |
12:12:42 | GitDisc | <Lite5h4dow> so basically i want to be able to do things likt ehis with my program |
12:12:52 | GitDisc | <Lite5h4dow> ```changer -t 300``` |
12:12:57 | GitDisc | <Lite5h4dow> from a cli |
12:15:22 | GitDisc | <Lite5h4dow> changer is the name of the program im making btw |
12:15:25 | GitDisc | <Lite5h4dow> not another one |
12:15:50 | GitDisc | <Lite5h4dow> if that makes sense |
12:16:05 | FromGitter | <alehander42> you need to process command line args |
12:16:31 | * | xet7 joined #nim |
12:16:57 | FromGitter | <alehander42> you can either use https://nim-lang.org/docs/os.html#paramCount and paramStr for simple cases |
12:17:28 | FromGitter | <alehander42> or https://nim-lang.org/docs/parseopt2.html |
12:17:39 | GitDisc | <Lite5h4dow> ❤ this is why i love you guys |
12:17:50 | GitDisc | <Lite5h4dow> i have no clu wtf im doing sometimes |
12:17:51 | FromGitter | <alehander42> @Araq actually which one is recommended, why are their parseopt and parseopt2 |
12:17:58 | FromGitter | <alehander42> there* |
12:18:09 | dom96 | just use parseopt for now |
12:18:15 | dom96 | we'll remove parseopt2 eventually |
12:18:20 | FromGitter | <alehander42> ok https://nim-lang.org/docs/parseopt.html . |
12:19:11 | GitDisc | <Lite5h4dow> alrighty |
12:19:54 | GitDisc | <Lite5h4dow> any guides for the correct usage? |
12:20:01 | GitDisc | <Lite5h4dow> or is it go ham |
12:20:36 | Araq | scroll to the bottom of the docs |
12:20:44 | GitDisc | <Lite5h4dow> 10/10 |
12:20:46 | Araq | it has an example |
12:20:52 | GitDisc | <Lite5h4dow> shweet |
12:27:58 | GitDisc | <Lite5h4dow> another question (stop me if im getting annoying) |
12:28:09 | FromGitter | <alehander42> can I somehow pass any arg after varags :? |
12:28:13 | * | Snircle joined #nim |
12:28:51 | GitDisc | <Lite5h4dow> when giving a path to walk dir, can i just give it `~` as a directory? if so it doesnt seem to be working |
12:29:03 | GitDisc | <Lite5h4dow> when giving a path to walk dir, can i just give it `"~"` as a directory? if so it doesnt seem to be working |
12:30:44 | dom96 | I don't think so |
12:30:58 | dom96 | use os.expandFilename |
12:31:19 | dom96 | that might only work for filenames though |
12:31:29 | dom96 | Depends on your use case, maybe use os.getHomeDir() instead |
12:31:49 | GitDisc | <Lite5h4dow> well im trying to get access to a folder in the home dirrectory |
12:31:59 | GitDisc | <Lite5h4dow> for the user to put wallpapers in |
12:32:15 | * | iAmSlow joined #nim |
12:32:50 | dom96 | getHomeDir() / "your_folder" |
12:33:06 | GitDisc | <Lite5h4dow> sheesh, right |
12:33:16 | GitDisc | <Lite5h4dow> wait |
12:33:22 | GitDisc | <Lite5h4dow> the / isnt part of the string? |
12:33:23 | iAmSlow | hi have 2 probbaly dumb question , why let has no :string or :int |
12:33:37 | dom96 | no, it's a special operator for concatenating paths in Nim |
12:33:48 | dom96 | iAmSlow: elaborate |
12:34:16 | GitDisc | <Lite5h4dow> ok |
12:35:03 | iAmSlow | dom96, for variables you do var BlaBla : string = "gggg" |
12:35:23 | iAmSlow | why does let use just let BlaBla = "gggg" |
12:35:31 | dom96 | var let's you do that too... |
12:35:42 | iAmSlow | so its vice versa |
12:35:53 | iAmSlow | i can do let BlaBla :string = "Gggg" |
12:35:57 | iAmSlow | ? |
12:36:02 | dom96 | yes |
12:36:10 | dom96 | Try it instead of asking |
12:36:17 | iAmSlow | oh sorry than, i told it was dumb question :) |
12:36:22 | dom96 | !eval let bla: string = "asd"; echo bla |
12:36:24 | NimBot | asd |
12:36:51 | dom96 | it's not a dumb question |
12:36:59 | dom96 | It's a question that you can answer yourself though |
12:38:19 | miran | any takers on my question from 2 hours ago? |
12:38:28 | iAmSlow | hmm, so we type var someNumber: int =5 insted just var someNumber = 5 for perfomace wise or for eazy looks on eys? |
12:38:48 | miran | Yardanico: did you manage to find what was the problem with 0.17.3? |
12:39:32 | dom96 | miran: might be worth to submit a bug report for that |
12:39:46 | miran | ok, will do |
12:41:08 | iAmSlow | to alocate exact space? or i shoud go read more documents ? |
12:42:09 | iAmSlow | and question number 2 am i alowed to put ; on end of stuff, i tryed dident give me anyerror but duno if it will make conflicks down the road |
12:43:06 | iAmSlow | guessing ; is a separotor like in c# |
12:43:22 | Yardanico | you're, but it's pointless |
12:43:32 | Yardanico | except if you want to have multiple stmts on one line |
12:43:40 | Yardanico | or separate proc parameters |
12:43:44 | Yardanico | (in proc definition) |
13:06:34 | GitDisc | <Lite5h4dow> just another question, making a sequence from an operator? |
13:06:48 | GitDisc | <Lite5h4dow> iterator* |
13:08:03 | Arrrr | sequtils |
13:08:45 | GitDisc | <Lite5h4dow> ty |
13:23:07 | * | natrys joined #nim |
13:24:21 | GitDisc | <Lite5h4dow> random doesnt seem to be working unless im using it wrong |
13:24:35 | GitDisc | <Lite5h4dow> it keeps returning the same result every time i run the program |
13:24:42 | GitDisc | <Lite5h4dow> its not random at all xD |
13:26:24 | GitDisc | <Lite5h4dow> ```nim |
13:26:24 | GitDisc | <Lite5h4dow> # wallpapers is an array containing 6 file paths |
13:26:24 | GitDisc | <Lite5h4dow> random(wallpapers) #always returns 5th result |
13:26:25 | GitDisc | <Lite5h4dow> ``` |
13:27:45 | dom96 | randomize() |
13:28:26 | GitDisc | <Lite5h4dow> ``` |
13:28:26 | GitDisc | <Lite5h4dow> Error: type mismatch: got (seq[tuple[kind: PathComponent, path: string]]) |
13:28:26 | GitDisc | <Lite5h4dow> but expected one of: |
13:28:26 | GitDisc | <Lite5h4dow> proc randomize() |
13:28:26 | GitDisc | <Lite5h4dow> proc randomize(seed: int64) |
13:28:26 | GitDisc | <Lite5h4dow> ``` |
13:28:29 | GitDisc | <Lite5h4dow> error at compilatin |
13:28:38 | dom96 | no |
13:28:41 | dom96 | just randomize() |
13:28:43 | dom96 | no params |
13:28:46 | GitDisc | <Lite5h4dow> ? |
13:28:47 | livcd | what's more relaxing thank drinking a hot tea and reading Nim in Action on friday afternoon ? |
13:28:51 | GitDisc | <Lite5h4dow> there are no params |
13:29:03 | GitDisc | <Lite5h4dow> wait |
13:29:03 | dom96 | You're passing arguments to it |
13:29:07 | GitDisc | <Lite5h4dow> not replase random |
13:29:12 | GitDisc | <Lite5h4dow> not replace random |
13:29:19 | dom96 | livcd: :D |
13:29:52 | livcd | dom96: though the code on my kindle is not really that readable |
13:29:58 | livcd | if you can please talk to Manning if they can fix it |
13:30:09 | GitDisc | <Lite5h4dow> xD |
13:30:10 | dom96 | livcd: can you send me screenshots/pictures? |
13:30:14 | GitDisc | <Lite5h4dow> ty |
13:34:48 | FromGitter | <mratsim> @alehander42 you can pass arguments after varargs except for `varargs[untyped]` (I raised a feature request/bug for it) |
13:37:07 | livcd | dom96: yes |
13:37:24 | FromGitter | <mratsim> `varargs[untyped]` actually has a couple gotchas, it also matches with empty varargs meaning you can also incidentally overload the dereference operator with template `[]`(foo: Bar, args: varargs\[untyped\]) |
13:38:08 | * | user0 joined #nim |
13:39:08 | user0 | For a seq, is there any method to set the initial number of items? |
13:42:07 | user0 | nvm |
13:47:15 | GitDisc | <Lite5h4dow> having some issues |
13:47:17 | GitDisc | <Lite5h4dow> https://gist.github.com/Lite5h4dow/e60bb4528070f2ce31cb08d78372ee50 |
13:47:37 | GitDisc | <Lite5h4dow> ```Changer.nim(23, 15) Error: identifier expected, but found '"feh --bgscale "' |
13:47:37 | GitDisc | <Lite5h4dow> ``` at compile |
13:48:56 | GitDisc | <Lite5h4dow> could you tell me what the F*** im doing wrong |
13:49:26 | FromGitter | <zacharycarter> you're missing a comma |
13:49:35 | FromGitter | <zacharycarter> in execProcess |
13:50:12 | FromGitter | <zacharycarter> or an & or something |
13:51:32 | GitDisc | <Lite5h4dow> it want me to turn the path into a string |
13:51:37 | GitDisc | <Lite5h4dow> but i cant find anything in strutils |
13:51:42 | GitDisc | <Lite5h4dow> ayideas? |
13:51:47 | GitDisc | <Lite5h4dow> any ideas? |
13:59:02 | GitDisc | <Lite5h4dow> anyone? |
13:59:11 | GitDisc | <Lite5h4dow> 😢 |
13:59:34 | Araq | he already told you to use an '&' for string concatenation |
13:59:46 | GitDisc | <Lite5h4dow> yes but its not a string |
13:59:49 | GitDisc | <Lite5h4dow> its a path |
14:00:05 | GitDisc | <Lite5h4dow> i need to convert the path to a string but i dont know how |
14:00:19 | Araq | there is no "Path" type in Nim's stdlib |
14:00:41 | Araq | osproc.quoteShell() |
14:01:29 | GitDisc | <Lite5h4dow> `(kind: pcFile, path: /home/lotus/Wallpapers/lelouch_c_c___code_geass__by_greenmapple17-d7y3sfw.png)` |
14:01:35 | GitDisc | <Lite5h4dow> thats what it outputs |
14:04:34 | GitDisc | <Lite5h4dow> ```Changer.nim(23, 39) Error: type mismatch: got (tuple[kind: PathComponent, path: string]) |
14:04:34 | GitDisc | <Lite5h4dow> but expected one of: |
14:04:34 | GitDisc | <Lite5h4dow> proc quoteShell(s: string): string``` |
14:04:41 | GitDisc | <Lite5h4dow> that didnt work either |
14:04:56 | Araq | read a tutorial please. |
14:08:08 | Araq | use x.path to access the 'path' field of the tuple |
14:14:05 | GitDisc | <Lite5h4dow> right, thankyou |
14:14:20 | GitDisc | <Lite5h4dow> i didnt know what tuples were |
14:24:12 | Yardanico | that's why you need to read nim tutorials and manual |
14:28:28 | * | S1tiSchu joined #nim |
14:32:09 | * | S1t1Schu quit (Ping timeout: 264 seconds) |
14:42:44 | * | xet7 quit (Quit: Leaving) |
14:42:59 | * | xet7 joined #nim |
14:43:56 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
14:55:23 | * | miran quit (Quit: Konversation terminated!) |
15:02:18 | FromGitter | <alehander42> can I get a debug repr of expansion of a macro? |
15:03:00 | Araq | macros.expandMacros iirc |
15:03:17 | Araq | I use the convention |
15:03:30 | Araq | when defined(debugFooDsl): echo repr result |
15:03:46 | Araq | as the last macro statement and then I can compile with -d:debugFooDsl and see the expansions |
15:04:22 | FromGitter | <alehander42> yeah I do something similar |
15:04:40 | FromGitter | <alehander42> but this is a template, I don't think I can add such a repr to the end of it |
15:05:18 | Araq | macros.expandMacro(s) could work for templates too, not sure, but you can always do |
15:05:30 | Araq | dumpTree: ... |
15:07:54 | FromGitter | <alehander42> well it's maybe a diff usecase |
15:07:59 | FromGitter | <alehander42> I have eg `call(attribute(receiver, "count"), @[])` |
15:08:25 | FromGitter | <alehander42> `call` is a macro, `attribute` is a template, and I want to see my expanded `attribute` while in `call` |
15:09:12 | FromGitter | <alehander42> but I only get `attribute(receiver, "count")` again with `expandMacro` |
15:09:35 | Yardanico | Araq, should https://github.com/nim-lang/Nim/issues/6991 be closed or it's a bug? |
15:44:13 | * | noonien joined #nim |
15:46:47 | dom96 | Yay. 165th overall in Ludum Dare, not bad for a first game. https://ldjam.com/events/ludum-dare/40/coastal-postal |
15:47:58 | * | endragor quit (Remote host closed the connection) |
15:48:40 | Yardanico | dom96, nice! |
15:53:51 | * | miran joined #nim |
15:57:23 | * | endragor_ joined #nim |
16:02:06 | * | endragor_ quit (Ping timeout: 268 seconds) |
16:05:42 | * | Jesin joined #nim |
16:12:27 | GitDisc | <Lite5h4dow> right. i have one last problem. ive spent the time to look through tutorials and try and understand whats wrong. |
16:12:44 | GitDisc | <Lite5h4dow> ive looked at the documentation and ive come up with nothing |
16:12:48 | GitDisc | <Lite5h4dow> are you willing to help? |
16:15:07 | dom96 | sure |
16:15:22 | GitDisc | <Lite5h4dow> i keep getting an error on compile |
16:15:50 | GitDisc | <Lite5h4dow> ``` |
16:15:50 | GitDisc | <Lite5h4dow> Error: expression 'execProcess(quoteShell(target), [], nil, |
16:15:50 | GitDisc | <Lite5h4dow> {poStdErrToStdOut, poUsePath, poEvalCommand})' is of type 'TaintedString' and has to be discarded |
16:15:51 | GitDisc | <Lite5h4dow> ``` |
16:16:15 | GitDisc | <Lite5h4dow> now ive looked into tainted strings and they appear to be related to user validation |
16:16:43 | GitDisc | <Lite5h4dow> i dont know how this applies to execProcess and i see no method of converting a string to a tainted string manually |
16:17:45 | dom96 | Have you seen this? https://nim-lang.org/docs/manual.html#taint-mode |
16:17:55 | GitDisc | <Lite5h4dow> yes |
16:18:04 | GitDisc | <Lite5h4dow> i have attepted compilation with taintmode off |
16:18:11 | GitDisc | <Lite5h4dow> it still returns the same error |
16:18:22 | dom96 | Yes, so there are two things here. |
16:18:33 | dom96 | And taint mode is confusing things more :) |
16:18:40 | dom96 | Just think of TaintedString as "string" |
16:19:01 | GitDisc | <Lite5h4dow> ok |
16:19:16 | dom96 | The other piece of the puzzle is: https://nim-lang.org/docs/manual.html#statements-and-expressions-discard-statement |
16:19:23 | dom96 | Nim works differently than other languages here. |
16:19:41 | dom96 | It forces you to either ignore a return value explicitly with 'discard' or to use it |
16:19:53 | dom96 | That error means you're not doing either |
16:20:20 | GitDisc | <Lite5h4dow> right |
16:23:14 | GitDisc | <Lite5h4dow> so i have to use it somehow or am i still mistaken? |
16:23:29 | GitDisc | <Lite5h4dow> i have never come across this "discard" thing before |
16:23:41 | GitDisc | <Lite5h4dow> could you illustrate it with a python equivalent? |
16:23:42 | Yardanico | if procedure returns something |
16:23:45 | miran | you can `discard` it if you don't want to use it |
16:23:47 | Yardanico | and you don't need it |
16:23:52 | Yardanico | you use "discard procCall()" |
16:24:08 | GitDisc | <Lite5h4dow> right |
16:24:15 | GitDisc | <Lite5h4dow> since its trying to return a value |
16:24:32 | miran | there's no direct python equivalent |
16:24:39 | GitDisc | <Lite5h4dow> ok |
16:25:10 | miran | think of it as: `_ = uneeded_value` |
16:25:32 | GitDisc | <Lite5h4dow> right |
16:25:48 | GitDisc | <Lite5h4dow> discard runs the function and discards the result |
16:26:00 | GitDisc | <Lite5h4dow> is that right? |
16:26:10 | miran | right |
16:26:40 | GitDisc | <Lite5h4dow> ok |
16:26:44 | GitDisc | <Lite5h4dow> usefull to know |
16:26:51 | GitDisc | <Lite5h4dow> really over explained in the documentation |
16:28:02 | GitDisc | <Lite5h4dow> thankyou |
16:31:19 | * | nsf quit (Quit: WeeChat 2.0.1) |
16:31:33 | * | marenz__ joined #nim |
16:36:48 | GitDisc | <Lite5h4dow> it works |
16:36:54 | * | lastjedi joined #nim |
16:48:03 | * | Jesin quit (Ping timeout: 256 seconds) |
16:49:43 | * | xet7 quit (Quit: Leaving) |
16:51:58 | FromGitter | <alehander42> we don't have isTitle in strutils, but we have on in unicode |
16:52:13 | FromGitter | <alehander42> should we add isTitleAscii ? |
17:09:05 | FromGitter | <Varriount> @alehander42 All the "parsing for certain characters" procedures should be in the Unicode module. |
17:12:07 | * | yglukhov quit (Remote host closed the connection) |
17:14:38 | * | yglukhov joined #nim |
17:15:13 | * | Jesin joined #nim |
17:15:17 | * | yglukhov quit (Read error: Connection reset by peer) |
17:36:30 | dom96 | bah, I just spent an hour and half trying to figure out why my libclang wrapper isn't working |
17:36:41 | dom96 | and it was due to the lack of {.pure, bycopy.} on one of the types |
17:37:08 | dom96 | the only reason I was able to figure that out is because of another wrapper |
17:37:33 | * | SitiSchu joined #nim |
17:37:34 | * | S1tiSchu quit (Read error: Connection reset by peer) |
17:37:49 | Yardanico | dom96, did you use c2nim? :) |
17:37:54 | dom96 | yes |
17:38:00 | Yardanico | hmm strange |
17:38:09 | Yardanico | usually it adds bycopy by itself |
17:39:18 | * | S1tiSchu joined #nim |
17:41:53 | * | SitiSchu quit (Ping timeout: 256 seconds) |
17:48:07 | * | azur_kind joined #nim |
18:15:12 | * | claudiuinberlin joined #nim |
18:17:57 | * | S1tiSchu quit (Read error: Connection reset by peer) |
18:19:33 | * | Arrrr quit (Ping timeout: 264 seconds) |
18:21:06 | * | nsf joined #nim |
18:25:57 | * | Yardanico_ joined #nim |
18:28:15 | * | Yardanico quit (Ping timeout: 268 seconds) |
18:28:45 | * | Arrrr joined #nim |
18:28:45 | * | Arrrr quit (Changing host) |
18:28:45 | * | Arrrr joined #nim |
18:35:22 | FromGitter | <tekjar> Is there `nimfmt` like `gofmt` and `rustfmt`? |
18:38:48 | dom96 | nimpretty IIRC |
18:38:56 | dom96 | not finished yet though |
18:39:30 | * | Yardanico joined #nim |
18:42:23 | FromGitter | <tekjar> Oh alright |
18:43:05 | * | Yardanico_ quit (Ping timeout: 256 seconds) |
18:50:35 | * | xet7 joined #nim |
18:55:05 | Araq | Yardanico, only recent versions of c2nim do that |
18:56:12 | * | Yardanico_ joined #nim |
18:59:41 | * | Yardanico quit (Ping timeout: 260 seconds) |
19:09:09 | * | yglukhov joined #nim |
19:10:28 | * | Yardanico__ joined #nim |
19:14:15 | * | Yardanico_ quit (Ping timeout: 256 seconds) |
19:18:55 | * | yglukhov quit (Remote host closed the connection) |
19:20:06 | * | xet7 quit (Ping timeout: 246 seconds) |
19:26:39 | * | Yardanico_ joined #nim |
19:30:11 | * | Yardanico__ quit (Ping timeout: 240 seconds) |
19:32:29 | * | xet7 joined #nim |
19:42:59 | Yardanico_ | Araq, I thought that dom96 was using the latest one :) |
19:47:35 | * | xkapastel joined #nim |
19:48:56 | dom96 | anyone familiar with libclang here? |
19:52:44 | * | marenz__ quit (Ping timeout: 268 seconds) |
19:59:39 | * | miran quit (Quit: Konversation terminated!) |
20:10:53 | FromGitter | <RedBeard0531> I've done a bit of work with the c wrapper before. |
20:13:40 | dom96 | I'm wondering if libclang offers any way to "render" an AST node |
20:13:44 | dom96 | It doesn't seem that way :\ |
20:13:45 | FromGitter | <RedBeard0531> @dom96 were you looking for cases where cb0 recurses even with https://github.com/nim-lang/Nim/pull/6962 ? I noticed that profiles of my app are still showing that recursion. |
20:14:15 | * | amscotti joined #nim |
20:14:18 | * | amscotti quit (Remote host closed the connection) |
20:14:52 | FromGitter | <RedBeard0531> Oh, I only used the indexing parts and walked the AST as-is, so I can't help you there |
20:15:17 | * | amscotti joined #nim |
20:17:17 | dom96 | it's looking more and more likely that I will need to write my own AST rendering logic :\ |
20:17:42 | FromGitter | <RedBeard0531> Take a look at the clang-tidy source |
20:17:56 | FromGitter | <RedBeard0531> it does ast->ast based transforms and outputs source files |
20:18:12 | dom96 | ooh, thanks |
20:18:26 | amscotti | I'm trying to do something like this, all(s.runes, proc (x: Rune): bool = return x.isWhiteSpace). I have both sequtils and unicode imported but I'm getting an error of undeclared field: 'runes'. Is there a better way to do this? |
20:18:27 | FromGitter | <RedBeard0531> Ignore clang-format since it operates at the token level |
20:22:47 | * | yglukhov joined #nim |
20:23:42 | dom96 | man, this code... "ActionFactory" |
20:24:06 | FromGitter | <RedBeard0531> @dom96 I'm seeing this stack in `perf report` after applying your patch. It shows a recursive cycle between build -> buildImpl -> cb0 -> buildImplIter. The source is at https://github.com/RedBeard0531/nimja/blob/master/nimja.nim#L218-L268. |
20:24:42 | dom96 | RedBeard0531: I'm not sure what you mean |
20:25:20 | FromGitter | <RedBeard0531> Forgot a link to the perf report output https://gist.github.com/RedBeard0531/2d619edb3386c80424d4bf4d794e8310 |
20:26:01 | dom96 | Does this not happen with your patch? |
20:26:02 | FromGitter | <RedBeard0531> You had said "Unfortunately I'm honestly not sure whether completions could still be triggered recursively. But I would be willing to take the risk and if it turns out to be a problem get a nice test case for it." |
20:26:17 | FromGitter | <RedBeard0531> let me check... |
20:26:18 | dom96 | oh, I see. |
20:27:28 | dom96 | I think that even if recursive calls still happen, the number of them will decrease enough to not be a problem |
20:27:49 | dom96 | or rather, I'm hoping that's the case |
20:28:25 | FromGitter | <RedBeard0531> Is there an upper bound? Otherwise I'd assume the law of "0, 1, many" applies :) |
20:30:11 | FromGitter | <RedBeard0531> Yeah, it seems to still happen with my patch, so it is triggered by something else |
20:30:19 | FromGitter | <RedBeard0531> not sure if that is good or bad news :/ |
20:36:16 | * | Arrrr quit (Quit: Leaving.) |
20:40:28 | FromGitter | <RedBeard0531> Actually may be probably a false alarm now that I think about it build and buildImpl do a mutually recursive tree walk. Is that the type of stack trace you'd expect to see when an async function awaits itself recursively? |
20:40:50 | * | amscotti quit (Remote host closed the connection) |
20:41:46 | * | yglukhov quit (Remote host closed the connection) |
20:43:48 | * | yglukhov_ joined #nim |
20:46:54 | * | azur_kind quit (Remote host closed the connection) |
20:46:57 | * | Vladar quit (Quit: Leaving) |
20:47:59 | * | yglukhov_ quit (Ping timeout: 252 seconds) |
20:52:37 | * | yglukhov joined #nim |
20:53:32 | dom96 | yeah. If you're awaiting recursively then of course... |
20:58:09 | FromGitter | <RedBeard0531> Sorry for the false alarm. I forgot that cb0 is at the top rather than the bottom of the stack. |
20:59:39 | * | Yardanico joined #nim |
21:04:04 | FromGitter | <nitely> `var foo: seq[seq[string]] = @[@[]]` should this work? I get `Error: type mismatch: got (array[0..0, seq[empty]])` |
21:08:44 | Yardanico_ | sadly no |
21:08:56 | Yardanico_ | this one will work though: |
21:09:20 | Yardanico_ | var foo: seq[seq[string]] = @[newSeq[string]()] |
21:12:24 | Yardanico_ | well not really "sadly": |
21:12:41 | Yardanico_ | it works like it should work |
21:13:08 | Yardanico_ | and btw |
21:13:18 | Yardanico_ | you don't need to specify seq[seq[string]] here: |
21:13:26 | Yardanico_ | var foo = @[newSeq[string()]] |
21:13:42 | Yardanico_ | oops, ar foo = @[newSeq[string]()] |
21:16:36 | * | lastjedi quit (Ping timeout: 268 seconds) |
21:16:38 | * | Yardanico quit (Quit: Quit) |
21:16:46 | * | Yardanico_ is now known as Yardanico |
21:20:38 | FromGitter | <nitely> But this is valid: `var foo: seq[seq[string]] = @[]; foo.add(@[])`, also: `var foo = @[@["foo"]]` |
21:21:27 | FromGitter | <nitely> So, idk why it shouldn't work |
21:21:29 | Yardanico | yes, because afterwards compiler knows what "foo" is |
21:22:08 | FromGitter | <nitely> right. So it can't infer the inner seq's type? even if I'm telling it what type it is... |
21:22:19 | Yardanico | yes you can't :( |
21:22:36 | Yardanico | well I mean "var foo = @[@["foo"]]" will work |
21:23:37 | Yardanico | well IDK what Araq thinks about it |
21:30:23 | dom96 | hrm, to my eyes it should work |
21:30:58 | * | yglukhov quit (Read error: Connection reset by peer) |
21:31:33 | * | yglukhov joined #nim |
21:33:00 | Yardanico | dom96, why? |
21:33:42 | Yardanico | well it would be cool if it will work |
21:42:25 | FromGitter | <RedBeard0531> I think it is the same reason that `var x: array[1, uint8] = [0]` or `var x: set[range[0..10]] = {0..4}` doesn't work. The latter is particularly irksome to me for some reason. |
21:42:58 | * | Ven`` joined #nim |
21:50:36 | FromGitter | <nitely> @RedBeard0531 I don't think so. `var x: array[1, uint8] = [0'u8]` this works. Not sure about the second one |
21:52:45 | Yardanico | range is interpreted as a inner type here |
21:52:53 | Yardanico | and in array[1, uint8] you don't have inner type |
21:57:35 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:58:26 | FromGitter | <RedBeard0531> Isn't uint8 an inner type? I meant that it seems like the "reverse type inference" for literals only works a single layer deep. |
21:59:23 | * | yglukhov quit (Remote host closed the connection) |
21:59:39 | Yardanico | it's not |
21:59:55 | Yardanico | array[length, type] |
22:02:18 | FromGitter | <RedBeard0531> Maybe I'm using the term incorrectly, but it seems like type is inside array rather that being the primary type. |
22:03:45 | Yardanico | "array" is not a concrete type |
22:04:35 | FromGitter | <RedBeard0531> Neither is set |
22:07:51 | FromGitter | <nitely> I guess it's odd that you can do `var x: uint8 = 0` but not `var x: array[1, uint8] = [0]`, without knowing how the compiler really works... |
22:08:24 | FromGitter | <RedBeard0531> It would be cool if all literals in an expression were of indeterminate type (with a default) and the first non generic context back-propegated a type through generic functions to give the literals their actual type. I think |
22:09:24 | FromGitter | <RedBeard0531> I think that is how swift does it |
22:09:56 | * | SitiSchu joined #nim |
22:27:41 | * | yglukhov joined #nim |
22:29:28 | GitDisc | <NopeDK> Does Nim shared libraries require the usage of .cdecl. or can a Nim program import it and call the procs Nim style? |
22:31:00 | Araq | you can use Nim's calling convention |
22:31:21 | GitDisc | <NopeDK> Cool |
22:32:12 | Araq | RedBeard0531: that the convertible type relation can't be lifted to array literals is not a Nim specific problem really. Sure you can always introduce more rules to patch over it but meh, var x = [0u8] is good enough |
22:33:42 | Araq | type inference should work from atoms to higher structures not up and down in some arbitrary way just to save some typing |
22:41:57 | FromGitter | <tim-st> I made some minor changes in my code and when I try to compile I get: Error: internal error: (filename: ccgstmts.nim, line: 1126) ⏎ No stack traceback available |
22:42:01 | FromGitter | <tim-st> what does it mean? |
22:45:41 | FromGitter | <tim-st> Ok, could be str compared to nil have to check this |
22:46:53 | Yardanico | it's just an ICE (internal compiler error) |
22:47:36 | FromGitter | <tim-st> yes, i noticed but I want my code to compile again |
22:48:43 | Yardanico | can you share it or not? |
22:48:52 | Yardanico | and yeah, why are you comparing string to nil? |
22:48:56 | Yardanico | you should use .isNil() |
22:49:04 | Yardanico | but I think it's not the cause of this ICE |
22:49:09 | FromGitter | <tim-st> I'm using isNil in fact |
22:49:43 | FromGitter | <tim-st> I will introduce default enum type and compare to this, will check if it works |
22:51:28 | FromGitter | <tim-st> Yes, it works. IsNil() doesnt work for nil string |
22:53:15 | FromGitter | <tim-st> well, it seems to work for plain string, my string was inside a tuple |
22:54:44 | FromGitter | <tim-st> Yes, that is it: |
22:54:45 | FromGitter | <tim-st> type test = tuple[ ⏎ x: string, ⏎ y: int, ⏎ ] ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a46c7b503838b2f2a4e1e0d] |
23:01:12 | iAmSlow | are there any cons of nim? |
23:01:43 | iAmSlow | all i read say its greate, so it feels like i lie xD |
23:01:49 | iAmSlow | so any bad stuff about nim? |
23:01:56 | FromGitter | <tim-st> no good IDE |
23:01:58 | * | natrys quit (Quit: natrys) |
23:02:12 | FromGitter | <tim-st> compile times not perfect |
23:02:40 | FromGitter | <tim-st> stdlib not big compared to the big languages |
23:03:02 | iAmSlow | libs will grow ower time as IDE will develo |
23:03:15 | iAmSlow | i asking something that will not get fixed ower time |
23:03:28 | FromGitter | <tim-st> the second one maybe |
23:04:48 | FromGitter | <tim-st> Can anyone confirm that it's a bug or did I have my code wrong? |
23:08:55 | iAmSlow | is compile time like 2x C++ ? |
23:10:37 | FromGitter | <tim-st> afaik like the c compiler you're using plus a minimal additional time, others know better |
23:12:43 | Yardanico | but Nim is faster than C++ to compile :) |
23:13:00 | Yardanico | and VScode + nimsuggest already provides autocompletion |
23:13:07 | Yardanico | and about stdlib... well it's quite big i'd say |
23:13:17 | FromGitter | <tim-st> @Yardanico did you see an error in my example code? |
23:13:49 | Yardanico | proc emptyTest(): test = result |
23:13:58 | Yardanico | well that would probably work |
23:14:04 | FromGitter | <tim-st> yes |
23:14:38 | FromGitter | <tim-st> can vscode do refactoring of proc, var and files? |
23:15:02 | * | yglukhov quit (Read error: Connection reset by peer) |
23:15:04 | Yardanico | what do you mean by "refactoring" ? |
23:15:20 | Yardanico | and about your code: it compiles if I do proc emptyTest(): test = discard |
23:15:37 | * | yglukhov joined #nim |
23:15:41 | Yardanico | probably it fails because it doesn't understand what you're trying to do with "result" |
23:15:55 | FromGitter | <tim-st> thanks, that is it! |
23:16:03 | Yardanico | result is always returned |
23:16:24 | Yardanico | you don't need to return it explicitly (until you need it for your program control flow) |
23:16:42 | FromGitter | <tim-st> result was shorter than discard |
23:17:13 | FromGitter | <tim-st> I meant with refactoring basically correct renaming of variables, proc, and module filenames |
23:18:05 | Araq | nimgrep can do renames, not ideal, I know, I know |
23:18:14 | iAmSlow | yebt but stdlib will groow ower time |
23:18:45 | FromGitter | <tim-st> If there was a working IDE like jetbrains that would be a big push |
23:18:49 | Araq | compile-times will get better, I decided to try a simpler variant for --symbolfiles |
23:18:56 | Yardanico | Araq, really?! |
23:19:03 | Araq | yeah. |
23:19:28 | Yardanico | even if nim would only partially cache compilation results - it would still be very huge |
23:19:34 | Yardanico | and you'll be able to recompile nim faster :P |
23:19:57 | Araq | my current plan is: cache the compilation results of a full module in an SQLite db :P |
23:20:20 | Yardanico | Araq, you mean C code or some special format? |
23:20:30 | Araq | the AST after sem'checking |
23:20:31 | FromGitter | <tim-st> Would (just in theory) a nim interpreter allow very fast interpretation (just for testing)? |
23:20:40 | Yardanico | "nim secret" |
23:20:47 | Yardanico | it uses VM |
23:20:49 | Araq | tim-st: fixed your bug already |
23:20:54 | Yardanico | ~same speed as python |
23:21:01 | FromGitter | <tim-st> @Araq Nice thanks! |
23:21:21 | Yardanico | but yeah, it seems that people really want to have REPL |
23:21:35 | FromGitter | <tim-st> I'm not about speed. It's only for testing. I don't like waiting for my testing results 10 very long |
23:21:51 | Yardanico | ah, you mean |
23:21:58 | Yardanico | interpretation speed vs compile+run speed? |
23:22:16 | Araq | compile times are linear wrt the input program (roughly) |
23:22:29 | Araq | so the problem only affects people who have big Nim programs |
23:22:47 | Araq | but it's becoming painful so we need to do something about it |
23:23:00 | Araq | note that the C backend is parallel and cached etc etc |
23:23:12 | Araq | so now the frontend is our enemy :P |
23:23:51 | Yardanico | Araq, thanks for using "wrt"! I've learned quite a lot of shorthands while being in this chat :) |
23:24:06 | Araq | lol |
23:24:21 | * | nsf quit (Quit: WeeChat 2.0.1) |
23:26:04 | FromGitter | <RedBeard0531> I assume it will never be possible to do distributed compilation of the nim phase using something like distcc or icecream (it should be easy to use them for the c/c++ phase though). That will only be a problem when you have *really big* projects... |
23:26:18 | dom96 | NimBot needs an !urbandictionary command :P |
23:27:05 | Yardanico | RedBeard0531: because nim doesn't have a separate linker step |
23:27:11 | Yardanico | I mean nim code itself :) |
23:28:20 | Araq | RedBeard0531: never say never but it seems hard. you can always split up your program into static/dynamic libraries though |
23:29:21 | FromGitter | <RedBeard0531> no, because it doesn't have real separate compilation. I think it always semchecks all included/imported .nim files and codegens all .c/.cpp files. It is only the compilation of the c/c++ files that can be compiled separately. (@Araq correct me if I'm wrong) |
23:30:04 | FromGitter | <RedBeard0531> Yeah, separate libs could work but is a pain in the ass |
23:30:24 | FromGitter | <RedBeard0531> I assume there's a reason you didn't break the compiler up into separate libs :) |
23:30:56 | Araq | hmmm |
23:31:17 | Araq | well the reason is that it never occured to me before |
23:31:24 | iAmSlow | does compiler use multythread? |
23:31:31 | Araq | nah |
23:31:33 | Yardanico | iAmSlow, C compiler does |
23:31:33 | iAmSlow | guessing it does |
23:31:48 | iAmSlow | what so nim single thread compiling only? |
23:32:07 | Araq | like many others, yes |
23:32:09 | Yardanico | iAmSlow, Nim to C compilation - single-threaded; C to machine code - multi-threaded |
23:32:09 | FromGitter | <RedBeard0531> I doubt any nim progs are within two orders of magnitude of needing to distribute the nim phase of compilation. It may be more of an issue with the llvm backend though. |
23:32:21 | iAmSlow | make it multy and buy threadriper :) = fast time |
23:32:28 | Yardanico | :D |
23:32:35 | Yardanico | only if it was that easy to do things... :( |
23:33:17 | iAmSlow | yep but thats the future |
23:33:47 | * | Jesin quit (Quit: Leaving) |
23:33:59 | iAmSlow | i would help if i know how , atm am strugling whit basic nim stuff xD |
23:34:20 | Yardanico | i really doubt it's possible to make nim compiler multi-threaded while keeping all language features |
23:34:26 | Yardanico | (current language features) |
23:34:29 | Yardanico | but I may be wrong |
23:34:47 | iAmSlow | you need really multythread compile or that chache so it build on old if thats possible at all |
23:35:00 | FromGitter | <tim-st> @Araq Do you have any plans/ideas about an ide? should it be via language server? |
23:35:09 | Yardanico | iAmSlow, nim has cache |
23:35:12 | Yardanico | C files are caches |
23:35:14 | Yardanico | *cached |
23:35:25 | FromGitter | <tim-st> *language server protocol |
23:35:32 | iAmSlow | but like i say i am newbie so am just shooting out of head suggestion |
23:35:37 | Araq | you can parallelise module-wise but the module graphs are usually too messy so don't expend big speedups |
23:35:56 | Araq | *expect |
23:36:06 | iAmSlow | anyway so no other cons expect slow compile time |
23:36:13 | Araq | you can also run the compiler phases in parallel |
23:36:34 | iAmSlow | tought duno how it comperese to other languges |
23:36:45 | Araq | but that pipelining approach to parallelism is flawed imho |
23:36:50 | Yardanico | iAmSlow, did you compare nim vs c++ ? :) |
23:36:53 | Yardanico | compilation times |
23:36:56 | iAmSlow | no |
23:37:07 | iAmSlow | hate me again :) |
23:37:16 | iAmSlow | i like spoons :) |
23:37:17 | Yardanico | it may be slow for you if you're used to python |
23:37:23 | Yardanico | which doesn't have compilation at all |
23:37:26 | iAmSlow | nah i am used to c# |
23:37:29 | Yardanico | ah, sorry |
23:37:40 | iAmSlow | i bulded godot from source it took some time |
23:37:47 | iAmSlow | like 30mins |
23:37:51 | Yardanico | it's a big project though |
23:37:56 | FromGitter | <tim-st> @Yardanico yes, and because of this my idea to use the same interpreting for nim for debug |
23:37:58 | iAmSlow | but thats full gameengine |
23:38:02 | Araq | as I said, compile times are ok, especially for beginners ;-) |
23:38:21 | Yardanico | and btw, if you want to improve compile times a bit - you can try clang |
23:38:41 | FromGitter | <tim-st> how much by percentage? |
23:38:56 | Yardanico | well, I measured it! |
23:39:03 | iAmSlow | so no cons about nim exept Time |
23:39:15 | Yardanico | on my android device (snapdragon 625) I have a chroot'ed arch linux |
23:39:15 | FromGitter | <tim-st> IDE as I said is a big con |
23:39:15 | Yardanico | so |
23:39:17 | iAmSlow | Time = compile time + libs community grow |
23:39:32 | iAmSlow | IDE = Time too |
23:39:35 | FromGitter | <tim-st> I used to program with Pycharm which had all the good features |
23:39:36 | Yardanico | nim bootstrapping (from C cources) with gcc - 4mins30secs |
23:39:53 | Yardanico | nim bootstrapping from C c ources with clang - 2mins 30 secs |
23:40:01 | Yardanico | of course you'll also have nim compilation step |
23:40:06 | Yardanico | but C compilation step will be faster |
23:40:17 | FromGitter | <tim-st> @Yardanico that's good to know, thanks! |
23:40:59 | Yardanico | hmm, I'll probably try nim bootstrapping including nim compilation now (on my pc) |
23:41:31 | Araq | sure, add the 5s of the Nim step to that |
23:41:40 | iAmSlow | and about IDE i am using VScode whit nimplugin it has autocomplite and discripions, duno what you need more |
23:42:00 | Yardanico | iAmSlow, did you use all visual studio features? |
23:42:07 | Yardanico | well I mean there's a lot of them |
23:42:15 | Araq | somebody should take over my NimEdit ... :P |
23:42:31 | FromGitter | <tim-st> Can VsCode autocomplete from system.nim ? |
23:42:37 | Yardanico | tim-st: yes |
23:42:50 | FromGitter | <tim-st> ok, will install it now^^ |
23:43:04 | Araq | it uses 'nimsuggest' which is the Nim compiler as a "language server" |
23:43:45 | FromGitter | <tim-st> Yes, but sublime uses nimsuggest, too. The big features are not working in sublime |
23:43:52 | user0 | Looks like the gintro package does not work in my system |
23:43:59 | Yardanico | tim-st: what features? |
23:44:05 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
23:44:05 | Yardanico | goto definition? |
23:44:05 | user0 | *sigh* |
23:44:24 | FromGitter | <tim-st> code completion, refactoring of var, proc, filenames, goto source code |
23:44:28 | FromGitter | <tim-st> just to name a few |
23:44:34 | Yardanico | code completion, goto source will work |
23:44:51 | Yardanico | refactoring - well, vscode can handle that itself |
23:45:03 | Yardanico | but of course it's not very smart |
23:45:12 | FromGitter | <tim-st> In Sublime afaik only in local files and *very* basic |
23:45:28 | FromGitter | <tim-st> ok, will try it now |
23:46:44 | Yardanico | lol, clang on windows doesn't work without MSVC |
23:46:51 | Yardanico | because it doesn't have "string.h" header |
23:46:58 | FromGitter | <tim-st> @Yardanico does code formatting work in VsCode? this is a very good feature in jetbrains |
23:47:13 | Yardanico | sadly it's a bit broken for nim in last vscode releases |
23:47:43 | FromGitter | <tim-st> because this features highly depends on the grammar, I assumed it... |
23:47:53 | Yardanico | it was working good before :P |
23:48:04 | FromGitter | <tim-st> ok |
23:49:54 | FromGitter | <tim-st> Well, VsCode in fact seems to work better than sublime, that's very nice^^ |
23:50:01 | FromGitter | <tim-st> Thanks! |
23:54:52 | * | Faster-Fanboi joined #nim |
23:55:04 | Yardanico | what is this |
23:55:05 | Yardanico | https://stackoverflow.com/a/47148323 |
23:55:18 | Yardanico | clang doesn't provide headers itself when installed |
23:56:33 | FromGitter | <tim-st> I also have vs studio c compiler, is it quicker than gcc in compilation? |
23:56:55 | Yardanico | I don't know |
23:57:02 | Yardanico | maybe even slower than gcc 7.2 :D |
23:59:17 | FromGitter | <RedBeard0531> It's also like 100x slower at linking |
23:59:34 | FromGitter | <tim-st> oh, ok^^ |