<< 03-11-2018 >>

00:00:17FromGitter<timotheecour> on that topic, how do i compile nimsuggest in debug mode? I’m trying to debug `SIGSEGV: Illegal storage access` ; I tried `nim c -o:/tmp/nimsuggest_debug --debugger:native nimsuggest/nimsuggest.nim` but doesn’t work
00:01:35*zachk quit (Changing host)
00:01:35*zachk joined #nim
00:01:43*fredrik92 joined #nim
00:03:21FromDiscord_<Shield> @zetashift it seems like an odd limitation that most people will fall for it, this may be godot's fault tho, they mixed setters/getters with fields you wouldn't know which is which
00:04:47FromDiscord_<hollywoo> Do I need to install git to be able to use nimble? I ask because when I try to install sdl2_nim it automatically tries to do it using git then returns the error that git is not installed.
00:05:26*couven92 quit (Ping timeout: 244 seconds)
00:05:39FromGitter<tim-st> hollywoo: https://github.com/nim-lang/nimble/#requirements
00:06:29FromDiscord_<Shield> is --header broken or something?
00:07:10FromDiscord_<hollywoo> Thanks, Gitter.
00:08:15FromDiscord_<Shield> lol
00:09:31FromDiscord_<hollywoo> Or rather, tim-st?
00:09:43FromDiscord_<hollywoo> I'm not sure how the IRC --> Discord thing is working here.
00:09:44*zachk quit (Quit: Leaving)
00:09:52FromDiscord_<hollywoo> Oh, Gitter is the bot.
00:09:57FromDiscord_<hollywoo> So definitely Tim. Thanks.
00:10:06*a_b_m joined #nim
00:11:10FromGitter<zetashift> make sure git is also added to your path!
00:11:14FromGitter<tim-st> ^^
00:13:23*abm quit (Ping timeout: 245 seconds)
00:13:33FromDiscord_<hollywoo> zetashift, thanks! I got it myself that time. I'm learning. 😃
00:14:27FromGitter<tim-st> for the following `iterator pairs*IX, T (a: array[IX, T]): tuple[key: IX, val: T]` can `IX` be other type than `int`?
00:15:40*d10n-work quit (Quit: Connection closed for inactivity)
00:19:17FromGitter<zetashift> SDLGamelib looks sweet @PMunch but as a complete noob a bit daunting
00:19:59PMunchYeah, I should probably write up some better documentation and create some examples
00:20:38*xet7 quit (Quit: Leaving)
00:20:58PMunchIt's basically meant to be a thin wrapper around some basic SDL functionality
00:21:03*xet7 joined #nim
00:21:47PMunchYou can have a look at this for some of the functionality
00:21:49PMunchhttps://github.com/PMunch/TromsoGameJam2017
00:21:49FromGitter<zetashift> yea the README is really clear about that :P. it basically becomes nimgame2
00:21:56PMunchBut it's about as messy as code gets :P
00:22:34PMunchThis is the meat of the project: https://github.com/PMunch/TromsoGameJam2017/blob/master/src/sgtest.nim
00:22:36FromGitter<zetashift> yikes the main.nim is some emitted C code and macros
00:23:06PMunchOh yeah, that's for Android
00:23:23PMunchTheoretically it cross compiles to run on mobile
00:23:50PMunchThat project structure is based on this: https://github.com/yglukhov/nim-sdl-template
00:23:58PMunchBut it's not required for SDLGamelib
00:25:29FromDiscord_<Shield> is there no way to generate headers for exported nim objects?
00:26:48Araqhmm this is concerning, how do I know if my osx has a virus?
00:28:07PMunchAraq, look in the top left corner. If there's an apple there you have a virus<
00:28:31Araqdamn
00:29:21FromGitter<tim-st> I only know how to prevent it: setting up a very critical firewall
00:29:51Araqwell I can reboot and hope for the best
00:30:09Araqit's strange, neither firefox nor chrome start
00:30:12Araqother apps do
00:30:24PMunchDo you have any kind of error log?
00:31:58Araqsomewhere, forgot how to open it
00:33:04PMunchHmm, any idea why this doesn't work: http://ix.io/1qMM/Nim
00:33:17PMunchI only get the results for the first command
00:33:33dom96lol, apps don't start and your immediate thought is "must be a virus"?
00:33:46Araqno I also think
00:34:01Araq"stupid new osx rule prevents competitor browsers from running"
00:34:06*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
00:34:15dom96timotheecour: it's not as if nimsuggest is some special program, you compile just like everything else
00:34:22FromDiscord_<Shield> --header only generates the name of the struct with no fields at all
00:34:52PMunchWhat?
00:35:38PMunchOh, you were replying to something that was said last midnight :P
00:37:04PMunchCan't I send more than one message?
00:37:53FromGitter<timotheecour> @dom96 well I know but without certain extra flags, nimsuggest didn’t work; I figured it out now by looking at what koch does: `bin/nim c --noNimblePath -p:compiler --debugger:native -o:bin/nimsuggest_dbg nimsuggest/nimsuggest.nim` gets me a debug version
00:39:31FromGitter<timotheecour> which helps investigate the crashes https://github.com/nim-lang/nimsuggest/issues/93
00:41:51Araqapparently it was a full HD
00:42:23Araqand browsers take up more space than other programs
00:43:27FromDiscord_<Shield> is --header supposed to only generate the header for exported procs only? it ignores types and objects or generate a struct with no fields
00:43:43Araq--header is obsolete
00:44:03Araqyou are on your own writing a header
00:47:22FromDiscord_<Shield> ouch, anyway to get offsets and type alignments?
00:59:01PMunchWhat are the list two entries of the nimsuggest output
00:59:03PMunch?
00:59:31PMunchv1 follows the docs, but v2 adds two new undocumented fields
01:00:23*seni quit (Quit: Leaving)
01:04:24*darithorn joined #nim
01:06:14*a__b__m joined #nim
01:09:47*a_b_m quit (Ping timeout: 240 seconds)
01:20:42*vlad1777d quit (Ping timeout: 268 seconds)
01:22:51PMunchOkay, I've made some good progress on nimlsp
01:23:20PMunchI'm ready to try and do the first lsp <-> nimsuggest command tomorrow
01:24:23PMunchCurrently it's starting and stopping as it should, and keeps the document in sync, plus it has a module to do the utf conversion silliness it needs to
01:25:01PMunchNo now I just have to write a small "send command to nimsuggest and get a reply" library, and I'm good to go on mapping all the functionality over
01:25:31PMunchSo we might have some kind of Language Server support over the weekend :)
01:25:34*PMunch quit (Remote host closed the connection)
01:32:39*dddddd quit (Ping timeout: 252 seconds)
01:33:43FromDiscord_<Epictek> Yay
01:47:41*dddddd joined #nim
01:59:16*vhotsyk quit (Quit: Textual IRC Client: www.textualapp.com)
02:05:04*a__b__m quit (Quit: Leaving)
02:24:22*endragor joined #nim
02:30:18FromGitter<timotheecour> is anyone using sublime with NimLime plugin?
02:30:45FromGitter<timotheecour> it just doesn’t seem to work at all (beyond syntax highlight)
02:39:44FromGitter<timotheecour> => https://github.com/Varriount/NimLime/issues/113
02:43:54*endragor quit (Remote host closed the connection)
02:46:47*wildlander quit (Quit: Konversation terminated!)
02:55:44*kapil____ joined #nim
03:05:15*banc quit (Quit: ZNC - http://znc.in)
03:23:56*banc joined #nim
04:02:47*theelous3_ quit (Ping timeout: 240 seconds)
04:06:28*chemist69_ joined #nim
04:09:18*chemist69 quit (Ping timeout: 252 seconds)
04:10:42*darithorn quit ()
05:11:31FromGitter<AchalaSB> Hi, trying run Nim -> wasm (refering https://www.spiria.com/en/blog/web-applications/webassembly-nim) when I run `make hello.html` it gives me message successful. ⏎ But when I open my `hello.html` file in browser its not showing me the message using emscripten insted it showing me some binary or unsupported text encodings. ⏎ How to solve the issue?
05:30:32*nsf joined #nim
06:12:57*dddddd quit (Remote host closed the connection)
06:17:34*narimiran joined #nim
06:39:21*endragor joined #nim
06:43:56*endragor quit (Remote host closed the connection)
06:48:18*Trustable joined #nim
06:59:26FromGitter<timotheecour> @AchalaSB r u on linux ?
06:59:38*mech422_ joined #nim
06:59:46FromGitter<AchalaSB> Yes
07:00:34FromGitter<timotheecour> would love to try but on OSX; not sure how simple it is based on quick scheming through instructions
07:02:31FromGitter<AchalaSB> It is running in `bodhiLinux` Can I use this in Ubuntu 18.04?
07:02:56*mech422 quit (Ping timeout: 268 seconds)
07:34:34FromGitter<timotheecour> @AchalaSB I was able to generate hello.html from OSX via vagrant, and it all works :)
07:36:12FromGitter<timotheecour> `open hello.html` gave errors in chrome developper window (eg: hello.html:1246 still waiting on run dependencies) but then i tried running via a SimpleHTTPServer and that did work, it prints `hello world from Nim!` in browser
07:36:29FromGitter<timotheecour> (via `python -m SimpleHTTPServer 9009` for eg)
07:44:57FromGitter<AchalaSB> Im getting error when I run `vagrant up` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bdd51f96ab3f85bddf87760]
07:49:43FromGitter<timotheecour> on OSX; so my setup is different; but maybe look into https://github.com/openebs/openebs/issues/1301
08:09:48copygirlI can't even find anyone using `sameType`. How am I supposed to find out what the right usage is? ^^"
08:17:48*xet7 quit (Remote host closed the connection)
08:18:05copygirlhttps://gist.github.com/copygirl/62b9e94027758ecc1b016d2b1eaf8a66
08:18:52copygirlIt all outputs `Sym "string"` but the comparison fails. And so does `==`.
08:21:00FromGitter<alehander42> wow @dom96 amazing result on the benchmark
08:21:19copygirlI've been stuck with this for so long, now. Maybe I'll just do string comparison from .repr or .treeRepr for now.
08:21:28FromGitter<timotheecour> $nimc_D/tests/macros/tsametype.nim
08:21:41FromGitter<timotheecour> (for @copygirl)
08:21:45copygirlAh thanks.
08:22:15FromGitter<alehander42> @copygirl yeah, sometimes a temp solution is better, so you can do other work concurently while you find the missing piece
08:22:28FromGitter<alehander42> do you have somewhere your either type impl
08:22:32FromGitter<alehander42> like github or gist
08:23:45copygirlMaybe sameType only works with `typedesc`..?
08:23:58copygirlhttps://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790
08:24:30FromGitter<alehander42> @dom96 what is jester missing to qualify for the query benchmarks?
08:26:08*rokups joined #nim
08:27:12*endragor joined #nim
08:32:26*Vladar joined #nim
08:37:37*stefanos82 joined #nim
08:37:41copygirlI think I ... somewhat fixed it.
08:39:12copygirlIf I use `getTypeInst` instead of `getType`, I can compare the Sym nodes using `==` but it doesn't account for aliases.
08:46:15*endragor quit (Remote host closed the connection)
08:52:36copygirlNow the question is if there's any way to pass a NimNode through to another macro so I can get my error to appear at the right place!
09:01:04AraqgetAst otherMacro(nimNode)
09:01:13Araqbut maybe I misremember
09:01:13*leorize quit (Quit: WeeChat 2.3)
09:05:19*leorize joined #nim
09:08:06*endragor joined #nim
09:08:16copygirlAraq: I'm.. not entirely sure how that would look for me.
09:09:56*endragor quit (Remote host closed the connection)
09:10:12*endragor joined #nim
09:10:42copygirlLike, I have a mixture of typed and untyped parameters.
09:12:02Araqwhat are you trying to do?
09:12:49copygirlIdeally, passing a reference of a NimNode through to a macro so it can call `error` with that node so it can appear in the right place.
09:14:32copygirlhttps://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790#file-either-nim-L130
09:17:26Araqan 'Either' seems suboptimal
09:18:12Araqonce you get the implementation to work nicely I still wouldn't want to use it, let me explain why
09:18:39Araqso you start with JSON and that's dynamically typed
09:19:08Araqyou give it a schema (good!)
09:19:32Araqbut after schema validation I want to have Nim objects and seqs, not Eithers
09:20:11Araqnow there are cases in JSON that are what the professionals call "mistyped"
09:20:42Araqlike int | string (if it can be a string you can also store a number in it...)
09:21:12*endragor quit (Remote host closed the connection)
09:21:18Araqfor Nim I would map that to 'string'
09:21:28Araqbut you can also keep these as Nim's JSON
09:22:06copygirlAnd for more complex cases, I suppose... I should look for a common denominator?
09:22:22Araqyeah but in doubt, leave it as JSON
09:22:47AraqNim programmers know how to deal with JSON but Either would come with its own API
09:22:56copygirlI really want the type safety and completion and all that fancy stuff though.
09:23:14Araqyeah, most JSON is typed properly
09:23:19copygirlI can just type a dot and see what all will be in the object that I'm going to load from JSON.
09:23:38Araqyou need to generate objects and seqs for that
09:24:00copygirlAnd I am?
09:24:03Araqmy point is, the JSON escape hatch would only rarely be necessary
09:24:33copygirlThe point is to support `Either[SomeObject, SomeOtherObject]` later.
09:24:41Araqyou're messing with a variadic generic type that doesn't belong to the final solution
09:25:16copygirlIf I load it, the first object which succeeds validation is the one that will be de..serialized?
09:25:29copygirl(Is it (de)serialization when it's from text?)
09:25:32AraqEither[SomeObject, SomeOtherObject] would be SomeSuperclass
09:26:30AraqI don't know how you're doing the "loading"
09:26:42Araqor what "the first object which succeeds validation" means
09:27:51FromGitter<alehander42> maybe you guys need a concrete example
09:28:19FromGitter<alehander42> copygirl, do you have a simple example json you want to load which would have such typical either-s
09:28:28copygirlSomeObject could have a `"foo": string` and and `"bar": int`, SomeOtherObject has both but also `"baz": string`.
09:28:51Araqthen SomeOtherObject is a subtype of SomeObject
09:29:09copygirlWait my example wouldn't work because missing fields are ignored..
09:29:16copygirlSo I guess the other way around.
09:30:07FromGitter<alehander42> what I wonder is, isn't it possible to generate variant objects instead
09:30:17copygirlAraq: And then use `method`..? Or how do I find out which subtypes there are?
09:30:33copygirl@alehander: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0/schema
09:30:34FromGitter<alehander42> i remember there was a reason variants werent enough here
09:31:49copygirlThough TBH I'm not sure if this schema has any types that would warrant `Either`.
09:33:10FromGitter<alehander42> so e.g. if A can be {int: float} but also boolean, you want to parse this as Either[{int: float} type, bool]
09:34:16*endragor joined #nim
09:34:26*endragor quit (Remote host closed the connection)
09:34:37AraqKhronosGroup? that means it's structs and arrays because it is mappable to C
09:34:46Araqwell hopefully.
09:35:02FromGitter<alehander42> ah you do generate variant objects actually
09:35:19copygirlYes. And the user of the schema wouldn't have to deal with the type definiton. They'd just do `someobj.someproperty[int]` or `someobj.someproperly[SomeType]`.
09:36:00Araqbut Nim code is someobj.someproperty without the [int]
09:36:42copygirlEither has a `[type]` macro that translates to `.get(type)` which will get the value of that either as `type`.
09:37:07Araqyeah sorry, this is not idiomatic Nim
09:37:50Araqand the JSON you're processing is likely just a C header file as JSON so some mutation of c2nim would get you there
09:38:44copygirlI'm not sure. It supports extensions and all that. Those can be any JSON object.
09:39:03copygirlAdditionally it's targeting WebGL too / mainly.
09:39:19copygirlBut I'll take a look.
09:40:23copygirlI just no little to no C, sooooo...
09:48:50FromGitter<timotheecour> @araq possible regression due to sizeof https://github.com/nim-lang/Nim/issues/9610
09:51:29Araqcopygirl: not my point, map the JSON to objects and seqs and you'll come all the way, no need for Either. that's my prediction.
10:01:24*elrood joined #nim
10:01:53copygirlYou're probably right. But I already put days of work into this.
10:03:38copygirlAnd my questions are still valid, I would think.
10:04:58copygirlThanks for your help.
10:05:58AraqI'm sorry you put days of work into this, but you learned Nim in this time too
10:06:25Araqand maybe I saved you more days of work :-)
10:06:38Araqtimotheecour: fixed
10:07:48copygirlThere's other cases where the either type might actually come in handy though, even if it's not for glTF.
10:08:16copygirlHeh. Sunk cost fallacy.
10:08:27Araqthat crossed my mind too
10:10:15copygirlI think my questions shouldn't be ignored though.
10:10:45copygirlThe issue that `sameType` doesn't seem to work for comparing symbols.
10:11:08copygirlAnd how to pass a NimNode reference from a macro to another (if it's possible, or why it isn't).
10:12:51AraqsameType operates on types, that's why
10:13:21Araqmacro to another macro usually is done my not calling the other macro but a common proc that takes NimNode
10:13:33Araq*by
10:14:22copygirlAgain I can't put together what you mean by that or how it would look, unfortunately.
10:14:38copygirlAnd if that could mess with my mixed typed / untyped parameters.
10:15:35*MyMind quit (Read error: Connection reset by peer)
10:15:43copygirlhttps://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790#file-either-nim-L193
10:15:51copygirlThis is where I would need to pass it.
10:16:24copygirlI guess it's not just macro to macro but it's part of a `quote`, which is the actual problem
10:17:31copygirlI guess what I can do is just call `lookupIndex` not inside a quote and discard the result just to get the error.
10:18:01*MyMind joined #nim
10:23:02copygirlMh not quite. Since I need to resolve the type ident.
10:34:46*Vladar quit (Remote host closed the connection)
10:35:06*Vladar joined #nim
10:39:49FromGitter<AchalaSB> @timotheecour Tried with `python -m SimpleHTTPServer ` server as well but getting same unreadable source file
10:44:49*kapil____ quit (Quit: Connection closed for inactivity)
10:52:21*Snircle joined #nim
10:58:17FromGitter<AchalaSB> This is result I'm getting. http://localhost:8545/hello.html ⏎ Can plz you check is it working fine for you.
11:25:43*rokups quit (Quit: Connection closed for inactivity)
11:28:15*Perkol joined #nim
11:41:34*Perkol quit (Quit: Leaving)
11:58:58*nsf quit (Quit: WeeChat 2.3)
12:06:39*vlad1777d joined #nim
12:14:56*dddddd joined #nim
12:15:46*endragor joined #nim
12:16:21FromGitter<Varriount> Does Nim now make a distinction between binary and non-binary file output?
12:16:59FromGitter<Varriount> I could have sworn that `\n` used to be invalid as a character literal because it was for platform-independant newlines.
12:19:50*jxy_ quit (Ping timeout: 272 seconds)
12:20:00*endragor quit (Ping timeout: 252 seconds)
12:20:04Araqthat changed \n is now LF, even on Windows
12:23:30*jxy joined #nim
12:31:04*enthus1ast joined #nim
12:49:21*wildlander joined #nim
12:59:07*kapil____ joined #nim
13:12:42*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:16:34copygirlWhat's the different between `typedesc[string]` and `type string` as a parameter?
13:19:43FromGitter<tim-st> it seems there is no difference, you can see it by the error message that typedesc[string] is seen as type string: `echo typedesc[string] == (type string)`
13:20:15copygirlAh okay... weird. Thanks!
13:21:59FromGitter<tim-st> here it's better, it returns true: `echo typedesc[string] is type string`
13:30:11*PMunch joined #nim
13:37:09*theelous3_ joined #nim
13:40:33copygirlMhh apparently a single-line proc with if statement doesn't work..?
13:41:35copygirl`proc foo(): bool = if false: true else: false`
13:41:41leorizeit would work if you use parenthesis
13:41:57leorize!eval proc foo(): bool = (if false: true else: false)
13:41:59copygirlSo many quirks..
13:42:00NimBot<no output>
13:44:29FromGitter<kaushalmodi> !eval proc foo(): bool = (if false: true else: false); foo();
13:44:30NimBotCompile failed: in.nim(1, 56) Error: invalid indentation
13:45:08leorize!eval proc foo(): bool = (if false: true else: false); echo foo()
13:45:09NimBotCompile failed: in.nim(1, 42) Error: expression 'false' is of type 'bool' and has to be discarded
13:45:29leorize!eval proc foo(): bool = (if false: true else: false); echo(foo())
13:45:30NimBotCompile failed: in.nim(1, 42) Error: expression 'false' is of type 'bool' and has to be discarded
13:46:14leorizebug, possibly?
13:50:15narimiranleorize: the last example works on my end
13:51:10FromGitter<kaushalmodi> narimiran: it compiles, but no echo output
13:52:00FromGitter<kaushalmodi> no, actually it fails
13:52:04FromGitter<kaushalmodi> I get "Error: expression 'false' is of type 'bool' and has to be discarded"
13:52:26FromGitter<kaushalmodi> I am on Nim devel 7a15d2d04bee7866a9f52113d5dd2be56102bac0
13:54:39*benjikun joined #nim
14:03:41dom96That isn't a bug
14:04:05dom96Your `bool` needs to be the last thing in the proc body
14:10:06FromGitter<zacharycarter> anyone else having difficulty getting godot nim to compile with nim devel / godot master branch
14:10:24AraqI don't know if it was ported to 0.19
14:10:33FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bddac596ab3f85bddfa87a0]
14:10:38FromGitter<zacharycarter> ah okay
14:10:38FromGitter<zacharycarter> thanks
14:10:56FromGitter<kaushalmodi> dom96: so how would I write `proc foo(): bool = false; echo foo();`
14:10:58FromGitter<kaushalmodi> it fails
14:11:01FromGitter<kaushalmodi> !eval proc foo(): bool = false; echo foo();
14:11:03NimBotCompile failed: in.nim(1, 38) Error: invalid indentation
14:11:28dom96put `false` at the end?
14:11:44FromGitter<mratsim> !eval proc foo(): bool = false; echo foo()
14:11:46NimBotCompile failed: in.nim(1, 20) Error: expression 'false' is of type 'bool' and has to be discarded
14:12:05FromGitter<mratsim> !eval proc foo(): bool = result = false; echo foo()
14:12:08NimBot<no output>
14:12:51FromGitter<zetashift> @zacharycarter yeah godot-nim doesn't work on 0.19 anyway because also uses quite some nil checking and stuff but the error you're getting is unrelated
14:13:18FromGitter<zacharycarter> well - I'm going to switch to 0.18.0
14:13:20FromGitter<zetashift> see: https://github.com/pragmagic/godot-nim/issues/32#issuecomment-399947244
14:13:32FromGitter<zetashift> praise be too choosenim!
14:14:23FromGitter<zacharycarter> I like choosenim - but I think it needs to be universally used
14:14:28FromGitter<zacharycarter> I don't even understand why ANYONE is using nake anymore
14:14:37FromGitter<zacharycarter> you can accomplish almost everything nake does - with nimble and nimscrpt
14:14:44FromGitter<zacharycarter> and even if you don't want to use Nimble - you still don't need nake
14:15:19FromGitter<zacharycarter> but I don't really know what direction people want to take package management - some folks like Araq's nawabs and others like nimble
14:15:54benjikunWhat does nawabs do differently?
14:16:09benjikunI haven't seen many people using that
14:16:16Araqzacharycarter: I advised them to use nake because they were using NimScript past its breaking point
14:16:31FromGitter<zacharycarter> gotcha
14:16:43Araqthey setup a very complex build and only native Nim was up to it
14:16:49FromGitter<zacharycarter> ah okay
14:16:51dom96zacharycarter: some folks?
14:16:52dom96Who?
14:17:15FromGitter<zacharycarter> well I was having a discussion w/ Arne about the topic, maybe two months ago
14:17:24FromGitter<kaushalmodi> dom96: see above, that one liner is still not working
14:17:25dom96nawabs is an experiment and I don't know of anyone who uses it
14:17:27FromGitter<zacharycarter> he said he wasn't a fan of nimble and was exploring using Nawabs
14:17:34FromDiscord_<hollywoo> So, I installed nimx and tried to run the test program. Literally copied/pasted the contents. It compiled, but then wouldn't execute. Anybody have any idea why?
14:17:34AraqI do, sometimes. :-)
14:17:37FromGitter<zacharycarter> I'm not sure if that's the case
14:17:47FromGitter<zacharycarter> still
14:17:47*Trustable quit (Remote host closed the connection)
14:17:47dom96kaushalmodi: yes it is, it fails because it's an infinite recursion...
14:17:49FromDiscord_<hollywoo> I tried compiling in both VS Code and using the terminal.
14:18:03FromGitter<zetashift> do you get some output @hollywoo?
14:18:09Araqbut just to set things straight, I think nawabs's features should be made part of Nimble
14:18:25FromGitter<kaushalmodi> hmm, so no way to *one-linefy* this? ⏎ ⏎ ```proc foo(): bool = false ⏎ echo foo()``` [https://gitter.im/nim-lang/Nim?at=5bddae25d3442e1972827d08]
14:18:30Araqdom96 said it would be much work though :P
14:18:33FromDiscord_<hollywoo> Terminal just tells me "an external program failed to execute" or something similar, and spits out the name of the compiled program.
14:18:41benjikunAraq: What other features are in nawab?
14:18:49FromDiscord_<hollywoo> VS Code thinks it did it but nothing happens.
14:18:50benjikunI think nimble is pretty comfy
14:19:04Araqbenjikun: nawabs installs deps per project
14:19:14benjikunoh, I see
14:19:36Araqand keeps the .git and the original project structure
14:19:49Araqall features that IMHO Nimble can benefit from too
14:19:55FromGitter<zacharycarter> well - I think it'd be a good idea - to assume that if you're writing any libraries for public consumption - that you expect folks to be using choosenim and nimble
14:20:08FromGitter<zacharycarter> but I don't know how tall of an order that is - for libraries like godot nim
14:20:13benjikunYeah, nimble definitely could benefit from having that as an option
14:20:35FromGitter<zacharycarter> it might be that supporting choosenim with their complex build is more complex than is worth spending time on
14:20:55FromGitter<zacharycarter> but like - Rust for instance w/ rustup - I think it's universally understood, that that's how must rust users are installing rust
14:20:56dom96!eval (proc foo(): bool = false); echo foo()
14:20:58NimBotCompile failed: in.nim(1, 7) Error: ')' expected
14:21:06FromGitter<zacharycarter> we might benefit from operating under the same assumpiton
14:21:19dom96kaushalmodi: guess not
14:22:24FromGitter<kaushalmodi> was wondering if this would work, but it doesn't
14:22:27FromGitter<kaushalmodi> `(proc foo(): bool = false); echo foo();`
14:22:35FromGitter<kaushalmodi> basically tell Nim where that proc is ending
14:22:53dom96copygirl: `type string` is the new `typedesc[string]`, or at least it will be. Despite my best attempt to stop this :'(
14:26:02copygirlAwwh
14:26:06*copygirl laughes.
14:28:11*endragor joined #nim
14:28:56PMunchhttp://ix.io/1qOZ/Nim why does this fail with "Error: cannot evaluate at compile time: x" where I try to use it to slice into the tuple
14:30:04Araqthat's fine, tuples have no slicing
14:30:27PMunchWell not slice, but access a field based on a number
14:30:31PMunchDoesn't that work?
14:31:30Araqit has to be compile-time
14:31:46PMunchYeah, that's what I suspected
14:32:01PMunchKind of a strange error message though
14:32:15Araqtype SugResponse = array[SomeEnum, string] is what you should use instead
14:32:56PMunchEh, I'll just turn SugResponse into an object and use a case statement to assign the values
14:33:12PMunchThat way I could change line and col to be integers as well
14:34:09PMunchI was just trying to be lazy :P
14:34:38Araqtype SugResponse = array[SomeEnum, string] is what you should use instead
14:34:54Araqthen you have tuple-like access as well as iteration over it
14:35:04Araquse it frequently too, it's awesome
14:35:53PMunchHmm, so you could use sugResponse[EnumValue] to access them
14:35:59PMunchThat's actually pretty cool
14:40:20Araqyeah, told ya
14:47:57*endragor quit (Remote host closed the connection)
14:50:59PMunchHmm, when I try to use the dirtyfile option with nimsuggest it just gives me everything in system.nim..
14:51:41Araqnimsuggest defaults to "suggest all" when it cannot figure it out
14:52:34PMunchI try to send "sug /tmp/sugtest.nim:/tmp/sugtest_t.nim:6:2\c\L" on these two files http://ix.io/1qP6/Nim and http://ix.io/1qP8/Nim
14:54:00PMunchWith nimsuggest started as such: nimsuggest --address:localhost --v2 sugtest.nim
14:55:47PMunchBut with only the sugtest_t.nim file it works fine
14:56:55Araqcheckout nimsuggest's tests
15:02:19PMunchWell those don't really show me much on how to use it..
15:02:32PMunchhttps://github.com/nim-lang/Nim/blob/devel/nimsuggest/tests/tdot2.nim is basically the same that I do
15:02:58PMunchAnd it works if I have a saved file, but not with dirtyfile
15:03:46Araquse absolute paths to the dirtyfile
15:03:57PMunchI do
15:04:08PMunchApparently the separator between file and dirtyfile needs to be a ;
15:04:34PMunchso changing the command from "sug /tmp/sugtest.nim:/tmp/sugtest_t.nim:6:2" to "sug /tmp/sugtest.nim;/tmp/sugtest_t.nim:6:2" works
15:06:35*miran joined #nim
15:07:58Araqthat's how it is documented...
15:08:15PMunchYeah, just noticed that
15:08:28PMunchThis thing is pretty vague about all of this: https://nim-lang.org/docs/nimsuggest.html
15:08:46PMunchIt just says there are different fields, without any separator information
15:09:11PMunchIt also misses the two new fields from v2..
15:09:25PMunchIt would be nice to have an all in one proper document
15:09:29*narimiran quit (Ping timeout: 268 seconds)
15:09:51PMunchMaybe with some example code on how to interface with it
15:10:03*vlad1777d quit (Ping timeout: 245 seconds)
15:18:09*vlad1777d joined #nim
15:36:43*vlad1777d quit (Ping timeout: 245 seconds)
15:38:19*vlad1777d joined #nim
15:49:28*vlad1777d quit (Ping timeout: 272 seconds)
15:56:13FromDiscord_<deech> Does `{. noSideEffect .}` also imply `{. raises [] .}`?
15:56:49FromDiscord_<deech> Does `{. noSideEffect .}` also imply `{.raises: [] .}`?
15:57:44*kapil____ quit (Quit: Connection closed for inactivity)
15:58:13leorizedeech: I don't think so
15:59:49PMunchHmm, would it be an idea to make nimsuggest also work as a library? To save us from having to do all the network communications stuff when integrating with it from another Nim program?
16:00:23leorizedo it the Unix™ way and communicate via text :)
16:01:24PMunchWell yeah, but then I still need to implement the communications, it's just a different protocol..
16:01:45PMunchIt would be great to just be able to call e.g. sug and get a typed response back
16:10:24dom96deech: it doesn't
16:11:55PMunchHmm, http://ix.io/1qPE
16:12:02PMunchIt can't find nimsuggest
16:12:22PMunchBut it's in my path, and if I echo it out from my program it shows that the PATH is set
16:12:41PMunchDoes startprocess need a full path?
16:13:51leorizeno if you pass `poUsePath`
16:17:34PMunchAh
16:19:44*nsf joined #nim
16:42:54*darithorn joined #nim
16:49:17*itschin joined #nim
16:59:18PMunchAraq, what do you think, could nimsuggest be made a library as well?
17:05:38*PMunch quit (Remote host closed the connection)
17:07:21FromGitter<zacharycarter> @zetashift - so does choosenim just not work with godot-nim?
17:08:49FromGitter<zacharycarter> meh - no matter - I'm just going to install 0.18.0 from source
17:10:25*darithorn quit ()
17:14:24FromDiscord_<Shield> wait, nimsuggest doesn't work with sublime text?
17:15:11FromDiscord_<Shield> I used it all this time without knowing it should show autocompletion
17:21:57FromGitter<zacharycarter> hmm
17:21:58FromGitter<zetashift> @zacharycarter but you need to do run nake clean after switching versions to get rid of that error
17:22:02FromGitter<zacharycarter> I tried
17:22:15FromGitter<zacharycarter> Ill do a fresh install and try again
17:30:29*kapil____ joined #nim
17:31:53AraqPMunch: maybe, but what do you mean? A DLL?
17:32:03Araqseems like an idea...
17:36:38FromGitter<zacharycarter> @zetashift - just did a fresh install of choosenim and installed only 0.18.0
17:36:51FromGitter<zacharycarter> had no .nimble or .cache nim-related folders in my home directory
17:36:55FromGitter<zacharycarter> still getting that error
17:37:00FromGitter<zacharycarter> and I did nake clean before nake build
17:37:15FromGitter<zacharycarter> I can't get Nim 0.18.0 to compile from source either
17:37:18Araqany estimate what it would take to port nim-godot to 0.19?
17:37:21FromGitter<zacharycarter> I get errors about experimental not nil annotations
17:37:32FromGitter<zacharycarter> but at this point - not quite sure how to get godot nim working
17:38:17FromGitter<zacharycarter> or koch won't compile rather with 0.18.0
17:38:17Araqreleases are self-hosting
17:38:23Araqyou build from the C sources
17:38:51FromGitter<zacharycarter> okay
17:44:08FromGitter<zacharycarter> Araq: slightly confused - if I look at install.txt in the 0.18.0 sources - it mentions a build.sh fhile
17:44:16FromGitter<zacharycarter> I've tried also installing by cloning csources
17:44:22FromGitter<zacharycarter> I can't find any build.sh file in the 0.18.0 sources
17:44:49FromGitter<zacharycarter> and when I tried to clone csources and build the way described in the readme - it gave me the experimental not nil error when trying to build koch so I could build tooling
17:46:35FromGitter<zacharycarter> going to try cloning csources and building as you suggested again
17:46:50FromGitter<zacharycarter> if that doesn't work - I'll just work on moving godot nim to 0.19.0
17:50:32FromGitter<zacharycarter> yeah - same issue :/
17:51:04FromGitter<zacharycarter> guess I'll just work on porting godot
17:52:22FromGitter<zacharycarter> err porting it to 0.19.0
17:52:54Araqthe 0.18.0 sources usually have build.sh, let me have a look
17:54:44Araqhttps://nim-lang.org/download/nim-0.18.0.tar.xz ships with a build.sh for me
17:57:13*itschin quit (Ping timeout: 268 seconds)
17:59:56FromGitter<zetashift> @zacharycarter I remember that error taking a while to fix for me personally but I also fixed it by doing nimble install in the nim dir or something like that
18:03:53FromGitter<zacharycarter> weirdddd
18:04:07FromGitter<zacharycarter> I was grabbing the release from github
18:04:19FromGitter<zacharycarter> and it definitely doesn't there Araq - at least not after I untar it
18:06:18FromGitter<zacharycarter> okay if I grab 0.18.0.gz from nim-lang.org - it has a build.sh in it
18:06:19FromGitter<zacharycarter> thanks
18:07:47Araqno weird, there are the tarballs and there is "install from github", these are different
18:08:10FromGitter<zacharycarter> no - I'm saying that I grabbed the "release" tar file from github
18:08:14FromGitter<zacharycarter> for 0.18.0
18:08:29Araqthere is no release tar file from github
18:08:30FromGitter<zacharycarter> if you go to the Nim repo on github, there is a release tab - with every tag
18:08:42FromGitter<zacharycarter> there is a release sources file
18:08:46Araqyeah, that's still "install from github"
18:08:58Araqwhich lacks the build.sh as it's not a tarball from us
18:09:29FromGitter<zacharycarter> okay - well - that's what I downloaded and tried to use, using the old build from source instructions and that's I guess why I was running into issues
18:10:06Araqgithub bundles the sources for a tag, that's not sufficient
18:10:18Araqwe should probably disable this 'releases' tab if possible
18:10:44*SolitudeSF[m] left #nim ("User left")
18:10:51FromGitter<zacharycarter> it did confuse me a bit - I'm used to just cloning and installing from devel - but when I need to build from source using an older version, I guess that's what got me
18:10:59FromGitter<zacharycarter> thanks for the help and explanation
18:12:40enthus1astzacharycarter could you not just pull the repo with git and manually switch to a commit near the 0.18 tag and build it with your current nim?
18:13:54shashlickvscode nim plugin is ridiculous - runs nim check on every file, cannot add a folder of nim projects into the workspace
18:14:01FromGitter<zacharycarter> I tried that too
18:14:14FromGitter<zacharycarter> well - I didn't have a current Nim
18:14:17FromGitter<zacharycarter> but yeah - I guess that could work
18:15:19FromGitter<zacharycarter> i'm g2g now though
18:19:00dom96zacharycarter: what error are you getting?
18:19:06dom96Is it a choosenim bug?
18:24:14FromGitter<zacharycarter> no - it's a godot nim bug
18:24:56FromGitter<zacharycarter> dom96: there is an issue / comment related to it here - https://github.com/pragmagic/godot-nim/issues/32#issuecomment-399938041
18:27:15*nsf quit (Quit: WeeChat 2.3)
18:31:32dom96This isn't choosenim's fault at all
18:31:57dom96And in fact it seems like the solution is simple: pin the compiler version in the .nimble file
18:32:04shashlickwho maintains nimble.directory again?
18:32:17shashlickneed to add ~/.nimble/bin to the path so that nimgen packages can work
18:32:51*endragor joined #nim
18:33:55dom96federico3:
18:34:27shashlicki don't think i should hardcode the nimgen path into wrapper nimble files or mess with the env (which you can't do in nimble yet anyway)
18:39:24federico3dom96: ?
18:39:46shashlickfederico3: see my msg about adding ~/.nimble/bin to nimble.directory path
18:42:12*endragor quit (Remote host closed the connection)
18:42:37*endragor joined #nim
18:47:08shashlickfederico3: https://nimble.directory/ci/badges/libsvm/nimdevel/output.html <= build fails because ~/.nimble/bin isn't in the path so nimgen and c2nim won't run as part of install
18:49:48*endragor quit (Remote host closed the connection)
18:58:50*vlad1777d joined #nim
19:01:34federico3thanks shashlick
19:15:05shashlickthank you!
19:22:00FromGitter<zacharycarter> @zetashift - I've built Nim 0.18.0 (on osx) - I've used choosenim - nothing is working with the godot nim stub
19:22:19FromGitter<zacharycarter> going to look at what dom was suggesting in pinning the compiler version
19:27:26Araqjust fix the tool
19:27:36Araqthe compiler API changed but it's not hard
19:29:10Araq var gConfig* = newConfigRef()
19:29:10Araq var identCache* = newIdentCache()
19:29:19FromGitter<DeathPoison> hey guys, is it possible to use s.th. like parseStmt at compiletime?
19:29:20Araqand then you have the objects that the procs now require
19:29:37AraqparseStmt is *only* available at compiletime...
19:29:51dom96Why is this using the compiler anyway?
19:29:53FromGitter<DeathPoison> sry, i mean runtime...
19:29:58FromGitter<DeathPoison> ./
19:30:22Araqdom96, it uses the compiler's AST renderer to produce the Nim APIs from a JSON description
19:30:55Araqand that Nim code is apparently not checked in... terrible practice.
19:32:01FromGitter<DeathPoison> i have some modules iam importing and want to call them automatically, can i store them in a list and call them from there?
19:32:29Araqyou can do these things, but if you're new, don't.
19:34:35dom96Araq: :'(
19:34:38FromGitter<DeathPoison> i have a directory of files and all of them provide a install proc, i want to call them all.. but dont know how i should do this the right way :P
19:35:43FromGitter<DeathPoison> for now, iam generating a file with "modulename.install(arg)" and import this :/
19:36:10FromGitter<DeathPoison> hopefully s.w. can lead me in a better direction :P
19:38:04Araqsmells like a "Plugin" system to me. these are better done at the end, once you covered the basics and already have a working system
19:40:04Araqhttps://github.com/nim-lang/Nim/tree/devel/tests/compilerapi shows how to use the compiler's virtual machine as a Nim library
19:40:22Araqso that the system can run Nim code at runtime
19:40:49Araqbut again, don't use this just because it's cool. use this if you really need it
19:42:19*stefanos82 quit (Quit: Quitting for now...)
19:45:08FromGitter<DeathPoison> do you have an idea how to solve this: include an unknown count of modules, and call their install proc
19:45:36FromGitter<DeathPoison> sry hopefully iam not wasting your time
19:47:17Araqyou can only do it with code generation
19:47:57Araqsome variant of walkDir is available at compile-time so you can use Nim's macro system to generate the import list
19:50:17FromGitter<DeathPoison> you mean: https://nim-lang.org/docs/oswalkdir.html
19:50:22FromGitter<DeathPoison> i will try this
20:11:38*darithorn joined #nim
20:23:00*zachk joined #nim
21:02:24*chemist69_ quit (Ping timeout: 250 seconds)
21:02:50*chemist69 joined #nim
21:03:17*darithorn quit ()
21:11:09shashlick@DeathPoison: look at nimdeps for similar stuff done at compile time
21:17:36*StephenLynx joined #nim
21:17:41*StephenLynx left #nim (#nim)
21:22:08*nsf joined #nim
21:23:53FromGitter<tim-st> this fail? `import math; echo sqrt(7)`
21:25:25federico3a helper to dedent a multiline string literal?
21:26:27FromGitter<tim-st> you mean me?
21:26:59federico3no, I was asking for suggestions :)
21:27:05FromGitter<tim-st> ok^^
21:32:19FromGitter<jrfondren> try `echo sqrt(7.0)`
21:33:09FromGitter<tim-st> sure, but I currently port golangs tour and they can just type sqrt(7) I thought nim has the int version too :\
21:35:18FromGitter<jrfondren> nah, just math.sqrt for float32 and float64
21:36:31FromGitter<tim-st> yes, but when I think about it int would be a good candidate too as input
21:36:51FromGitter<jrfondren> sqrt(float(x)) works fine for any int x
21:37:22dom96federico3: There is something in strutils for this
21:37:34dom96My book mentions it :P
21:37:40dom96But I can't remember what the proc is called
21:38:11FromGitter<tim-st> ^^
21:38:30FromGitter<jrfondren> unindent ?
21:38:59dom96probably
21:41:20FromGitter<jrfondren> there's a 'remove X whitespace' and a 'remove all whitespace' version, but I think what you'd usually want is to remove exactly whatever the first line has, so that internal indentation is preserved.
21:43:53federico3unindent
21:53:20*Vladar quit (Remote host closed the connection)
21:58:22*beatmox quit (Remote host closed the connection)
22:00:25FromGitter<tim-st> the nimcache folder for js backend is still in the same folder in 0.19.0, is it expected?
22:12:16*zachk quit (Changing host)
22:12:16*zachk joined #nim
22:19:32*kapil____ quit (Quit: Connection closed for inactivity)
22:24:16*PMunch joined #nim
22:27:41*rockcavera quit (Remote host closed the connection)
22:32:07PMunchAraq, so I dropped out before you answered me. Had somewhere I needed to be. Wasn't really thinking of a DLL (although that could also work), but more like just a regular Nim module. So basically just import nimsuggest; var context = openProject("filename"); var suggestions = context.sug("myfile.nim", 10, 4, dirtyfile = "/tmp/myfile.nim")
22:32:58PMunchWould simplify Aporia, and LSP, and any other Nim based suggestion plugin
22:34:24PMunchIf it was a DLL the import could even just be a regular dynlib load. That way the library could update without having to recompile the tool.
22:36:12*NimBot joined #nim
22:36:22PMunchdom96, so much for saying that Nim-bot has been stable :P
22:36:32PMunchOr are you doing maintenance on it?
22:38:56dom96I said "mostly stable"
22:39:07PMunchHaha, fair point
22:39:09dom96And yes, I need to fix that
22:39:19PMunchWhat was it?
22:39:22dom96It's a known issue but it doesn't affect NimBot that much
22:39:42dom96When was the last time someone came in here to complain that the IRC logs are down?
22:39:47dom96It's a memory leak
22:40:05PMunchAh right
22:40:17PMunchThose can be a pain to fix
22:41:02FromGitter<alehander42> yeah i even use the irc logs to browse the current irc sometimes
22:41:06FromGitter<alehander42> f5-ing them
22:41:08PMunchHad one in a project I did for a client. Turned out it was a bug in Unity, but luckily only appeared because I made a little Easter egg, so it was an easy fix.
22:41:15FromGitter<alehander42> i am a very smart user
22:41:45PMunchHaha, I tend to check the IRC logs when I've been away. To see if someone wanted to ask me something (or answered something I asked about, like now with Araq)
22:42:03FromGitter<alehander42> yeah I just use gitter
22:42:12FromGitter<alehander42> i know i can set up a bouncer (??)
22:42:30FromGitter<alehander42> but i am very lazy
22:42:40PMunchYeah, I've thought about that myself
22:43:04PMunchBut I like the IRC way of when I'm online I'm here and ready to talk
22:43:19PMunchIf I'm not online I'm off doing something else
22:43:34PMunchKinda like old school messenger services like MSN and AOL
22:43:40FromGitter<alehander42> oh very nostalgic
22:43:48PMunchWell I guess IRC is old school messaging :P
22:43:48FromGitter<alehander42> actually gitter also shows yellow or green
22:43:57FromGitter<alehander42> but only in the right which is not useful enough
22:44:05PMunchYeah, but I have enough tabs open
22:44:05FromGitter<alehander42> i have no idea why they dont have it in the chat itself
22:55:13PMunchWhat's the deal with the doc here: https://nim-lang.org/docs/osproc.html#hasData%2CProcess
22:57:08FromGitter<citycide> oh noooo `lexbase` doesn't work at compile time. I'm working on a parser using it so I'll probably rewrite without it now 😓
22:57:43FromGitter<citycide> PMunch: known issue with templates + docgen, I think it's fixed in devel
22:57:54PMunchAh okay
22:58:35*nsf quit (Quit: WeeChat 2.3)
23:13:30*miran quit (Remote host closed the connection)
23:17:44*elrood quit (Remote host closed the connection)
23:24:05PMunchHmm, parsing nimsuggest's stdout output is even worse..
23:33:49FromGitter<citycide> was starting to switch off `lexbase` and hit what seems like a bad codegen bug but I don't know enough C to know for sure: https://ptpb.pw/KZ-2
23:34:00FromGitter<citycide> `error: extra brace group at end of initializer`
23:34:18FromGitter<citycide> can try to reduce but I've got a mess of a WIP right now :laugh:
23:47:41dom96what are you working on?
23:47:52*zachk quit (Quit: Leaving)
23:58:45PMunchHmm, when I call terminate and waitForExit on a process it still shows in my task manager..