<< 29-12-2017 >>

00:28:09*xet7 quit (Quit: Leaving)
00:28:47*xet7 joined #nim
00:37:05FromGitter<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:01dom96template a: expr = some_long_expr
00:38:23FromGitter<RedBeard0531> `let myRef = addr some_long_expr` is pretty close although as the manual notes, that can be unsafe
00:38:56FromGitter<RedBeard0531> @dom96: doesn't that re-evaluate the expr every time a is used?
00:39:49dom96yeah, it will
00:40:20dom96You 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:32FromGitter<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:59FromGitter<RedBeard0531> err pretend I put `addr` before `table`
00:42:18*Yardanico joined #nim
00:43:09FromGitter<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:14dom96`addr` is unsafe
00:45:31dom96so I would be wary about using it
00:46:08dom96I would just use a template for that case I think
00:46:27dom96but yeah, it would lookup the key each time which isn't ideal
00:47:17FromGitter<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:51dom96I just treat every use of 'addr', 'ptr', 'unsafe*' as unsafe no matter in what situation it's used.
00:49:06dom96It's sort of like an unsafe subset of Nim
00:54:34FromGitter<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:39dom96Well, just like with Rust's unsafe blocks you should minimise it to where it's necessary
00:55:48dom96and try to wrap that code in safe abstractions
00:59:08dom96but that's just how I view things
00:59:13dom96Araq might have a different opinion
01:04:56*willprice quit (Ping timeout: 252 seconds)
01:08:50FromGitter<luka-mikec> @dom96, @RedBeard0531, thank you!
01:11:01*dddddd quit (Remote host closed the connection)
01:11:11YardanicoClang (5.0.1) vs GCC (7.2.1) - time to bootstrap nim from csources: ~2min30sec vs ~4min30sec
01:11:26YardanicoOn aarch64 (arm8)
01:12:52*gokr quit (Ping timeout: 268 seconds)
01:18:13*Kingsquee joined #nim
01:27:41GitDisc<Lite5h4dow> im wondering how would i go about running other programs with operators from nim in linux
01:28:05GitDisc<Lite5h4dow> i want to make a wallpaper randomiser in nim
01:28:17GitDisc<Lite5h4dow> i know its overkill but i want to give it a try
01:29:46YardanicoWhat do you mean "running other programs with operators"?
01:30:27YardanicoMaybe you just need osproc module?
01:31:08GitDisc<Lite5h4dow> hold on let me give you an example
01:31:56GitDisc<Lite5h4dow> `feh --bg-scale /path/to/random/image`
01:32:04GitDisc<Lite5h4dow> i want to run that command from nim
01:32:21GitDisc<Lite5h4dow> selecting a random image with nim
01:32:32GitDisc<Lite5h4dow> and have it change every half an hour or so
01:32:53YardanicoYeah
01:32:59YardanicoJust use osproc module
01:33:23GitDisc<Lite5h4dow> sweet
01:33:24YardanicoIt allows you to run other processes
01:33:38Yardanicohttps://nim-lang.org/docs/osproc.html
01:33:41GitDisc<Lite5h4dow> ❤
01:33:43GitDisc<Lite5h4dow> love you
01:34:37*endragor joined #nim
01:36:15*endragor_ joined #nim
01:37:00GitDisc<Lite5h4dow> one more thing
01:37:14GitDisc<Lite5h4dow> looking for files in a folder
01:37:24GitDisc<Lite5h4dow> any idea how i would go about that?
01:37:35*MJCaley joined #nim
01:37:43GitDisc<Lite5h4dow> like jpgs, pngs to ad to a sequence later
01:37:52GitDisc<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:10GitDisc<Lite5h4dow> nvm
01:57:23GitDisc<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:47fvstrying to set {.callconv: cdecl.} pragma before procs in header fails: invalid pragma - any ideas?
03:08:12fvsas 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:19FromGitter<zacharycarter> in header?
03:41:33FromGitter<zacharycarter> you're supposed to use pragmas in nim files
03:41:52FromGitter<zacharycarter> fvs ^
03:42:27fvsyes in nim header. solved using {.push callconv: cdel} ... {.pop.}
03:43:14fvs*cdecl
03:43:59fvstrying to wrap dislin and too lazy to add this to each proc - there are hundreds :)
03:46:22FromGitter<zacharycarter> nim doesn't have headers but whatev :)
04:08:20fvscrap, 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:36GitDisc<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:39miranEdoardo: the best thing you can do is try to see if it is working....
07:03:41mirandon'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:24FromGitter<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:25FromGitter... 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:51miranarrays cannot be keys in the tables?
08:24:03*claudiuinberlin joined #nim
08:24:45ArrrrYes
08:24:50Arrrrthey can
08:26:14FromGitter<Varriount> (Just don't go around mutating them)
08:27:21FromGitter<survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a45fc69ba39a53f1ab359ff]
08:27:22ArrrrBut not the fastest thing since it has to compute the hash everytime.
08:27:37FromGitter<survivorm> but the exutable is not installed
08:27:50FromGitter<survivorm> any idea why?
08:33:54Arrrrbetter call dom96
08:34:03FromGitter<Varriount> survivorm: Do you mean not installed, or not built?
08:34:37FromGitter<survivorm> i dunno. The nimble output posted before
08:36:00FromGitter<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:57FromGitter<survivorm> How to determine nimble path&
08:38:26FromGitter<survivorm> oh, found it
08:38:51FromGitter<survivorm> looks like it is build, but not copied to system path
08:39:47FromGitter<survivorm> Made it by hands
08:41:48FromGitter<survivorm> great tool :)
08:42:12YardanicoIt shouldn't be copied to system path
08:42:30YardanicoYou should have ~/.nimble/bin in your path
08:42:38FromGitter<survivorm> hm
08:43:07FromGitter<survivorm> first time i hear it :) Is it written somethere?
08:45:02YardanicoOf course
08:45:09Yardanicohttps://github.com/nim-lang/nimble/blob/master/readme.markdown#installation
08:45:32FromGitter<survivorm> hm
08:46:25FromGitter<survivorm> I've installed nimble as an arch nim package part. Looks like it's not done here. My bad
08:51:22miranArrrr: omg, i forgot () at the end of `initTable` - that was the problem not arrays as keys
08:51:45miransometimes i'm insanely stupid
09:03:29*gmpreussner quit (Ping timeout: 248 seconds)
09:05:23*gmpreussner joined #nim
09:08:59Araqhttps://github.com/nim-lang/Nim/pull/6985/files#diff-8289a169b6577f02926b315643f46020R348 "semantic" syntax highlighting is dumb.
09:09:18Araq"len" is not a keyword in Nim, "or" is, this reads like shit
09:09:45FromGitter<survivorm> @dom96 jester tests are broken on nim 0.17.2
09:10:17FromGitter<survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a460679b48e8c3566798b09]
09:11:02Araqjust how hard is it to look at the manual and extract the keywords and ta-da! everything else is **not** a keyword
09:11:57FromGitter<survivorm> I think it's about responsibility, Araq
09:12:27*Yardanico quit (Ping timeout: 240 seconds)
09:12:28Araqin my VSCode I have the colors blue, pink and yellow applied randomly
09:12:39FromGitter<survivorm> Community is small -> responsibility is small -> you may make things "as is"
09:13:00Araq dirExists "dsymPath" is rendered differently than
09:13:07FromGitter<survivorm> It's often the case
09:13:08Araq dirExists("dsymPath")
09:14:24Araqsyntax 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:57Araqand the highlighting never was the same and became broken everywhere.
09:15:56Araq'case' is pink and 'of' is blue
09:16:00FromGitter<survivorm> And he himself thinks him as a genius, i bet :)
09:16:20Araq'if' is blue and 'elif' is blue, what's the rationale?
09:17:04*yglukhov joined #nim
09:17:10FromGitter<survivorm> Coloring makes your life more funny
09:17:23FromGitter<survivorm> that's the rationale :)
09:18:09FromGitter<survivorm> Thank god they didn't add more colors to the palette :D
09:18:17Araqindeed.
09:18:27*Yardanico quit (Ping timeout: 240 seconds)
09:18:54Araq'of' is also an operator so it renders like 'is'
09:19:11Araqhint: 'of' in a 'case' is not an operator.
09:20:26AraqnewException is blue, because it's in system.nim?
09:20:45Araqshould everything from system.nim be blue then?
09:20:55FromGitter<survivorm> Don't ask
09:21:02Araqis system.nim so much more special than strutils.nim?
09:21:12AraqI use both equally often
09:59:22FromGitter<Yardanico> btw, it's nim plugin fault
09:59:23FromGitter<Yardanico> https://github.com/pragmagic/vscode-nim/blob/master/syntaxes/nim.json#L171
09:59:37FromGitter<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:18FromGitter<survivorm> strange bug
10:17:39FromGitter<survivorm> nimsuggest works for the first time and then just stops
10:17:59Araq"storage.type.concrete.nim" and "keyword.other.common.function.nim" indicate a taxonomy that was pulled out of somebody's ass
10:18:36Araqarbitrary nonsense and it's reflected in the coloring.
10:19:43FromGitter<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:40FromGitter<survivorm> ah, no, looks like it's a lot weirder
10:34:17FromGitter<mratsim> @survivorm nimsuggest can and will freeze, VScode sometimes spawns a dozen of nimsuggest.
10:35:39Yardanicoone nimsuggest process per file AFAIK
10:35:58FromGitter<survivorm> i'm debugging it right now
10:36:42FromGitter<survivorm> file is relatively simple: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a461abaedd2230811ed4eee]
10:36:53FromGitter<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:59ArrrrIs it possible to define in scope?
10:36:59FromGitter<survivorm> `nimsuggest ~/g-engine/personnel/biography/utils.nim`
10:37:14FromGitter<survivorm> sug utils.nim:20:7
10:37:24FromGitter<survivorm> and output is none
10:37:58FromGitter<survivorm> > use utils.nim:20:17 ⏎ ⏎ >
10:38:38FromGitter<survivorm> just what am i doing wrong?
10:39:32FromGitter<alehander42> do we have something similar to
10:39:35FromGitter<alehander42> python's casefold
10:39:49FromGitter<data-man> https://github.com/libfirm/cparser - (warning: the amd64 backend is experimental and unfinished (consider the ia32 backend))
10:40:09FromGitter<data-man> Interesting stuff :-)
10:41:06mirancan anybody tell me the difference between 0.17.2 and 0.17.3 on this example: https://gist.github.com/anonymous
10:41:18miranhttps://gist.github.com/anonymous/8d179d004d1219e2483a0a9f62984f7c
10:41:26miranthis is input file: https://gist.githubusercontent.com/anonymous/e20c2178fc1cc1bd8a404b3d46b692d3/raw/57f7b09828921c100aa86f0d2d181d6ca0287cde/playground.nim
10:41:36miranon 0.17.2 i get the answers in 0.1 sec
10:41:44miranon 0.17.3 i see a lots of random characters and it doesn't terminate in a reasonable amount of time
10:44:53FromGitter<gogolxdong> @Araq
10:49:05Yardanicomiran, as always - can you please share input file ? :)
10:49:34miranYardanico: the link is above
10:49:43Yardanicoah sorry
10:55:35Arrrr!eval echo "Hi"
10:55:35NimBotCompile failed: <no output>
11:02:12Yardaniconot agaain
11:02:16FromGitter<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:14Yardanico:P
11:05:25Yardanicowill you be alive on 1th of january? :D
11:05:32Yardanico(you get me because you're russian too)
11:11:32*xkapastel quit (Quit: Connection closed for inactivity)
11:14:00FromGitter<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:56FromGitter<nc-x> because nimsuggest is doing it for me.
11:16:06FromGitter<nc-x> (https://files.gitter.im/nim-lang/Nim/jJwN/nimsuggest.png)
11:17:50Yardaniconc-x: well it can happen
11:17:52FromGitter<nc-x> Okay, this happens if nimsuggest is compiled in debug mode.
11:18:13FromGitter<nc-x> In release mode, it doesn't crash this way.
11:18:22FromGitter<nc-x> Yardanico: Okay.
11:19:53*Vladar joined #nim
11:26:09*Trustable joined #nim
11:29:32FromGitter<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:55GitDisc<Lite5h4dow> i cant seem to find any documentation for launching a program with opperands
12:10:06GitDisc<Lite5h4dow> from a CLI
12:10:18GitDisc<Lite5h4dow> idk if im just dumb or what
12:12:41AraqexecShellCmd, runProcess, execProcess, execProcesses
12:12:42GitDisc<Lite5h4dow> so basically i want to be able to do things likt ehis with my program
12:12:52GitDisc<Lite5h4dow> ```changer -t 300```
12:12:57GitDisc<Lite5h4dow> from a cli
12:15:22GitDisc<Lite5h4dow> changer is the name of the program im making btw
12:15:25GitDisc<Lite5h4dow> not another one
12:15:50GitDisc<Lite5h4dow> if that makes sense
12:16:05FromGitter<alehander42> you need to process command line args
12:16:31*xet7 joined #nim
12:16:57FromGitter<alehander42> you can either use https://nim-lang.org/docs/os.html#paramCount and paramStr for simple cases
12:17:28FromGitter<alehander42> or https://nim-lang.org/docs/parseopt2.html
12:17:39GitDisc<Lite5h4dow> ❤ this is why i love you guys
12:17:50GitDisc<Lite5h4dow> i have no clu wtf im doing sometimes
12:17:51FromGitter<alehander42> @Araq actually which one is recommended, why are their parseopt and parseopt2
12:17:58FromGitter<alehander42> there*
12:18:09dom96just use parseopt for now
12:18:15dom96we'll remove parseopt2 eventually
12:18:20FromGitter<alehander42> ok https://nim-lang.org/docs/parseopt.html .
12:19:11GitDisc<Lite5h4dow> alrighty
12:19:54GitDisc<Lite5h4dow> any guides for the correct usage?
12:20:01GitDisc<Lite5h4dow> or is it go ham
12:20:36Araqscroll to the bottom of the docs
12:20:44GitDisc<Lite5h4dow> 10/10
12:20:46Araqit has an example
12:20:52GitDisc<Lite5h4dow> shweet
12:27:58GitDisc<Lite5h4dow> another question (stop me if im getting annoying)
12:28:09FromGitter<alehander42> can I somehow pass any arg after varags :?
12:28:13*Snircle joined #nim
12:28:51GitDisc<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:03GitDisc<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:44dom96I don't think so
12:30:58dom96use os.expandFilename
12:31:19dom96that might only work for filenames though
12:31:29dom96Depends on your use case, maybe use os.getHomeDir() instead
12:31:49GitDisc<Lite5h4dow> well im trying to get access to a folder in the home dirrectory
12:31:59GitDisc<Lite5h4dow> for the user to put wallpapers in
12:32:15*iAmSlow joined #nim
12:32:50dom96getHomeDir() / "your_folder"
12:33:06GitDisc<Lite5h4dow> sheesh, right
12:33:16GitDisc<Lite5h4dow> wait
12:33:22GitDisc<Lite5h4dow> the / isnt part of the string?
12:33:23iAmSlowhi have 2 probbaly dumb question , why let has no :string or :int
12:33:37dom96no, it's a special operator for concatenating paths in Nim
12:33:48dom96iAmSlow: elaborate
12:34:16GitDisc<Lite5h4dow> ok
12:35:03iAmSlowdom96, for variables you do var BlaBla : string = "gggg"
12:35:23iAmSlowwhy does let use just let BlaBla = "gggg"
12:35:31dom96var let's you do that too...
12:35:42iAmSlowso its vice versa
12:35:53iAmSlowi can do let BlaBla :string = "Gggg"
12:35:57iAmSlow?
12:36:02dom96yes
12:36:10dom96Try it instead of asking
12:36:17iAmSlowoh sorry than, i told it was dumb question :)
12:36:22dom96!eval let bla: string = "asd"; echo bla
12:36:24NimBotasd
12:36:51dom96it's not a dumb question
12:36:59dom96It's a question that you can answer yourself though
12:38:19miranany takers on my question from 2 hours ago?
12:38:28iAmSlowhmm, so we type var someNumber: int =5 insted just var someNumber = 5 for perfomace wise or for eazy looks on eys?
12:38:48miranYardanico: did you manage to find what was the problem with 0.17.3?
12:39:32dom96miran: might be worth to submit a bug report for that
12:39:46miranok, will do
12:41:08iAmSlowto alocate exact space? or i shoud go read more documents ?
12:42:09iAmSlowand 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:06iAmSlowguessing ; is a separotor like in c#
12:43:22Yardanicoyou're, but it's pointless
12:43:32Yardanicoexcept if you want to have multiple stmts on one line
12:43:40Yardanicoor separate proc parameters
12:43:44Yardanico(in proc definition)
13:06:34GitDisc<Lite5h4dow> just another question, making a sequence from an operator?
13:06:48GitDisc<Lite5h4dow> iterator*
13:08:03Arrrrsequtils
13:08:45GitDisc<Lite5h4dow> ty
13:23:07*natrys joined #nim
13:24:21GitDisc<Lite5h4dow> random doesnt seem to be working unless im using it wrong
13:24:35GitDisc<Lite5h4dow> it keeps returning the same result every time i run the program
13:24:42GitDisc<Lite5h4dow> its not random at all xD
13:26:24GitDisc<Lite5h4dow> ```nim
13:26:24GitDisc<Lite5h4dow> # wallpapers is an array containing 6 file paths
13:26:24GitDisc<Lite5h4dow> random(wallpapers) #always returns 5th result
13:26:25GitDisc<Lite5h4dow> ```
13:27:45dom96randomize()
13:28:26GitDisc<Lite5h4dow> ```
13:28:26GitDisc<Lite5h4dow> Error: type mismatch: got (seq[tuple[kind: PathComponent, path: string]])
13:28:26GitDisc<Lite5h4dow> but expected one of:
13:28:26GitDisc<Lite5h4dow> proc randomize()
13:28:26GitDisc<Lite5h4dow> proc randomize(seed: int64)
13:28:26GitDisc<Lite5h4dow> ```
13:28:29GitDisc<Lite5h4dow> error at compilatin
13:28:38dom96no
13:28:41dom96just randomize()
13:28:43dom96no params
13:28:46GitDisc<Lite5h4dow> ?
13:28:47livcdwhat's more relaxing thank drinking a hot tea and reading Nim in Action on friday afternoon ?
13:28:51GitDisc<Lite5h4dow> there are no params
13:29:03GitDisc<Lite5h4dow> wait
13:29:03dom96You're passing arguments to it
13:29:07GitDisc<Lite5h4dow> not replase random
13:29:12GitDisc<Lite5h4dow> not replace random
13:29:19dom96livcd: :D
13:29:52livcddom96: though the code on my kindle is not really that readable
13:29:58livcdif you can please talk to Manning if they can fix it
13:30:09GitDisc<Lite5h4dow> xD
13:30:10dom96livcd: can you send me screenshots/pictures?
13:30:14GitDisc<Lite5h4dow> ty
13:34:48FromGitter<mratsim> @alehander42 you can pass arguments after varargs except for `varargs[untyped]` (I raised a feature request/bug for it)
13:37:07livcddom96: yes
13:37:24FromGitter<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:08user0For a seq, is there any method to set the initial number of items?
13:42:07user0nvm
13:47:15GitDisc<Lite5h4dow> having some issues
13:47:17GitDisc<Lite5h4dow> https://gist.github.com/Lite5h4dow/e60bb4528070f2ce31cb08d78372ee50
13:47:37GitDisc<Lite5h4dow> ```Changer.nim(23, 15) Error: identifier expected, but found '"feh --bgscale "'
13:47:37GitDisc<Lite5h4dow> ``` at compile
13:48:56GitDisc<Lite5h4dow> could you tell me what the F*** im doing wrong
13:49:26FromGitter<zacharycarter> you're missing a comma
13:49:35FromGitter<zacharycarter> in execProcess
13:50:12FromGitter<zacharycarter> or an & or something
13:51:32GitDisc<Lite5h4dow> it want me to turn the path into a string
13:51:37GitDisc<Lite5h4dow> but i cant find anything in strutils
13:51:42GitDisc<Lite5h4dow> ayideas?
13:51:47GitDisc<Lite5h4dow> any ideas?
13:59:02GitDisc<Lite5h4dow> anyone?
13:59:11GitDisc<Lite5h4dow> 😢
13:59:34Araqhe already told you to use an '&' for string concatenation
13:59:46GitDisc<Lite5h4dow> yes but its not a string
13:59:49GitDisc<Lite5h4dow> its a path
14:00:05GitDisc<Lite5h4dow> i need to convert the path to a string but i dont know how
14:00:19Araqthere is no "Path" type in Nim's stdlib
14:00:41Araqosproc.quoteShell()
14:01:29GitDisc<Lite5h4dow> `(kind: pcFile, path: /home/lotus/Wallpapers/lelouch_c_c___code_geass__by_greenmapple17-d7y3sfw.png)`
14:01:35GitDisc<Lite5h4dow> thats what it outputs
14:04:34GitDisc<Lite5h4dow> ```Changer.nim(23, 39) Error: type mismatch: got (tuple[kind: PathComponent, path: string])
14:04:34GitDisc<Lite5h4dow> but expected one of:
14:04:34GitDisc<Lite5h4dow> proc quoteShell(s: string): string```
14:04:41GitDisc<Lite5h4dow> that didnt work either
14:04:56Araqread a tutorial please.
14:08:08Araquse x.path to access the 'path' field of the tuple
14:14:05GitDisc<Lite5h4dow> right, thankyou
14:14:20GitDisc<Lite5h4dow> i didnt know what tuples were
14:24:12Yardanicothat'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:18FromGitter<alehander42> can I get a debug repr of expansion of a macro?
15:03:00Araqmacros.expandMacros iirc
15:03:17AraqI use the convention
15:03:30Araqwhen defined(debugFooDsl): echo repr result
15:03:46Araqas the last macro statement and then I can compile with -d:debugFooDsl and see the expansions
15:04:22FromGitter<alehander42> yeah I do something similar
15:04:40FromGitter<alehander42> but this is a template, I don't think I can add such a repr to the end of it
15:05:18Araqmacros.expandMacro(s) could work for templates too, not sure, but you can always do
15:05:30AraqdumpTree: ...
15:07:54FromGitter<alehander42> well it's maybe a diff usecase
15:07:59FromGitter<alehander42> I have eg `call(attribute(receiver, "count"), @[])`
15:08:25FromGitter<alehander42> `call` is a macro, `attribute` is a template, and I want to see my expanded `attribute` while in `call`
15:09:12FromGitter<alehander42> but I only get `attribute(receiver, "count")` again with `expandMacro`
15:09:35YardanicoAraq, should https://github.com/nim-lang/Nim/issues/6991 be closed or it's a bug?
15:44:13*noonien joined #nim
15:46:47dom96Yay. 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:40Yardanicodom96, 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:27GitDisc<Lite5h4dow> right. i have one last problem. ive spent the time to look through tutorials and try and understand whats wrong.
16:12:44GitDisc<Lite5h4dow> ive looked at the documentation and ive come up with nothing
16:12:48GitDisc<Lite5h4dow> are you willing to help?
16:15:07dom96sure
16:15:22GitDisc<Lite5h4dow> i keep getting an error on compile
16:15:50GitDisc<Lite5h4dow> ```
16:15:50GitDisc<Lite5h4dow> Error: expression 'execProcess(quoteShell(target), [], nil,
16:15:50GitDisc<Lite5h4dow> {poStdErrToStdOut, poUsePath, poEvalCommand})' is of type 'TaintedString' and has to be discarded
16:15:51GitDisc<Lite5h4dow> ```
16:16:15GitDisc<Lite5h4dow> now ive looked into tainted strings and they appear to be related to user validation
16:16:43GitDisc<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:45dom96Have you seen this? https://nim-lang.org/docs/manual.html#taint-mode
16:17:55GitDisc<Lite5h4dow> yes
16:18:04GitDisc<Lite5h4dow> i have attepted compilation with taintmode off
16:18:11GitDisc<Lite5h4dow> it still returns the same error
16:18:22dom96Yes, so there are two things here.
16:18:33dom96And taint mode is confusing things more :)
16:18:40dom96Just think of TaintedString as "string"
16:19:01GitDisc<Lite5h4dow> ok
16:19:16dom96The other piece of the puzzle is: https://nim-lang.org/docs/manual.html#statements-and-expressions-discard-statement
16:19:23dom96Nim works differently than other languages here.
16:19:41dom96It forces you to either ignore a return value explicitly with 'discard' or to use it
16:19:53dom96That error means you're not doing either
16:20:20GitDisc<Lite5h4dow> right
16:23:14GitDisc<Lite5h4dow> so i have to use it somehow or am i still mistaken?
16:23:29GitDisc<Lite5h4dow> i have never come across this "discard" thing before
16:23:41GitDisc<Lite5h4dow> could you illustrate it with a python equivalent?
16:23:42Yardanicoif procedure returns something
16:23:45miranyou can `discard` it if you don't want to use it
16:23:47Yardanicoand you don't need it
16:23:52Yardanicoyou use "discard procCall()"
16:24:08GitDisc<Lite5h4dow> right
16:24:15GitDisc<Lite5h4dow> since its trying to return a value
16:24:32miranthere's no direct python equivalent
16:24:39GitDisc<Lite5h4dow> ok
16:25:10miranthink of it as: `_ = uneeded_value`
16:25:32GitDisc<Lite5h4dow> right
16:25:48GitDisc<Lite5h4dow> discard runs the function and discards the result
16:26:00GitDisc<Lite5h4dow> is that right?
16:26:10miranright
16:26:40GitDisc<Lite5h4dow> ok
16:26:44GitDisc<Lite5h4dow> usefull to know
16:26:51GitDisc<Lite5h4dow> really over explained in the documentation
16:28:02GitDisc<Lite5h4dow> thankyou
16:31:19*nsf quit (Quit: WeeChat 2.0.1)
16:31:33*marenz__ joined #nim
16:36:48GitDisc<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:58FromGitter<alehander42> we don't have isTitle in strutils, but we have on in unicode
16:52:13FromGitter<alehander42> should we add isTitleAscii ?
17:09:05FromGitter<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:30dom96bah, I just spent an hour and half trying to figure out why my libclang wrapper isn't working
17:36:41dom96and it was due to the lack of {.pure, bycopy.} on one of the types
17:37:08dom96the 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:49Yardanicodom96, did you use c2nim? :)
17:37:54dom96yes
17:38:00Yardanicohmm strange
17:38:09Yardanicousually 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:22FromGitter<tekjar> Is there `nimfmt` like `gofmt` and `rustfmt`?
18:38:48dom96nimpretty IIRC
18:38:56dom96not finished yet though
18:39:30*Yardanico joined #nim
18:42:23FromGitter<tekjar> Oh alright
18:43:05*Yardanico_ quit (Ping timeout: 256 seconds)
18:50:35*xet7 joined #nim
18:55:05AraqYardanico, 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:59Yardanico_Araq, I thought that dom96 was using the latest one :)
19:47:35*xkapastel joined #nim
19:48:56dom96anyone familiar with libclang here?
19:52:44*marenz__ quit (Ping timeout: 268 seconds)
19:59:39*miran quit (Quit: Konversation terminated!)
20:10:53FromGitter<RedBeard0531> I've done a bit of work with the c wrapper before.
20:13:40dom96I'm wondering if libclang offers any way to "render" an AST node
20:13:44dom96It doesn't seem that way :\
20:13:45FromGitter<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:52FromGitter<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:17dom96it's looking more and more likely that I will need to write my own AST rendering logic :\
20:17:42FromGitter<RedBeard0531> Take a look at the clang-tidy source
20:17:56FromGitter<RedBeard0531> it does ast->ast based transforms and outputs source files
20:18:12dom96ooh, thanks
20:18:26amscottiI'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:27FromGitter<RedBeard0531> Ignore clang-format since it operates at the token level
20:22:47*yglukhov joined #nim
20:23:42dom96man, this code... "ActionFactory"
20:24:06FromGitter<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:42dom96RedBeard0531: I'm not sure what you mean
20:25:20FromGitter<RedBeard0531> Forgot a link to the perf report output https://gist.github.com/RedBeard0531/2d619edb3386c80424d4bf4d794e8310
20:26:01dom96Does this not happen with your patch?
20:26:02FromGitter<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:17FromGitter<RedBeard0531> let me check...
20:26:18dom96oh, I see.
20:27:28dom96I think that even if recursive calls still happen, the number of them will decrease enough to not be a problem
20:27:49dom96or rather, I'm hoping that's the case
20:28:25FromGitter<RedBeard0531> Is there an upper bound? Otherwise I'd assume the law of "0, 1, many" applies :)
20:30:11FromGitter<RedBeard0531> Yeah, it seems to still happen with my patch, so it is triggered by something else
20:30:19FromGitter<RedBeard0531> not sure if that is good or bad news :/
20:36:16*Arrrr quit (Quit: Leaving.)
20:40:28FromGitter<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:32dom96yeah. If you're awaiting recursively then of course...
20:58:09FromGitter<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:04FromGitter<nitely> `var foo: seq[seq[string]] = @[@[]]` should this work? I get `Error: type mismatch: got (array[0..0, seq[empty]])`
21:08:44Yardanico_sadly no
21:08:56Yardanico_this one will work though:
21:09:20Yardanico_var foo: seq[seq[string]] = @[newSeq[string]()]
21:12:24Yardanico_well not really "sadly":
21:12:41Yardanico_it works like it should work
21:13:08Yardanico_and btw
21:13:18Yardanico_you don't need to specify seq[seq[string]] here:
21:13:26Yardanico_var foo = @[newSeq[string()]]
21:13:42Yardanico_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:38FromGitter<nitely> But this is valid: `var foo: seq[seq[string]] = @[]; foo.add(@[])`, also: `var foo = @[@["foo"]]`
21:21:27FromGitter<nitely> So, idk why it shouldn't work
21:21:29Yardanicoyes, because afterwards compiler knows what "foo" is
21:22:08FromGitter<nitely> right. So it can't infer the inner seq's type? even if I'm telling it what type it is...
21:22:19Yardanicoyes you can't :(
21:22:36Yardanicowell I mean "var foo = @[@["foo"]]" will work
21:23:37Yardanicowell IDK what Araq thinks about it
21:30:23dom96hrm, 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:00Yardanicodom96, why?
21:33:42Yardanicowell it would be cool if it will work
21:42:25FromGitter<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:36FromGitter<nitely> @RedBeard0531 I don't think so. `var x: array[1, uint8] = [0'u8]` this works. Not sure about the second one
21:52:45Yardanicorange is interpreted as a inner type here
21:52:53Yardanicoand 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:26FromGitter<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:39Yardanicoit's not
21:59:55Yardanicoarray[length, type]
22:02:18FromGitter<RedBeard0531> Maybe I'm using the term incorrectly, but it seems like type is inside array rather that being the primary type.
22:03:45Yardanico"array" is not a concrete type
22:04:35FromGitter<RedBeard0531> Neither is set
22:07:51FromGitter<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:24FromGitter<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:24FromGitter<RedBeard0531> I think that is how swift does it
22:09:56*SitiSchu joined #nim
22:27:41*yglukhov joined #nim
22:29:28GitDisc<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:00Araqyou can use Nim's calling convention
22:31:21GitDisc<NopeDK> Cool
22:32:12AraqRedBeard0531: 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:42Araqtype inference should work from atoms to higher structures not up and down in some arbitrary way just to save some typing
22:41:57FromGitter<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:01FromGitter<tim-st> what does it mean?
22:45:41FromGitter<tim-st> Ok, could be str compared to nil have to check this
22:46:53Yardanicoit's just an ICE (internal compiler error)
22:47:36FromGitter<tim-st> yes, i noticed but I want my code to compile again
22:48:43Yardanicocan you share it or not?
22:48:52Yardanicoand yeah, why are you comparing string to nil?
22:48:56Yardanicoyou should use .isNil()
22:49:04Yardanicobut I think it's not the cause of this ICE
22:49:09FromGitter<tim-st> I'm using isNil in fact
22:49:43FromGitter<tim-st> I will introduce default enum type and compare to this, will check if it works
22:51:28FromGitter<tim-st> Yes, it works. IsNil() doesnt work for nil string
22:53:15FromGitter<tim-st> well, it seems to work for plain string, my string was inside a tuple
22:54:44FromGitter<tim-st> Yes, that is it:
22:54:45FromGitter<tim-st> type test = tuple[ ⏎ x: string, ⏎ y: int, ⏎ ] ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a46c7b503838b2f2a4e1e0d]
23:01:12iAmSloware there any cons of nim?
23:01:43iAmSlowall i read say its greate, so it feels like i lie xD
23:01:49iAmSlowso any bad stuff about nim?
23:01:56FromGitter<tim-st> no good IDE
23:01:58*natrys quit (Quit: natrys)
23:02:12FromGitter<tim-st> compile times not perfect
23:02:40FromGitter<tim-st> stdlib not big compared to the big languages
23:03:02iAmSlowlibs will grow ower time as IDE will develo
23:03:15iAmSlowi asking something that will not get fixed ower time
23:03:28FromGitter<tim-st> the second one maybe
23:04:48FromGitter<tim-st> Can anyone confirm that it's a bug or did I have my code wrong?
23:08:55iAmSlowis compile time like 2x C++ ?
23:10:37FromGitter<tim-st> afaik like the c compiler you're using plus a minimal additional time, others know better
23:12:43Yardanicobut Nim is faster than C++ to compile :)
23:13:00Yardanicoand VScode + nimsuggest already provides autocompletion
23:13:07Yardanicoand about stdlib... well it's quite big i'd say
23:13:17FromGitter<tim-st> @Yardanico did you see an error in my example code?
23:13:49Yardanicoproc emptyTest(): test = result
23:13:58Yardanicowell that would probably work
23:14:04FromGitter<tim-st> yes
23:14:38FromGitter<tim-st> can vscode do refactoring of proc, var and files?
23:15:02*yglukhov quit (Read error: Connection reset by peer)
23:15:04Yardanicowhat do you mean by "refactoring" ?
23:15:20Yardanicoand about your code: it compiles if I do proc emptyTest(): test = discard
23:15:37*yglukhov joined #nim
23:15:41Yardanicoprobably it fails because it doesn't understand what you're trying to do with "result"
23:15:55FromGitter<tim-st> thanks, that is it!
23:16:03Yardanicoresult is always returned
23:16:24Yardanicoyou don't need to return it explicitly (until you need it for your program control flow)
23:16:42FromGitter<tim-st> result was shorter than discard
23:17:13FromGitter<tim-st> I meant with refactoring basically correct renaming of variables, proc, and module filenames
23:18:05Araqnimgrep can do renames, not ideal, I know, I know
23:18:14iAmSlowyebt but stdlib will groow ower time
23:18:45FromGitter<tim-st> If there was a working IDE like jetbrains that would be a big push
23:18:49Araqcompile-times will get better, I decided to try a simpler variant for --symbolfiles
23:18:56YardanicoAraq, really?!
23:19:03Araqyeah.
23:19:28Yardanicoeven if nim would only partially cache compilation results - it would still be very huge
23:19:34Yardanicoand you'll be able to recompile nim faster :P
23:19:57Araqmy current plan is: cache the compilation results of a full module in an SQLite db :P
23:20:20YardanicoAraq, you mean C code or some special format?
23:20:30Araqthe AST after sem'checking
23:20:31FromGitter<tim-st> Would (just in theory) a nim interpreter allow very fast interpretation (just for testing)?
23:20:40Yardanico"nim secret"
23:20:47Yardanicoit uses VM
23:20:49Araqtim-st: fixed your bug already
23:20:54Yardanico~same speed as python
23:21:01FromGitter<tim-st> @Araq Nice thanks!
23:21:21Yardanicobut yeah, it seems that people really want to have REPL
23:21:35FromGitter<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:51Yardanicoah, you mean
23:21:58Yardanicointerpretation speed vs compile+run speed?
23:22:16Araqcompile times are linear wrt the input program (roughly)
23:22:29Araqso the problem only affects people who have big Nim programs
23:22:47Araqbut it's becoming painful so we need to do something about it
23:23:00Araqnote that the C backend is parallel and cached etc etc
23:23:12Araqso now the frontend is our enemy :P
23:23:51YardanicoAraq, thanks for using "wrt"! I've learned quite a lot of shorthands while being in this chat :)
23:24:06Araqlol
23:24:21*nsf quit (Quit: WeeChat 2.0.1)
23:26:04FromGitter<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:18dom96NimBot needs an !urbandictionary command :P
23:27:05YardanicoRedBeard0531: because nim doesn't have a separate linker step
23:27:11YardanicoI mean nim code itself :)
23:28:20AraqRedBeard0531: never say never but it seems hard. you can always split up your program into static/dynamic libraries though
23:29:21FromGitter<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:04FromGitter<RedBeard0531> Yeah, separate libs could work but is a pain in the ass
23:30:24FromGitter<RedBeard0531> I assume there's a reason you didn't break the compiler up into separate libs :)
23:30:56Araqhmmm
23:31:17Araqwell the reason is that it never occured to me before
23:31:24iAmSlowdoes compiler use multythread?
23:31:31Araqnah
23:31:33YardanicoiAmSlow, C compiler does
23:31:33iAmSlowguessing it does
23:31:48iAmSlowwhat so nim single thread compiling only?
23:32:07Araqlike many others, yes
23:32:09YardanicoiAmSlow, Nim to C compilation - single-threaded; C to machine code - multi-threaded
23:32:09FromGitter<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:21iAmSlowmake it multy and buy threadriper :) = fast time
23:32:28Yardanico:D
23:32:35Yardanicoonly if it was that easy to do things... :(
23:33:17iAmSlowyep but thats the future
23:33:47*Jesin quit (Quit: Leaving)
23:33:59iAmSlowi would help if i know how , atm am strugling whit basic nim stuff xD
23:34:20Yardanicoi really doubt it's possible to make nim compiler multi-threaded while keeping all language features
23:34:26Yardanico(current language features)
23:34:29Yardanicobut I may be wrong
23:34:47iAmSlowyou need really multythread compile or that chache so it build on old if thats possible at all
23:35:00FromGitter<tim-st> @Araq Do you have any plans/ideas about an ide? should it be via language server?
23:35:09YardanicoiAmSlow, nim has cache
23:35:12YardanicoC files are caches
23:35:14Yardanico*cached
23:35:25FromGitter<tim-st> *language server protocol
23:35:32iAmSlowbut like i say i am newbie so am just shooting out of head suggestion
23:35:37Araqyou can parallelise module-wise but the module graphs are usually too messy so don't expend big speedups
23:35:56Araq*expect
23:36:06iAmSlowanyway so no other cons expect slow compile time
23:36:13Araqyou can also run the compiler phases in parallel
23:36:34iAmSlowtought duno how it comperese to other languges
23:36:45Araqbut that pipelining approach to parallelism is flawed imho
23:36:50YardanicoiAmSlow, did you compare nim vs c++ ? :)
23:36:53Yardanicocompilation times
23:36:56iAmSlowno
23:37:07iAmSlowhate me again :)
23:37:16iAmSlowi like spoons :)
23:37:17Yardanicoit may be slow for you if you're used to python
23:37:23Yardanicowhich doesn't have compilation at all
23:37:26iAmSlownah i am used to c#
23:37:29Yardanicoah, sorry
23:37:40iAmSlowi bulded godot from source it took some time
23:37:47iAmSlowlike 30mins
23:37:51Yardanicoit's a big project though
23:37:56FromGitter<tim-st> @Yardanico yes, and because of this my idea to use the same interpreting for nim for debug
23:37:58iAmSlowbut thats full gameengine
23:38:02Araqas I said, compile times are ok, especially for beginners ;-)
23:38:21Yardanicoand btw, if you want to improve compile times a bit - you can try clang
23:38:41FromGitter<tim-st> how much by percentage?
23:38:56Yardanicowell, I measured it!
23:39:03iAmSlowso no cons about nim exept Time
23:39:15Yardanicoon my android device (snapdragon 625) I have a chroot'ed arch linux
23:39:15FromGitter<tim-st> IDE as I said is a big con
23:39:15Yardanicoso
23:39:17iAmSlowTime = compile time + libs community grow
23:39:32iAmSlowIDE = Time too
23:39:35FromGitter<tim-st> I used to program with Pycharm which had all the good features
23:39:36Yardaniconim bootstrapping (from C cources) with gcc - 4mins30secs
23:39:53Yardaniconim bootstrapping from C c ources with clang - 2mins 30 secs
23:40:01Yardanicoof course you'll also have nim compilation step
23:40:06Yardanicobut C compilation step will be faster
23:40:17FromGitter<tim-st> @Yardanico that's good to know, thanks!
23:40:59Yardanicohmm, I'll probably try nim bootstrapping including nim compilation now (on my pc)
23:41:31Araqsure, add the 5s of the Nim step to that
23:41:40iAmSlowand about IDE i am using VScode whit nimplugin it has autocomplite and discripions, duno what you need more
23:42:00YardanicoiAmSlow, did you use all visual studio features?
23:42:07Yardanicowell I mean there's a lot of them
23:42:15Araqsomebody should take over my NimEdit ... :P
23:42:31FromGitter<tim-st> Can VsCode autocomplete from system.nim ?
23:42:37Yardanicotim-st: yes
23:42:50FromGitter<tim-st> ok, will install it now^^
23:43:04Araqit uses 'nimsuggest' which is the Nim compiler as a "language server"
23:43:45FromGitter<tim-st> Yes, but sublime uses nimsuggest, too. The big features are not working in sublime
23:43:52user0Looks like the gintro package does not work in my system
23:43:59Yardanicotim-st: what features?
23:44:05*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
23:44:05Yardanicogoto definition?
23:44:05user0*sigh*
23:44:24FromGitter<tim-st> code completion, refactoring of var, proc, filenames, goto source code
23:44:28FromGitter<tim-st> just to name a few
23:44:34Yardanicocode completion, goto source will work
23:44:51Yardanicorefactoring - well, vscode can handle that itself
23:45:03Yardanicobut of course it's not very smart
23:45:12FromGitter<tim-st> In Sublime afaik only in local files and *very* basic
23:45:28FromGitter<tim-st> ok, will try it now
23:46:44Yardanicolol, clang on windows doesn't work without MSVC
23:46:51Yardanicobecause it doesn't have "string.h" header
23:46:58FromGitter<tim-st> @Yardanico does code formatting work in VsCode? this is a very good feature in jetbrains
23:47:13Yardanicosadly it's a bit broken for nim in last vscode releases
23:47:43FromGitter<tim-st> because this features highly depends on the grammar, I assumed it...
23:47:53Yardanicoit was working good before :P
23:48:04FromGitter<tim-st> ok
23:49:54FromGitter<tim-st> Well, VsCode in fact seems to work better than sublime, that's very nice^^
23:50:01FromGitter<tim-st> Thanks!
23:54:52*Faster-Fanboi joined #nim
23:55:04Yardanicowhat is this
23:55:05Yardanicohttps://stackoverflow.com/a/47148323
23:55:18Yardanicoclang doesn't provide headers itself when installed
23:56:33FromGitter<tim-st> I also have vs studio c compiler, is it quicker than gcc in compilation?
23:56:55YardanicoI don't know
23:57:02Yardanicomaybe even slower than gcc 7.2 :D
23:59:17FromGitter<RedBeard0531> It's also like 100x slower at linking
23:59:34FromGitter<tim-st> oh, ok^^