<< 31-05-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:01:15*junland joined #nim
00:08:44*ftsf joined #nim
00:11:18AvatarfighterFinally fixed my loop the reason why it wasn't working is because I forgot to enable ssl, only sad thing is I had no idea
00:12:01Yardanicothat's why you should check for errors properly
00:12:06Yardanicoand not just try: stuff except: discard :P
00:12:33AvatarfighterI would've been able to figure out the error if the compiler actually threw one :P
00:12:41Yardanicowell it does throw errors
00:12:47Yardanicoi mean httpclient does
00:12:51Yardanicoif you try to connect to https without ssl support
00:12:51Avatarfighterthe compiled program without -d:ssl didn't throw an ssl error :P
00:12:58Yardanicowell blame your website then
00:13:01Avatarfighterhaha
00:13:32AvatarfighterI don't blame it because when I awaited my futures manually it yelled at me
00:13:54Yardanicomaybe you just don't try: except the full body
00:14:02Yardanicoso some errors are getting ignored
00:14:14AvatarfighterLet me send a playground :P
00:15:19Avatarfighterhttps://play.nim-lang.org/#ix=2nT9
00:15:40Yardanicowell yeah you don't catch errors at all
00:15:43Avatarfighterif you run that without ssl it will just stall the whole program and wont raise an error
00:16:09Avatarfighterwhen you run with ssl it wont stall and errors are actually reported
00:16:25Avatarfighter(I removed all my error handling to show this)
00:16:34YardanicoAvatarfighter: you should test if a future failed in cb
00:16:43Yardanicoif fut.failed(): echo fut.error.msg else: add stuff
00:17:13Yardanicosomething like that
00:17:13Yardanicohttps://play.nim-lang.org/#ix=2nTb
00:17:25Yardanicoor you might want to handle it instead of raising it
00:17:26AvatarfighterOhhhhhh
00:17:28Yardanicobut never ignore it
00:17:32Yardanicoyou just ignored it before that
00:17:32Avatarfighteroh my gosh
00:17:38AvatarfighterI didn't even know that was a thing
00:17:51AvatarfighterI thought that my futures weren't even being registered :L
00:18:02Yardanicothere's no thing as "register a future"
00:18:32AvatarfighterHow does the polling find the futures ?
00:18:49AvatarfighterDoes a future not have to create an event for it to be processed?
00:19:13disrupteksee asyncdispatch
00:19:19AvatarfighterYeah I'm looking at it right now :(
00:19:21disruptekYardanico: wanna track down another arc bug?
00:19:29Yardanicodisruptek: if it's small enough :P
00:19:35Yardanicoi planned on going to bed a bit later
00:19:54disruptekdon't sweat it, then.
00:20:00Yardanicowell you can still share it
00:20:03AvatarfighterI thought when you create a future it creates an event for the dispatcher is that not how it works?
00:20:03disruptekit's small but it's also w/e.
00:20:12YardanicoAvatarfighter: events are a separate thing
00:20:51disruptekYardanico: see swamp.nim in this repo
00:20:53AvatarfighterThat's neat, I'm stuck thinking that Nim async works like JS promises
00:20:53Yardaniconim async is done with closure iterators
00:20:54disruptek!repo disruptek/marsh
00:20:55disbothttps://github.com/disruptek/marsh -- 9marsh: 11marshal native Nim objects via streams 15 0⭐ 0🍴
00:21:21disrupteknim async is dumb with closure iterators
00:21:24disruptekftfy
00:23:25*zacharycarter joined #nim
00:23:54AvatarfighterWow I'm mindblown right now
00:24:08AvatarfighterThanks Yardanico and disruptek
00:24:21disruptekwhat did i do
00:24:38Avatarfighteryou were hear when I got mindblown
00:24:40Avatarfighterhere*
00:24:51Avatarfighterhaha :)
00:26:03Yardanicoalso nim async isn't a language feature as you might've already noticed
00:26:08Yardanicoalthough async abuses closure iterators a lot :P
00:27:52*zacharycarter quit (Ping timeout: 258 seconds)
00:34:19disruptekYardanico: i guess it's a destroy of a loopvar.
00:35:50Yardanicogood night :P ill look into it later today
00:35:59disruptekpeace
00:46:13*lritter quit (Ping timeout: 246 seconds)
00:47:09*lritter joined #nim
01:13:32*chemist69_ joined #nim
01:13:39*bjornroberg quit (Quit: leaving)
01:16:42*chemist69 quit (Ping timeout: 272 seconds)
01:24:26*Jesin quit (Quit: Leaving)
01:27:39*Jesin joined #nim
01:49:54FromDiscord<dayl1ght> On 64-bit systems, isn't `int` an alias to `int64` ?
01:50:14disruptekit's 64-bit but it's not an alias.
01:50:41FromDiscord<dayl1ght> I'm trying to divide two `int64`s but getting an error
01:50:52disruptekwhat's the error?
01:51:35FromDiscord<dayl1ght> it doesn't find any matching overloads for `/`, even though `/` is defined for int
01:52:24FromDiscord<dayl1ght> https://ghostbin.co/paste/59pgt
01:53:09disruptektry div
01:55:09disrupteki seem to have a bug with intset that i cannot reproduce. i know, it's ridiculous.
01:55:20disrupteki mean, i cannot reduce it.
02:04:58Avatarfighterwow what Yardanico said about the async system caused me to understand how to correctly use it
02:05:08Avatarfighterits sooo cool
02:05:30AvatarfighterSpeaking of cool, is anyone else working on a cool project atm?
02:06:13PrestigeA tiling window manager.. just finishing up support for floating windows atm. What are you working on Avatarfighter ?
02:06:37FromDiscord<Generic> disruptek: looks like I have a two minute macro 🙂
02:06:44AvatarfighterPrestige: that sounds awesome, what OS are you targeting?
02:06:56AvatarfighterPrestige: I'm working on a helper library for people writing webscrapers
02:06:58PrestigeJust Linux (and x11 only)
02:07:15PrestigeNice, that sounds useful
02:07:24disruptekgeneric: eh get in line.
02:07:50Avatarfighterdisruptek are you working on anything cool atm?
02:07:59disrupteknever.
02:08:05Avatarfighterah
02:08:12Avatarfighterso what super uncool stuff are you working on :P
02:08:36disruptek!repo marsh
02:08:37disbothttps://github.com/disruptek/marsh -- 9marsh: 11marshal native Nim objects via streams 15 0⭐ 0🍴
02:08:40disruptek!repo lunacy
02:08:41disbothttps://github.com/disruptek/lunacy -- 9lunacy: 11 15 6⭐ 0🍴
02:08:44disruptek!repo disruptek/gram
02:08:46disbothttps://github.com/disruptek/gram -- 9gram: 11Generic graphs in Nim 15 2⭐ 0🍴
02:08:49disruptek!repo disruptek/poison
02:08:51disbotno results 😢
02:09:27Avatarfightermarsh seems like a fun one
02:09:38disruptekyou'd be surprised.
02:10:38AvatarfighterWhat is lunacy?
02:11:07FromDiscord<Generic> I measured this time
02:11:12disruptekthe kind of insanity that is broken by intervals of reason.
02:11:23FromDiscord<Generic> to be exact it's a 3:27m macro
02:11:43disruptekyou don't get extra points for writing slow code.
02:11:49Avatarfighterdisruptek: are you writing a lua vm?
02:12:03disrupteki hadn't planned on it.
02:12:14*Guest40129 quit (Ping timeout: 240 seconds)
02:12:20FromDiscord<Generic> my code isn't slow, it just does a lot of things
02:12:42disruptekshow me.
02:12:54FromDiscord<Generic> very well, wait a moment
02:14:14disruptek!repo lunacy
02:14:15disbothttps://github.com/disruptek/lunacy -- 9lunacy: 11a hack to let me work with some lua data more naturally 15 6⭐ 0🍴
02:14:17disruptekftfy
02:14:33PrestigeI should add eye-tracking software to my wm to automatically select which window you are looking at... hmm
02:14:36disruptekalso, it does implement the "goal", but to what end?
02:17:02*NimBot joined #nim
02:19:25Avatarfighterwelp I think I managed to max out my IO on my chromebook with my program :L
02:19:41Avatarfighterall this IO are *very* slow
02:19:45Avatarfighterthings*
02:23:43*zacharycarter joined #nim
02:26:01*muffindrake quit (Ping timeout: 272 seconds)
02:28:01*muffindrake joined #nim
02:28:04*zacharycarter quit (Ping timeout: 246 seconds)
02:33:59FromDiscord<Zed> how are you programming on a chrome book?
02:37:39FromDiscord<Zed> Yardinco: is there a way to install a private library onto your system without uploading to nimble?
02:37:58disruptekspecify the url.
02:38:36FromDiscord<Zed> like: nimble install <url>?
02:38:43disrupteksure.
02:39:11disruptekor just clone it into a directory and import it.
02:39:18disruptek!repo nimph
02:39:19disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 64⭐ 4🍴 7& 1 more...
02:40:55FromDiscord<Zed> That looks pretty interesting, i may use that
02:42:41disrupteki should warn you that working software is addictive.
02:43:26FromDiscord<Zed> lmao
02:45:52*mono joined #nim
02:46:43*xet7 joined #nim
02:48:17*monok quit (Ping timeout: 256 seconds)
02:57:47*def- quit (Quit: -)
02:58:02*def- joined #nim
02:58:03*opal quit (Ping timeout: 240 seconds)
02:58:15*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
02:58:33*kitech1 joined #nim
02:59:22*Jesin quit (Ping timeout: 260 seconds)
03:00:46*wgetch quit (Ping timeout: 260 seconds)
03:01:25FromDiscord<SeanOMik> What is the difference between a `proc` and `method`
03:01:29FromDiscord<SeanOMik> (edit) '`method`' => '`method`?'
03:01:55FromDiscord<SeanOMik> Oh and `func`
03:02:03*opal joined #nim
03:03:16leorize`func` is `proc {.noSideEffects.}`
03:03:32leorize`method` is `proc` but uses dynamic dispatching
03:03:42leorizemeaning that it's bound at runtime and not compile time
03:03:48leorizealso means that it's slower in general
03:03:58disruptekdon't be rude.
03:04:41FromDiscord<SeanOMik> Okay, I'm new to nim
03:04:47FromDiscord<SeanOMik> So I'm not sure what `dynamic dispatching` is
03:04:55FromDiscord<SeanOMik> And the `noSideEffects` pragma
03:05:03FromDiscord<SeanOMik> Could you explain please?
03:05:04disruptekit means function dispatch performed dynamically at runtime.
03:05:15disruptekas opposed to happening "for free".
03:05:48disrupteknoSideEffects lets the compiler optimize the call with the presumption that side effects do not occur.
03:06:04FromDiscord<SeanOMik> What side effects could occur?
03:06:09disruptekthis is mostly relevant to functional programming paradigms of immutability.
03:06:22disruptekthink memory alloc.
03:06:48leorizeside effects in Nim speak is "changing anything that's not reachable by input"
03:06:53disruptekalso, there's a coven near me where they do something with funcs and sheeps blood.
03:07:10disrupteki really don't want to get into the details.
03:07:48FromDiscord<SeanOMik> Okay, so its probably better to use `func` in general then?
03:08:01disruptekit'll just piss you off.
03:08:06disruptekuse proc and don't worry about it.
03:08:22FromDiscord<SeanOMik> Okay
03:08:24leorizeI do try to use func, but swapping between func and proc takes time :P
03:08:25disruptekit's basically a concession to neckbeards.
03:08:59disrupteki'm a grumpy old man for other reasons.
03:09:09FromDiscord<SeanOMik> Well I'm new to nim so I haven't really gotten used to writing `proc` yet
03:09:17FromDiscord<SeanOMik> Anyway
03:09:22FromDiscord<SeanOMik> Thanks for answering all my questions!
03:27:30*wgetch joined #nim
03:53:52*dddddd quit (Ping timeout: 256 seconds)
03:57:24FromDiscord<SeanOMik> Is there a way I could parse a int64 from a string?
03:57:49disruptekparseInt has always worked well for me.
03:58:38leorizeparseBiggestInt
03:59:01disruptekgtfo
04:05:29*waleee-cl quit (Quit: Connection closed for inactivity)
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:38*supakeen joined #nim
04:23:52*zacharycarter joined #nim
04:27:54*zacharycarter quit (Ping timeout: 240 seconds)
04:28:21disruptekhow come whenever my family goes looting, they never bring me back something nice?
04:32:44AvatarfighterThey're looting the wrong places duhhh
04:33:43FromDiscord<j-james> quick question↵is it possible to check if a directory's empty via getting a filelist or similar↵right now i'm iterating with walkDir and running quit() but that feels like a ridiculous hack
04:34:15disruptekyour hack sounds like the best method to me.
04:35:44FromDiscord<j-james> alright if it works it works
04:35:45FromDiscord<j-james> thanks
04:36:15leorizethe only way to get a file list is to walkDir :p
04:40:23*opal quit (Ping timeout: 240 seconds)
04:54:37*opal joined #nim
04:57:24*Jesin joined #nim
04:59:17*kungtotte quit (Read error: Connection reset by peer)
05:00:25*kungtotte joined #nim
05:01:42*hyuke joined #nim
05:06:39FromDiscord<SeanOMik> I'm getting a weird error when trying to use JsonNode anywhere: ```↵ambiguous identifier: 'JsonNode' -- use one of the following:↵json.JsonNode: JsonNode↵utils.JsonNode: JsonNode```
05:06:46FromDiscord<SeanOMik> (edit) 'anywhere:' => 'in a certain num file:'
05:07:35*solitudesf joined #nim
05:12:34leorizedoes your code define a JsonNode type?
05:16:34FromDiscord<SeanOMik> No
05:16:41FromDiscord<SeanOMik> I have it `included`
05:16:49FromDiscord<SeanOMik> `include json`
05:18:17bungwhy not using import
05:23:17FromDiscord<SeanOMik> Oh
05:23:23FromDiscord<SeanOMik> Thats probably my issue
05:23:41FromDiscord<SeanOMik> Coming from C++ and it uses `include`
05:25:13leorizec++ will finally catching up with the world with c++20 modules
05:25:23leorizecatches*
05:25:29leorizecatch*
05:25:30leorize:P
05:25:34FromDiscord<SeanOMik> lol
05:25:35FromDiscord<SeanOMik> Yeah
05:25:38FromDiscord<SeanOMik> Modules are cool
05:25:46FromDiscord<SeanOMik> Haven't messed with them though
05:26:15leorizeuse nim and you will hate c++ include :P
05:26:23FromDiscord<SeanOMik> I do
05:26:27FromDiscord<SeanOMik> No more linker errors
05:26:32FromDiscord<SeanOMik> Or cyclic includes
05:26:49FromDiscord<SeanOMik> So also no more having to use pointers just because you have to avoid cyclic includes in headers
05:30:08FromDiscord<dayl1ght> I'm trying to use `execProcess` from `osproc` to get the `stdout` from a command, but it also mixes in `stderr` in the output string
05:30:14FromDiscord<dayl1ght> Is there a way to only get the stdout?
05:31:13PrestigeI think with the options u can
05:31:30FromDiscord<dayl1ght> oh, I didn't realize `poStdErrToStdout` was in the default option set
05:32:25*narimiran joined #nim
05:33:10*solitudesf quit (Remote host closed the connection)
05:33:36*solitudesf joined #nim
05:45:45FromDiscord<SeanOMik> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716527820238618645
05:46:16FromDiscord<SeanOMik> (edit)
05:46:42FromDiscord<SeanOMik> Oops I edited it
05:46:46FromDiscord<SeanOMik> I'm sorry to the people on IRC
05:48:27*hyuke quit (Ping timeout: 265 seconds)
05:52:34FromDiscord<Yardanico> don't name your variable "json"
06:02:14FromDiscord<Yardanico> The error tells you that you call getElems from the json module on your json variable and then use json["users"] as the second argument to that. Basically compiler sees this code as jsonmodule.getElems(jsonvariable, jsonvariable["users"])
06:03:08FromDiscord<Yardanico> the best way is to rename your variable and also maybe take advantage of UFCS
06:03:52FromDiscord<Yardanico> let users = data["users"].getElems() where data is the parsed json variable
06:04:32FromDiscord<dayl1ght> if they have a variable named "json", shouldn't they get a redefinition error?
06:04:41FromDiscord<Yardanico> no, Nim has shadowing
06:04:50FromDiscord<Yardanico> It's quite useful in some cases
06:05:27FromDiscord<SeanOMik> Ah okay
06:05:33FromDiscord<SeanOMik> Thanks
06:07:03FromDiscord<dayl1ght> I wonder if shadowing could be disabled only for module identifiers
06:07:08FromDiscord<Yardanico> why though
06:07:11FromDiscord<dayl1ght> so that confusing errors like htis would be prevented
06:07:29FromDiscord<Yardanico> well most Nim code doesn't use module identifiers anyway :)
06:07:51FromDiscord<Yardanico> and also only modules like json might become an issue
06:08:41FromDiscord<Yardanico> I don't see people naming their variables "strutils" or "strscans"
06:08:58FromDiscord<Yardanico> And you can always do this
06:09:07FromDiscord<Yardanico> import json as jsonmodule
06:09:23*narimiran quit (Ping timeout: 258 seconds)
06:09:41FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#modules-module-names-in-imports
06:10:07FromDiscord<dayl1ght> true
06:11:27FromDiscord<dayl1ght> maybe the compiler could warn when you're shadowing a variable _and_ there's an error related to that variable
06:11:44FromDiscord<dayl1ght> i.e. include an extra line in the error message "btw, you're shadowing the `json` module"
06:11:49FromDiscord<Yardanico> Well that might be helpful, yeah
06:12:26FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/13518
06:12:27disbotImprove error message on name collision ; snippet at 12https://play.nim-lang.org/#ix=2cNL
06:17:22FromDiscord<dayl1ght> I'm writing an interpreter for a toy language in nim and I'm really enjoying it
06:17:39FromDiscord<dayl1ght> my biggest issue is that it seems like object variants are not fully type safe
06:17:51FromDiscord<dayl1ght> and null safety is missing 😦
06:17:57FromDiscord<Yardanico> What do you mean exactly about object variants
06:19:06FromDiscord<dayl1ght> sent a code paste, see http://ix.io/2nTP
06:19:33FromDiscord<dayl1ght> if I have `x` of type `Value`, and I'm inside an `if x.type == Bool`, I can access `x.intVal`
06:19:39FromDiscord<dayl1ght> that should be a compile-time error
06:20:14FromDiscord<Yardanico> well the thing is that a variable of an object variant can be changed at runtime
06:20:34FromDiscord<Yardanico> so it's all about the compiler complexity :P
06:21:25FromDiscord<dayl1ght> I don't see how being able to change the type affects type safety of accesses
06:21:37FromDiscord<dayl1ght> oops, changing the `kind` if that's what you mean
06:21:44bungYarnaico does jsObject has dynamic dispatch ? so I can `.anything` ?
06:22:30FromDiscord<dayl1ght> if I'm inside a `case Bool` or `if <variable of type Value>.type == Bool`, I can be sure that intVal will never be set
06:22:34FromDiscord<Yardanico> Also there's already an RFC for that https://github.com/nim-lang/RFCs/issues/25
06:22:34disbotRFC: Typesafe object variants
06:22:51FromDiscord<Yardanico> @dayl1ght well it's about how smart the compiler is
06:23:17FromDiscord<dayl1ght> I see yeah 😛 you'd need some kind of flow analysis like typescript does
06:23:35FromDiscord<Yardanico> @bung yeah, I think you can, but then you need to convert it to a native Nim type if your want to use it in Nim
06:23:59FromDiscord<dayl1ght> but for `case`s it should be easier to implement than for arbitrary `if`s
06:24:04FromDiscord<Yardanico> @dayl1ght well Nim already has a DFA for destructors as an example
06:24:10*zacharycarter joined #nim
06:24:45bungif it is chained like a(b).c(d) and result to nim type it also works?
06:25:08FromDiscord<Yardanico> maybe,I don't know
06:25:31FromDiscord<Yardanico> I think JsObject has . and .() defined so it will probably work
06:25:37bungI wrote something wraped like that compiled pass , but not sure it will work
06:25:47FromDiscord<Yardanico> @dayl1ght of course it's for a different thing, but https://github.com/nim-lang/Nim/blob/devel/compiler/dfa.nim
06:25:54FromDiscord<dayl1ght> it does look like you can get type safety from libraries using macros though, so that's nice
06:26:11FromDiscord<dayl1ght> ah interesting
06:26:27FromDiscord<Yardanico> But yeah, the idea about doing that analysis at least in case objects is nice
06:26:28bungoh thanks , that would be easy wrap js lib
06:26:30FromDiscord<dayl1ght> it'd be really nice to have that + null safety
06:26:40FromDiscord<Yardanico> Well null safety was attempted
06:26:41FromDiscord<dayl1ght> e.g. in typescript you can have a type like `type X = string | null`
06:27:01FromDiscord<Yardanico> There's "not nil" in Nim but it's mostly abandoned now
06:27:05FromDiscord<dayl1ght> and then the compiler forces you to check `if x != null` before calling any string methods in x
06:27:24FromDiscord<dayl1ght> (it narrows the type of x to `string` inside an `if x != null`)
06:27:24bungstring nil is abandoned
06:27:49FromDiscord<dayl1ght> which I'd argue is bad :p
06:27:56FromDiscord<Yardanico> why though?
06:28:04FromDiscord<dayl1ght> an empty string is not the same as nil
06:28:10FromDiscord<Yardanico> you can have use options module then
06:28:34*zacharycarter quit (Ping timeout: 265 seconds)
06:28:37FromDiscord<Yardanico> to distinguish between none, an empty string and a non empty string
06:28:56FromDiscord<dayl1ght> and default values + automatic result variable in procs can lead to bugs easily
06:29:00FromDiscord<Yardanico> But in most cases checking for nil means the same as checking for the empty string, at least that's how it is in Nim
06:29:03FromDiscord<dayl1ght> ``` ↵proc aaa(x: string): string =↵ echo "1"↵```
06:29:31FromDiscord<Yardanico> https://forum.nim-lang.org/t/6379
06:29:39FromDiscord<dayl1ght> right, you can use Option[T]
06:29:53FromDiscord<dayl1ght> but that's opt-in
06:30:16FromDiscord<dayl1ght> ``` ↵I completely agree with this proposal. It's time to make implicit result values a warning. The extra line result = 0 or similar in the beginning of a proc won't kill us.↵```
06:30:17FromDiscord<dayl1ght> nice
06:30:49leorizecurrently we also have `{.requiresInit.}`, which helps prevent a fair share of use-before-init bugs
06:30:49FromDiscord<Yardanico> but still, nil strings can lead to more issues since there's no full null safety in nim
06:31:02leorizenil strings are terrible
06:31:08FromDiscord<dayl1ght> right, it'd be useful if you had them with null safety
06:31:13leorizestrings are value type, nil should have never been an option
06:31:20FromDiscord<Yardanico> seqs and strings were nil in nim before
06:31:25FromDiscord<Yardanico> That was charged
06:31:31FromDiscord<dayl1ght> a value type doesn't mean non-nil?
06:31:32FromDiscord<Yardanico> (edit) 'charged' => 'changed'
06:32:19FromDiscord<Yardanico> Nim in nil is related to a null pointer
06:32:24leorizethe only thing nice about nil strings was that you have `nil` as `none(string)`
06:32:38FromDiscord<Yardanico> nil in Nim*
06:32:52leorizeother than that it's pretty useless imo
06:33:22FromDiscord<Yardanico> And the change from nil seqs/strings was made because a lot of people wanted that :)
06:33:24*disruptek quit (Ping timeout: 265 seconds)
06:33:25*disbot quit (Ping timeout: 246 seconds)
06:33:53FromDiscord<dayl1ght> well, nim doesn't have null safety
06:33:58FromDiscord<Yardanico> It was changed in 0.19.0 https://nim-lang.org/blog/2018/09/26/version-0190-released.html
06:34:03FromDiscord<dayl1ght> so it makes sense that they would want it
06:34:31leorizewell nil safety is staged for 2020, but it's kinda low prio compared to other stuff atm
06:34:42FromDiscord<dayl1ght> having null safety implies that you could have a nil string
06:35:16FromDiscord<Yardanico> well that won't be changed any time soon
06:35:33*disruptek joined #nim
06:35:37FromDiscord<Yardanico> right now the hot thing is arc/orc :)
06:35:47FromDiscord<dayl1ght> maybe we're talking past each other, I'm thinking of the "typescript way" of implementing null safety where you can have the type `string | null`
06:35:55FromDiscord<dayl1ght> but you could also do it like rust of course, using option and forbidding nil
06:35:56leorize!rfc nil
06:36:03*disbot joined #nim
06:36:05leorizeoh wait disbot died earlier
06:36:08leorize!rfc nil
06:36:19FromDiscord<Yardanico> Is there an RFC about it?
06:36:32leorizehttps://github.com/nim-lang/RFCs/pull/169
06:36:33disbotNilable and non-nilable types
06:36:36leorizeyes, staged for 2020
06:37:17leorizeofc, this is currently low priority :P
06:38:07FromDiscord<dayl1ght> looks like it's only for `ref` s
06:38:11FromDiscord<Yardanico> https://forum.nim-lang.org/t/5734 for arcs
06:38:14FromDiscord<Yardanico> arc
06:38:27Prestigeoh time to read that rfc. Sounds interesting
06:38:28leorizewell ref is the only thing in the language with nil atm
06:38:29FromDiscord<Yardanico> @dayl1ght because only ref and ptr may be nil
06:38:42FromDiscord<Yardanico> and ptr is kinda unsafe anyway
06:39:11FromDiscord<dayl1ght> are strings and seqs refs?
06:39:16leorizenope
06:39:30leorizethey are opaque objects
06:39:42leorizethe fact that they could be nil was an implementation leak
06:45:22FromDiscord<dayl1ght> these RFCs look nice
06:45:40FromDiscord<dayl1ght> on the topic of object variant type safety, another issue for me is with default values
06:45:51FromDiscord<dayl1ght> sent a code paste, see http://ix.io/2nTV
06:45:57FromDiscord<dayl1ght> you can create `X(kind: A)`
06:46:05FromDiscord<dayl1ght> and that's probably a bug imo
06:46:15Yardanicowhy?
06:46:22FromDiscord<dayl1ght> I don't want a to be 0
06:46:27leorizetag the type with {.requiresInit.}
06:46:34FromDiscord<dayl1ght> ah nice
06:46:52leorizeonce the tag is there, you will have to initialize "everything"
06:47:13FromDiscord<dayl1ght> so `type X {.requiresInit.} = ...`?
06:47:17leorizeyea
06:47:29FromDiscord<dayl1ght> hmm I'm not getting any warnings after doing that
06:48:23leorizehttps://play.nim-lang.org/#ix=2nTW
06:48:26leorizewhat version are you on?
06:48:43leorizethe latest (1.2) will scream at you :P
06:48:45FromDiscord<dayl1ght> 1.0.6
06:48:55FromDiscord<dayl1ght> oh that's probably it
06:48:55leorizeyea update to 1.2, lots of goodies
06:48:56FromDiscord<dayl1ght> thanks!
06:50:02FromDiscord<dayl1ght> there a lot of things that put me off of nim at first
06:50:08FromDiscord<dayl1ght> like the case insensitivty
06:50:14FromDiscord<dayl1ght> I still dislike it, but turns out it doesn't matter much in real code
06:50:21FromDiscord<dayl1ght> and the language is super nice so it makes up for that :p
06:50:27*brainbomb joined #nim
06:50:30leorizepeople like to shit on that feature :P
06:50:52leorizealso --styleCheck:error
06:51:21FromDiscord<dayl1ght> awesome!
06:51:45Yardanicoleorize: gonna go fix stdlib :P
06:51:47FromDiscord<dayl1ght> oh `nimpretty` too
06:51:50FromDiscord<dayl1ght> I really need to update
06:51:51Yardanicofound out ssl_certs.nim has snake_Case
06:51:56Yardanicosnake_case * variable
06:51:58leorizelol
06:52:03Yardanicoline 23
06:52:30Yardanicoasyncmacro too lol
06:52:37Yardanicoguess I'll make a PR with some of these
06:52:54leorizepeople always act like style insensitivity is the end of the world lol
06:52:59Yardanico"/home/dian/.nimble/pkgs/cligen-0.9.47/cligen/humanUt.nim(35, 7) Error: 'K' should be: 'k'" :P
06:53:06FromDiscord<dayl1ght> right, it's not
06:53:07Yardanicowell this I wouldn't fix
06:53:18Yardanicoor maybe I should
06:53:22FromDiscord<dayl1ght> the problem is if people end up not trying the language because of it 😐
06:55:09leorizewell people start talking less about it now :P
06:55:32Yardanicoleorize: also about style check - seems like whole threadpool uses "compilerProc" instead of "compilerproc" which fails the style check :P
06:55:54leorizewe should mark the stdlib as styleCheck-incompatible :P
06:56:06Yardanicoor maybe fix it instead :D
06:56:07leorizeiirc styleCheck only check your project, right?
06:56:09Yardanicono
06:56:16Yardanicoit checks all the code
06:56:19leorizewell maybe we should fix that then :P
06:56:34YardanicostyleCheck is enforced for compiler code too btw
06:56:38Yardanicoat least as far as I know
06:57:14Yardanicowe also have nimfix
06:57:32leorizethat one has not been updated for several years I guess
06:57:43Yardanicoyep
06:58:00leorizeI think we should make styleCheck only applies to the main project
06:58:09bungrequiresInit pragma is same as -d:nimOldCaseObjects
06:58:12bung?
06:58:14Yardanicohttps://github.com/nim-lang/Nim/issues/10201
06:58:17Yardanicobung: no
06:58:19disbot[styleCheck] --styleCheck:error inconsistent with --styleCheck:hint : doesn't respect package boundaries ; snippet at 12https://play.nim-lang.org/#ix=2nTX
06:58:19Yardanicothey're much different
06:58:26leorizebung: that pragma extends to everything
06:59:35bunghmm how does it work, code same as nimOldCaseObjects
06:59:43leorizeYardanico: well that bug should be fixed or else using mratsim's library will be a pain :P
06:59:48Yardanicohaha
06:59:57leorizehe write everything in snake_case the last time I checked :P
07:00:16Yardanicoleorize: styleCheck:hint doesn't mention the stdlib or other modules as the issue says
07:00:18leorizebung: requiresInit enforce initialization for all custom types, not just case objects
07:01:14Yardanicoleorize: btw, do you know if it's safe to have "used" on templates?
07:01:20leorizeYardanico: maybe we can just hook styleCheck:error to --styleCheck:hint --hintAsError[Name]:on
07:01:29leorizeYardanico: yes
07:01:32YardanicoI want to make a small pr to not have all these annoying warnings about unused await
07:01:44Yardanicoin big async projects you can get more than 30 of these warnings
07:01:52leorizesure, PR that one in
07:02:04leorize{.used.} is literally designed for this :P
07:02:35FromDiscord<dayl1ght> can I have requiresInit on my whole project by default?
07:02:49leorize{.push requiresInit.}
07:02:50FromDiscord<dayl1ght> or in a whole file
07:03:06leorize`{.push requiresInit.}`
07:03:11leorizeadded formatting for discord :P
07:03:14FromDiscord<dayl1ght> thanks! time to update all my files :p
07:03:30leorizeI wouldn't recommend spamming that all over the place
07:03:50*kradnoel joined #nim
07:03:55Yardanicoleorize: https://github.com/nim-lang/Nim/pull/14517
07:03:56disbotDisable unused warnings for await in async macro
07:04:08Yardanicoah maybe I didn't have to do it for the first template
07:04:18Yardanicocoz it's a template to catch errors
07:04:44FromDiscord<dayl1ght> leorize: why not?
07:05:00bungstill cant get the point, A() also init its all fields doesnt it ?
07:05:27leorize@dayl1ght the empty state is an useful default state to have
07:05:38leorizeusually I design my structures so that the default state have meanings
07:05:39FromDiscord<dayl1ght> right
07:05:47leorizeunless that's just wrong
07:05:55FromDiscord<dayl1ght> I guess for object variants it makes more sense to use requireInit
07:06:02Yardanicobung: it's about explicit initialization
07:06:13Yardanicoso you'll _have to_ explicitly initialize all fields
07:06:15Yardanicoyourself
07:07:21FromDiscord<dayl1ght> yeah I prefer that too. if you use empty states a lot you can have a proc that returns that. but I see your point
07:07:23Yardanicowait
07:07:31bungoh , got that, so that will not initialize with default value
07:07:36Yardanicoleorize: I think I can't do that for templates lol
07:07:42Yardanicoah nvm I just used the wrong pragma
07:07:54Yardanicoguess I should not stay awake for a long time
07:08:07leorizeI'm pretty sure you can, since I added a bunch to make `norm` stop printing a bunch of hint
07:08:25YardanicoI for some reason typed "{.pure.}" without looking at what I'm typing :P
07:10:07leorize@dayl1ght I'd recommend that you write Nim without trying to imitate the flow from other languages
07:10:28FromDiscord<dayl1ght> I just found out that
07:10:31FromDiscord<dayl1ght> ``` ↵{.experimental: "codeReordering".}↵{.push requiresInit.}↵```
07:10:32FromDiscord<dayl1ght> is broken
07:10:41FromDiscord<dayl1ght> .push needs to be before the expeirmental line
07:10:56leorizethere's a reason why experimental is experimental :P
07:12:31leorizeiirc we have an issue open for that
07:12:42leorize!issues codeReordering
07:12:43disbothttps://github.com/nim-lang/Nim/issues/14308 -- 3Experimental code reordering does not work on macro generated content
07:12:43disbothttps://github.com/nim-lang/Nim/issues/14290 -- 3Experimental code reordering has issues with pragma
07:12:43disbothttps://github.com/nim-lang/Nim/issues/10867 -- 3code reordering edge case 7& 2 more...
07:13:28FromDiscord<dayl1ght> leorize: I just think that not using requiresInit opens you up to bugs that are easily avoidable
07:13:38FromDiscord<dayl1ght> the X() case makes sense, but what about objects with many fields?
07:13:44FromDiscord<dayl1ght> you might forget to write one of the fields
07:14:13FromDiscord<dayl1ght> by X() I meant the empty state
07:14:38*sagax quit (Ping timeout: 260 seconds)
07:15:13bungam wondering can I give a default value to type's field
07:15:37leorizethat's a fair point
07:15:48leorizeI wish that {.requiresInit.} can be applied per-object
07:15:54leorizeper-proc/var
07:15:59Yardanicobung: not yet
07:16:02Yardanico!rfc default
07:16:02disbothttps://github.com/nim-lang/RFCs/issues/126 -- 3Support default values for object properties 7& 29 more...
07:16:19*brainbomb quit (Ping timeout: 256 seconds)
07:16:22*brainbomb1 joined #nim
07:16:24leorizeattaching `{.requiresInit.}` to a type is inflexible imo
07:16:35leorizeonly able to attach*
07:16:36FromDiscord<dayl1ght> can't you do that push and pop?
07:16:41FromDiscord<dayl1ght> although a bit verbose
07:16:46leorizenah
07:17:06leorize`{.requiresInit.}` have no meaning in a proc def, so it's not applied
07:17:31FromDiscord<dayl1ght> ohh yeah it would only applies for objects defined inside the push scope I suppose?
07:17:35leorizeyea
07:17:50FromDiscord<dayl1ght> and what you want is that objects used inside the push scope behave as if they have the requiresInit annotation
07:18:02FromDiscord<dayl1ght> yeah that would be nice
07:18:05leorizeyea, it'd be much more useful
07:18:07*brainbomb joined #nim
07:18:08leorizeI don't need it all the time
07:18:10*kradnoel quit (Remote host closed the connection)
07:18:11leorizejust sometimes
07:18:47*kradnoel joined #nim
07:19:22leorizeto be fair it might not be that hard to implement this :P
07:19:34leorizebut probably should write an rfc first
07:20:51*brainbomb1 quit (Ping timeout: 256 seconds)
07:21:45FromDiscord<dayl1ght> are there any plans to add inference of effects (thinking specifically of `raises` here)?
07:21:54leorizethat's already a thing
07:22:03Zevvc
07:22:33Yardanicop
07:22:35Yardanicos
07:22:44Zevvdude, no, it was supposed to be /c to clear my terminal
07:22:53Yardanicolol
07:23:45*kradnoel_ joined #nim
07:24:37FromDiscord<dayl1ght> leorize: huh that's weird
07:24:56leorizeso what are you having trouble with?
07:25:10FromDiscord<dayl1ght> I'm pretty sure I was forced to add .raises to all functions before
07:25:17bunghmm I read the rfc, thought may just allow CT default value
07:25:19FromDiscord<dayl1ght> but now I can't reproduce it
07:25:23FromDiscord<dayl1ght> maybe it's the nim 1.20 update
07:25:34leorizethat has been the case since 0.18
07:25:52leorizeor maybe even earlier
07:26:16leorizethe auto inference was a talking point in 4raq's early talks about Nim
07:26:18*kradnoel quit (Ping timeout: 256 seconds)
07:26:41leorizethough `{.tags.}` might go away in the future
07:28:07*Trustable joined #nim
07:28:11FromDiscord<dayl1ght> hmmm
07:29:44FromDiscord<dayl1ght> I'm getting weird errors but I can't write a minimal reproduction case
07:29:51FromDiscord<dayl1ght> I'll play with it a bit more
07:30:12leorizetry removing codeReordering
07:30:22FromDiscord<dayl1ght> then my whole project breaks :p
07:30:33bungno dont do that
07:30:33leorizethat feature is broken atm
07:30:51FromDiscord<dayl1ght> so the error that I'm getting is
07:30:58leorizealso you really don't want codeReordering if you ever write macros
07:31:00FromDiscord<dayl1ght> proc `outer()` calls `inner`
07:31:07FromDiscord<dayl1ght> `outer` declares exceptions [X, Y]
07:31:21FromDiscord<dayl1ght> if I change inner to raise Z, I get an error that Z is not listed anywhere
07:31:32FromDiscord<dayl1ght> even though `inner` doesn't have any `raises` pragma
07:31:42leorizeit's in the scope of outer()
07:31:49FromDiscord<dayl1ght> I get that error on `inner` , not `oute`
07:31:52FromDiscord<dayl1ght> `outer` *
07:32:11bungif I want patch some lib, I dont want move existed things
07:32:22FromDiscord<dayl1ght> I'm trying to get a minimal reproduction
07:33:13FromDiscord<dayl1ght> ah
07:33:20FromDiscord<dayl1ght> `choosenim 1.2.0` fixed it 😛
07:34:27*brainbomb quit (Ping timeout: 272 seconds)
07:39:02FromDiscord<dayl1ght> DrNim looks really nice, I should start using it
07:39:12Yardanicodon't confuse it with design by contract though :)
07:39:18Yardanicoand it's still in experimental stage afaik
07:39:46FromDiscord<dayl1ght> yup. it's better than design by contract 🙂
07:40:06FromDiscord<dayl1ght> proving things at compile time > testing at runtime 🙂
07:41:13leorizeit's really slow though :P
07:42:09*kradnoel_ quit (Remote host closed the connection)
07:45:19Zevvit's only sunday morning, who cares
07:45:57*sagax joined #nim
07:48:39*tdc joined #nim
07:51:05FromDiscord<Zed> Is there an official indent size for nim?
07:51:27FromDiscord<Rika> 2 spaces
07:52:17FromDiscord<Zed> phew, that's what im just reformatting my code to now
07:52:24FromDiscord<Rika> you can use nimpretty for that
07:52:39Yardaniconimpretty also has support for reindenting
07:52:43Yardanicoye as Rika said
07:54:36FromDiscord<Zed> what line length do you guys use?
07:54:57Yardanicowell most of people try to use less than 80
07:55:01Yardanicothat's the official limit :P
07:55:07Yardanicobut in rare cases it's okay to go over that I guess
07:55:52FromDiscord<Zed> does it fill up fast? i read a thread the other day on reddit about line length and people were complaining about how 80 is not enough for python because of indentation
07:56:05Yardanicoyeah I saw that thread, but it doesn't fill up fast really
07:56:10Yardanicothat thread talked about context managers
07:56:11Yardanicoclasses
07:56:13Yardanicoand stuff like that
07:56:23Yardanicosince nim has UFCS you don't need classes - that's already one less level of indentation
07:56:33FromDiscord<Rika> also we use 2 and not 4 spaces 😛
07:56:35YardanicoI mean you don't need to define everything under a "class" section
07:56:38Yardanicoyeah that too
07:56:41FromDiscord<Elegant Beef> And no name spaces
07:56:42FromDiscord<Rika> there's significant savings there
07:56:56Yardanico5 indentation levels is 20 spaces in python but 10 in nim by default
07:57:11Yardanicoi mean you can do 2-space indent in python fine too
07:57:13Yardanicoor 1-space indent
07:57:46FromDiscord<Zed> so it's basically no different to normal formatted braces code
07:58:03Yardanicowell yeah, people indent code even with braces :D
07:58:21FromDiscord<Elegant Beef> Yea that's why i dont get the "oh it has significant white space" complaint
07:58:36FromDiscord<Elegant Beef> 99% of the time your code will be indented the same way
07:59:18Prestigetbh I'd like if I could use braces in nim
07:59:24Yardanicono
07:59:24*Prestige ducks
07:59:24FromDiscord<dayl1ght> ^
07:59:29Yardanicothey were there but were removed
07:59:34Yardanico(braces syntax skin)
07:59:43Yardanicoand as I said just make a transpiler based on that code if you really want it
07:59:48FromDiscord<dayl1ght> indentation based syntax makes correct auto formatting impossible
08:00:38FromDiscord<Elegant Beef> If you're in a block and the code is indented to deep move it to that one else leave it at the current indent
08:00:47FromDiscord<Elegant Beef> Nim pretty exists
08:00:49PrestigeI've accidentally put code at the wrong indentation level a few times and it took forever to figure out why my code wasn't working. Was very annoying
08:00:52FromDiscord<Rika> why are you programming with wrong indentation
08:01:13FromDiscord<dayl1ght> and it also makes it hard to copy paste code from the internet
08:01:19FromDiscord<Zed> i've found indent rainbow to be super helpful for those things, Prestige
08:01:25bungdont copy paste then
08:01:35FromDiscord<dayl1ght> that's just avoidingn the problem
08:01:38PrestigeI'll have to look that up @Zed
08:01:40Prestigehopefully it helps
08:01:47Yardanicowell the thing is @dayl1ght
08:01:49Prestigebut a transpiler for curley brackets sounds very nice...
08:01:53Yardanicobraces were there as a syntax skin
08:01:53*brainbomb joined #nim
08:01:56Yardanicobut nobody liked them
08:02:04Yardanicoand they were removed because there's a real maintenance cost
08:02:05FromDiscord<mratsim> @zevv @Araq, interesting bench and discussions on Rust futures overhead vs what seems to be continuation passing style: https://github.com/newpavlov/fsm-bench
08:02:10FromDiscord<Elegant Beef> My only real complaint is lack of native tab support 😄
08:02:18Yardanicouse that magic source code filter
08:02:23FromDiscord<Elegant Beef> Yea i know
08:02:26FromDiscord<dayl1ght> Oh I'm not saying nim should change now
08:02:51FromDiscord<Zed> can nim pretty format entire directories?
08:03:12FromDiscord<Rika> you can make it
08:03:21Yardanico"nimpretty src/*.nim"
08:03:24FromDiscord<Rika> use the globbing patterns
08:03:53FromDiscord<Zed> duh
08:05:50FromDiscord<dayl1ght> with braces, I could copy paste code from the internet, have it all broken and `nimpretty` would be able to fix it
08:06:02FromDiscord<dayl1ght> (broken in regards to indentation)
08:06:44Prestigevisually lining up lines just doesn't go well for me
08:07:04FromDiscord<dayl1ght> whereas with indentation based syntax it's simply impossible to auto format broken code
08:07:34FromDiscord<Elegant Beef> Prestige how many spaces do you use for indents?
08:07:39Prestige2
08:07:49FromDiscord<dayl1ght> there are also other tooling disadvantages
08:07:56FromDiscord<dayl1ght> e.g. editors have jump to matching brace
08:08:09FromDiscord<Rika> jump to end of block
08:08:18FromDiscord<Rika> i dont see how "jump" is an argument
08:08:41FromDiscord<dayl1ght> how do I do that in vscode?
08:08:55FromDiscord<Rika> maybe fold the block and press down
08:09:00FromDiscord<dayl1ght> exactly
08:09:03FromDiscord<Zed> could you copy/paste nim code with braces and configure nimpretty to format and delete the braces?
08:09:04FromDiscord<dayl1ght> I'm not saying it's impsosible
08:09:10FromDiscord<dayl1ght> to implement
08:09:12FromDiscord<Rika> go make the skin then
08:09:18FromDiscord<dayl1ght> just that most editors don't support it by default
08:09:40FromDiscord<Rika> man you dont need to convince us that its worse for you
08:09:47FromDiscord<Rika> we dont need convincing
08:09:57FromDiscord<Rika> zed: i dont think so, no
08:10:00FromDiscord<dayl1ght> not trying to convince anyone ¯\_(ツ)_/¯
08:10:19FromDiscord<Rika> you can do it with source code filters but they'd be nonfunctional to nimpretty
08:10:26FromDiscord<Rika> so you'd need your own formatter
08:10:34FromDiscord<Rika> day: then what are you trying to do
08:11:09FromDiscord<dayl1ght> there was a discussion about braces/indentation-based syntax. I'm just commenting on it.
08:12:09FromDiscord<Rika> ok i seem to have gotten lost then
08:14:26Prestigewould be cool if we could just write something that ignores the curly brackets, so I could write them without it affecting anything
08:14:35FromDiscord<Elegant Beef> I do have to laugh at the "Some people dont think line width of 80 is enough cause of indention", whilst i use 8 space tabs on C#
08:14:36FromDiscord<Rika> source code filterrrrrrrr
08:14:50FromDiscord<Rika> https://nim-lang.org/docs/filters.html
08:14:53FromDiscord<Zed> why @Elegant Beef ?
08:14:59FromDiscord<Zed> 8 spaces is massive
08:15:03Yardanico@Rika I don't think it'll be possible to do it with filters
08:15:05FromDiscord<Rika> why not
08:15:13FromDiscord<Rika> Yardanico: why?
08:15:17FromDiscord<Rika> ah
08:15:19FromDiscord<Rika> i see
08:15:19Yardanicocoz you can't define custom filters
08:15:25FromDiscord<Rika> no no
08:15:29FromDiscord<Rika> theres another issue i thought of
08:15:37FromDiscord<Rika> you wouldnt be able to use set sytax
08:15:39FromDiscord<Rika> (edit) 'sytax' => 'syntax'
08:15:45Yardanicowhy?
08:15:49Yardanicoit was possible with syntax skins
08:15:52Yardanicowith braces skin
08:16:03FromDiscord<Rika> i mean for custom filters
08:16:03FromDiscord<Elegant Beef> Cause i like wide indents
08:16:15*brainbomb1 joined #nim
08:16:20FromDiscord<Zed> well you could define the minimum number of characters between the braces for the filter to format
08:18:09FromDiscord<Zed> so if there are 10 characters between the braces, that set of braces is ignored
08:19:44*neceve joined #nim
08:19:54*brainbomb quit (Ping timeout: 240 seconds)
08:20:16FromDiscord<Rika> not foolproof
08:24:26*zacharycarter joined #nim
08:26:53*brainbomb joined #nim
08:27:27*dadada joined #nim
08:27:49*dadada is now known as Guest71686
08:28:17*brainbomb1 quit (Ping timeout: 272 seconds)
08:28:55*zacharycarter quit (Ping timeout: 265 seconds)
08:30:45FromDiscord<Recruit_main707> someone should proably add this to the supported IDE's page https://github.com/itmuckel/nimtellij
08:31:25FromDiscord<Recruit_main707> it uses the nimlsp, which is nice
08:31:44*idf joined #nim
08:33:05Prestigenimlsp needs some work D:
08:33:19Yardanicowell you can contribute
08:33:22Yardanicoit's based on nimsuggest btw
08:33:52FromDiscord<Recruit_main707> nimlsp, or the intellij plugin
08:34:02Yardanicoi replied to prestige
08:34:07FromDiscord<Recruit_main707> ok
08:34:54Prestigeyeah I plan on contributing once I get my wm to beta
08:35:03Prestigewhich shouldnt be too long I hope
08:37:35PrestigeWould've been tomorrow (today?) but I have to write my own status bar
08:38:24FromDiscord<Recruit_main707> can you guys think of a way to make this function work with complex types? (lets take a vector3 for instance)↵`Something` its just `SomeInteger | bool` for now↵https://play.nim-lang.org/#ix=2nUn
08:38:34FromDiscord<Rika> complex?
08:38:42FromDiscord<dayl1ght> small thing I'd like to contribute is to have the VSCode extension show types on hover
08:39:02FromDiscord<dayl1ght> right now it shows types only for usage, not definitions
08:39:03FromDiscord<Rika> @Recruit_main707 use a concept LOL
08:39:14FromDiscord<Recruit_main707> time to google
08:39:22FromDiscord<Rika> its in manual_experimental
08:41:07FromDiscord<Recruit_main707> i dont see how can this help
08:41:25*Trustable quit (Remote host closed the connection)
08:41:44Yardanico@dayl1ght wdym types on definitions?
08:42:04Yardanicovscode-nim-lsp shows me definitions everywhere
08:42:12Yardanico(it's a vscode extension by bung which uses nimlsp)
08:42:27FromDiscord<Recruit_main707> he probably means the "default" or most used one
08:42:36Yardanicoi know, I just said as a reference
08:42:40bungI just need one more feature , formating thing.
08:43:07FromDiscord<dayl1ght> Yardaanico: like let x = newSeq[int]()
08:43:09bungother parts seems good to me , the extension
08:43:12FromDiscord<Recruit_main707> @Rika i really cannot see it, can you tell me how?
08:43:20FromDiscord<dayl1ght> it only shows the type of x if you hover on something like `echo x`
08:43:25Yardanico@dayl1ght and what type there? x?
08:43:32Yardanicooh i see then
08:43:43bungcontrol hover
08:43:47livcdPrestige: do you plan to write something like a lemonbar?
08:43:54FromDiscord<Rika> https://nim-lang.org/docs/manual_experimental.html↵ctrl+f "concept"
08:43:57Yardanicobung: that's now what they wants
08:43:58FromDiscord<dayl1ght> control hover doesn't do it for me
08:44:00FromDiscord<Rika> @Recruit_main707 ^
08:44:09bungyeah
08:44:13FromDiscord<Recruit_main707> ye, i have already reached that :P
08:44:13Yardanicobung: in "let kk = 1" they want to hover over kk to get the type of "kk"
08:44:33livcdi use explicit types :X
08:44:43FromDiscord<dayl1ght> 😮
08:44:53bunghmm let me see
08:45:40bungit works,by hover ,control + hover
08:45:41FromDiscord<Rika> @Recruit_main707 then you make a concept that makes sure "n.uint8" works
08:46:19bungnothing else need to be shown I thought
08:46:50livcddoes VSCode has something like aggressive indentation?
08:46:52FromDiscord<dayl1ght> bung: does it show `int` for you? in `let kk = 1`
08:48:07FromDiscord<Recruit_main707> Rika: i am not sure if you understood what i meant, i was thinking of a way to accept user defined types (such as a vector3, of 3 floats)
08:49:20bungoh , implicit type , that's the problem
08:49:54Yardanicoyes
08:49:58FromDiscord<Recruit_main707> so that it runs that function with each field of the type (as a possible solution)
08:50:15FromDiscord<Rika> eh? why?
08:50:24*brainbomb1 joined #nim
08:50:41FromDiscord<Rika> not easily i dont think
08:51:08FromDiscord<Rika> you need to make another proc that calls the original proc per field
08:51:28bungcontorl + hover shows whole expression , seems not a big problem.
08:51:54FromDiscord<Recruit_main707> could it overload WriteVal, possibly by specifying the generic as [not Something]?
08:52:33FromDiscord<dayl1ght> yeah, the way I work around it right now is just adding `echo x` and hovering over `x`
08:52:45FromDiscord<Rika> use `object` instead
08:52:59*brainbomb quit (Ping timeout: 272 seconds)
08:52:59FromDiscord<Rika> to ensure you dont take in a non-number primitive
08:53:10FromDiscord<Recruit_main707> ok
08:53:11FromDiscord<dayl1ght> I'll look into vscode-nim's source code, hopefully it's easy to change
08:55:16FromDiscord<Recruit_main707> How can i acess the number and type of the fields of an object? can it be done from within a proc?
08:55:24bungI want wrap os.nim to nodejs , seems most procs I need wrap around proc not inside it
08:55:37Yardanicobung: you can do that too
08:56:08bungam not sure the pragma will affect what
08:56:11Yardanico?
08:56:15Yardanicoyou usually use stuff like
08:56:15bung`{. noSideEffect, rtl, extern: "nos$1".}`
08:56:17Yardanicowhen defined(js):
08:56:30Yardanicobung: you don't need rtl or extern for js I guess, not sure
08:56:37FromDiscord<Rika> @Recruit_main707 https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT
08:57:05bungso I need use `when` uppon it
08:57:15FromDiscord<Recruit_main707> thanks Rika
08:57:18Yardanicooutside of the proc yes bung
08:57:29bungok ,Thanks!
08:57:31Yardanicoyou can also do it inside
08:57:36Yardanicojust check how much code can you share or stuff
08:59:07bungI guess less than 20%
09:00:08bungand another thing I worried , what about exceptions
09:02:18*dddddd joined #nim
09:07:38FromDiscord<dayl1ght> anyone familiar with `nimsuggest` in `stdin` mode?
09:08:16FromDiscord<Rika> prolly leorize 😛 but i dont know
09:11:28FromDiscord<dom96> 'morning
09:11:41FromDiscord<Elegant Beef> Hello
09:56:48bungthe os.nim should work with nodejs
09:57:19bungbut it declare `this proc is not available on the NimScript target` globally
09:57:20FromDiscord<Rika> nodejs support is poor right now
09:57:57FromDiscord<Rika> theres no distinction right now for nodejs and js target (rather there are no when statements for nodejs)
09:58:00*Vladar joined #nim
09:58:01bungas it call system api, dont know why declare it as that
09:58:18FromDiscord<Rika> (edit) 'are' => 'is' | 'when statements' => 'code in os'
09:59:30bungoh, I realize jsgen only generate language level code..
10:02:13Yardanicodisruptek: replied about your arc bug in telegram
10:05:40FromDiscord<dayl1ght> can I rename imports without introducing everything into scope?
10:05:52FromDiscord<dom96> Why do you want to use Nim with nodejs?
10:05:59FromDiscord<dayl1ght> e.g. `import terminal as t` gives me `t.styledWrite`, but `styledWrite` also works
10:06:24FromDiscord<dayl1ght> I can do `from terminal import nil` but that doesn't allow me to rename the impotr
10:06:24FromDiscord<Recruit_main707> from terminal as t import nil maybe works
10:06:33FromDiscord<dayl1ght> ah awesome
10:06:35FromDiscord<Recruit_main707> but its ugly af
10:06:42Yardanicobecause you shouldn't do that :P
10:06:44FromDiscord<Rika> then you lose UFCS too lol
10:06:51FromDiscord<dayl1ght> Yeah I lose UFCS
10:07:14FromDiscord<dayl1ght> but I won't be using this too much so idc
10:07:17Yardanicoand then you write C
10:07:23FromDiscord<dayl1ght> all my other imports are qualified
10:07:24Yardanico@dayl1ght that's a mistake :)
10:07:29YardanicoUFCS in nim is really used everywhere
10:07:36FromDiscord<dayl1ght> I don't use `import x`
10:07:43FromDiscord<dayl1ght> always `from x import ...`
10:07:48FromDiscord<Rika> ok
10:07:49Yardanicowell then your code probably looks really verbose
10:07:52FromDiscord<Rika> you do you really
10:07:59FromDiscord<dayl1ght> verbose why?
10:08:10FromDiscord<Rika> because you dont have ufcs and qualify all imports
10:08:13Yardanico^
10:08:14FromDiscord<dayl1ght> no
10:08:19FromDiscord<dayl1ght> I'm only qualifying terminal
10:08:29FromDiscord<dayl1ght> for other imports I import the procs individually
10:09:15FromDiscord<dayl1ght> e.g. from strutils import strip, split, etc
10:09:27FromDiscord<Rika> well thats fine really
10:09:32FromDiscord<Rika> its your code anyway
10:09:38Yardanicotrue that
10:09:43FromDiscord<Rika> unless this is on a repo 😛
10:09:47FromDiscord<Rika> github repo i mean
10:09:51FromDiscord<dayl1ght> it will be :p
10:09:53FromGitter<bung87> @dom96 some lib seems useful , I also want to use it in js
10:09:54Yardanicoohno
10:10:07FromDiscord<dayl1ght> oh no is my reaction when I see `import strutils` :p
10:10:21FromGitter<bung87> and I want compile nimpretty to js these days
10:10:24FromDiscord<Rika> and oh no is our reaction when we see `import nil`
10:10:30Yardanicoor "from x import stuff"
10:10:35FromDiscord<dayl1ght> I don't do import nil!
10:10:35Yardanicowhen it's used everywhere :P
10:10:43FromDiscord<Rika> you just did for terminal did you not
10:10:49FromDiscord<dayl1ght> one time 🙂
10:10:53Yardanicocmon, it's 2020, we have editors with easy go to definition or hover
10:10:55FromDiscord<dayl1ght> from x import stuff for other things
10:11:02FromDiscord<dayl1ght> github doesn't have go to definition
10:11:03FromDiscord<dayl1ght> nor does cat
10:11:04FromDiscord<Rika> but that means "i dont do import nil" is false
10:11:16FromDiscord<Rika> why use cat then lol
10:11:26FromDiscord<dayl1ght> sometimes it's useful
10:11:38Yardanicowell I mean for me it's not an issue since I remember quite a lot of stdilb procs :P
10:13:12FromDiscord<dayl1ght> editor support goes the other way
10:13:26FromDiscord<dayl1ght> many editors automatically add the right imports for you
10:13:49FromDiscord<dayl1ght> like you type `str.add<TAB>` and it does `from strutils import split`
10:13:58FromDiscord<dayl1ght> oops, str.split<TAB>
10:14:07FromDiscord<Rika> interesting editor support there
10:14:14FromDiscord<Rika> i always add my imports manually lol
10:14:15Yardanicowell with no need to qualify by default that's not a big problem really
10:14:30Yardanicojust "import strutils" for all string procs
10:15:06FromDiscord<dayl1ght> I mean with that you get the best of both worlds :p no time wasted typing out imports
10:15:21YardanicoI don't spend that much time typing out imports
10:15:23FromDiscord<dayl1ght> and betterreadability for cases where you don't have an IDE (e.g. reading code on github)
10:15:56Yardanicoblame github for not having proper nim go to definition support :)
10:16:06Yardanicothey do it for some languages
10:16:26FromDiscord<dayl1ght> i doubt they will ever support nimgrep :p
10:16:46Yardanicowe can make a PR
10:16:46Yardanicohttps://github.com/github/semantic
10:16:48FromDiscord<dayl1ght> but nim go to definition would be nice
10:17:13Yardanicobut i wont write in haskell
10:17:36FromDiscord<dayl1ght> LOL
10:17:52FromDiscord<dom96> Haskell is nice 🙂
10:18:34FromDiscord<dayl1ght> something something monoid in the category of endofunctors
10:20:18*sagax quit (Remote host closed the connection)
10:24:20*zacharycarter joined #nim
10:28:00FromDiscord<Rika> dom: why dont you add the support then 😛
10:28:32*zacharycarter quit (Ping timeout: 246 seconds)
10:33:10FromDiscord<dayl1ght> Is there some example of custom pragmas? I want all my code to have `{.requiresInit.}`, so I'm doing `{.push requiresInit.}` at the top of my files
10:33:40FromDiscord<dayl1ght> but now I'd like to have some specific fields where I don't need {.requiresInit.}, is it even possible to do that/write a pragma for it?
10:34:04Yardanicowell it should be, but it's not that simple
10:34:08Yardanicoyou'll have to write a macro :)
10:34:41FromDiscord<dayl1ght> ok so _it's possible_
10:34:47Yardanicoyeah of course
10:35:13Yardanicosee e.g. how pragma annotations are used there https://github.com/status-im/nim-json-serialization/blob/master/tests/test_serialization.nim#L8
10:35:26*neceve quit (Remote host closed the connection)
10:35:57*luis_ joined #nim
10:36:02*Guest71686 quit (Ping timeout: 265 seconds)
10:36:39luis_Hi all, I need to calculate a root above the cubic base... is there a math module supporting roots of any case?
10:36:44FromDiscord<dayl1ght> looks like dontserialize comes from the stdlib?
10:36:54luis_the base math goes up to cubic only
10:37:10FromDiscord<dayl1ght> oh it's from nim-serialization
10:37:15Yardanicoyep
10:37:21Yardanicoluis_: isn't root just pow with < 1 ?
10:38:39luis_sorry if this is a ridiculous question, what is the syntax for power in Nim?
10:38:53FromDiscord<Recruit_main707> ^ i think
10:39:02FromDiscord<Recruit_main707> but its in the math module iitc
10:39:05Yardanicoyes
10:39:17Yardanico!eval import math; echo pow(8, 1/3)
10:39:20NimBot2.0
10:39:26Yardanicocubic root :P
10:39:28FromDiscord<Rika> pow for float, ^ for int
10:39:35luis_yep, that is what i need
10:39:37luis_thanks
10:44:37FromDiscord<dayl1ght> huh, weird. this code https://play.nim-lang.org/#ix=2nV5 gives me an error in vscode, but it compiles fine
10:44:43FromDiscord<dayl1ght> not sure if it's a bug in nimsuggest or the vs code extension
10:45:00Yardaniconimsuggest
10:45:32Yardanicoactually hmm, I think I might try to fix that later
10:45:48Yardanicofor some reason nimsuggest treats "template/generic instantiation from here"" intermediate message as an error
10:45:59Yardanicosee https://gist.github.com/Yardanico/9aa9ee5320a9e9b422ee1b7b04ebd173
10:46:06Yardanicofor your code example
10:47:23FromDiscord<dayl1ght> ah so it's a problem in parsing the compiler output?
10:47:34Yardaniconimsuggest isn't parsing the compiler output though :P
10:47:39Yardaniconimsuggest itself uses compiler as a library
10:47:45FromDiscord<dayl1ght> ah ok
10:48:05FromDiscord<dayl1ght> well since you know how to use `nimsuggest`'s stdin mode, how do I use `def`? :p
10:48:13FromDiscord<dayl1ght> I was trying to do `def file.nim line column`
10:48:17FromDiscord<dayl1ght> but don't get anything back
10:48:29Yardanicoidk def too, I learned "chk" from PMunch (creator of nimlsp) :P
10:49:37FromDiscord<dayl1ght> it seems like `def` is what VSCode uses on hover
10:49:40FromDiscord<dayl1ght> https://github.com/pragmagic/vscode-nim/blob/master/src/nimHover.ts#L24-L25
10:49:46Zevvhmm, I think I hit a wall already, cps-wise
10:49:55Zevvthere's just not enough info avaible when doing this with macros
10:49:58FromDiscord<dayl1ght> and because of these lines I assume that nimsuggest doesn't return the type when hovering over `let kk = 1`
10:50:04FromDiscord<dayl1ght> oops, when calling `def`
10:50:20bungdayl1ght its not split by space
10:50:49FromDiscord<dayl1ght> file.nim:<line>:<column>?
10:53:14bunghmm I also need check source code.. but not space that I remenber
10:53:37*lritter quit (Ping timeout: 264 seconds)
10:57:46bungguess check vscode-nim that's easier , I give up searching nim source..
10:58:13FromDiscord<dayl1ght> I was reading it too
10:58:30FromDiscord<dayl1ght> apparently it works with spaces
10:58:36FromDiscord<dayl1ght> I was just giving the wrong file name lol
10:58:48FromDiscord<dayl1ght> and wrong line number (0 instead of 1)
10:58:53bungoh, my bad
10:59:17FromDiscord<dayl1ght> if you don't give it the right filename + line number + column combination it doesn't print anything
11:00:11FromDiscord<dayl1ght> no problem, thanks for helping 🙂
11:02:25FromDiscord<dayl1ght> oh, so it does look like nimsuggest doesn't give the type when hovering definitions:
11:02:30FromDiscord<dayl1ght> https://ghostbin.co/paste/xy88k
11:03:43bunghttps://github.com/pragmagic/vscode-nim/blob/master/src/elrpc/elrpc.ts#L68 here I found it
11:05:21FromDiscord<dayl1ght> yeah, I think that's the syntax for the emacs RPC thing it uses
11:05:36FromDiscord<dayl1ght> but for nimsuggest --stdin it accepts a different format
11:05:45Yardanicowell --stdin is only for debug really
11:05:57FromDiscord<dayl1ght> yep
11:06:11FromDiscord<dayl1ght> now I'm trying to find where nimsuggest handles `def` requests
11:06:20FromDiscord<dayl1ght> to see why it's not sending the types for definitions
11:08:04Yardanicoyou can search for different places in the compiler with nimsuggest branches with "defined(nimsuggest)"
11:08:10Yardaniconimsuggest itself is in, well, "nimsuggest" directory
11:09:05FromDiscord<dayl1ght> ohh I was looking in numsuggest.nim
11:09:15Yardanicowell as I said nimsuggest uses the compiler as a library
11:09:20*brainbomb1 quit (Quit: Leaving.)
11:10:15FromDiscord<dayl1ght> right, it looks confusing to me because what it does there is call out to execute("def", filename, line, column)
11:10:31FromDiscord<dayl1ght> and execute doesn't really return anything, but it calls out to graph.compileProject
11:10:50Yardanicowell it's all in the compiler :P
11:12:15FromDiscord<Recruit_main707> why is there no swapEnidan universal function in endians
11:12:15Yardanicoalso compiler/suggest.nim
11:12:27FromDiscord<Recruit_main707> so that any size can be used
11:12:36Yardanicouse endians2 from nim-stew
11:13:02FromDiscord<Recruit_main707> i already implemented it :P↵but thx
11:16:40Yardanico@dayl1ght check symToSuggest in suggest.nim
11:16:56*luis_ quit (Ping timeout: 256 seconds)
11:17:21Yardanicotype is stored in result.forth
11:17:45FromDiscord<dayl1ght> https://github.com/nim-lang/Nim/blob/77834f0fdabc9d39cf111c4c94e717bd2c4f00d2/compiler/suggest.nim#L489-L490
11:17:48FromDiscord<dayl1ght> seems like these are the lines
11:18:03FromDiscord<dayl1ght> oh nvm
11:18:05FromDiscord<dayl1ght> thanks
11:18:44Yardanicoand the compiler itself doesn't have enough info for the symbol there
11:18:53Yardanicoit's just how it works
11:18:56Yardanicohttps://gist.github.com/Yardanico/4cb333deebbb5560cf69ed70e3f3b8af
11:18:57FromDiscord<dayl1ght> now I don't know where PSym comes from
11:19:04FromDiscord<dayl1ght> see, this is why we need from x import PSym :p
11:19:06Yardanicofrom compiler itself
11:19:23Yardanicoyou're not gonna easily add types there :)
11:19:35FromDiscord<dayl1ght> What's that gist you linked?
11:19:44Yardanicodebug output of the symbol node for "xs"
11:19:49Yardanicofrom "let xs = newSeq..."
11:19:56Yardanicothe compiler just doesn't attach the type to "xs" here
11:20:01FromDiscord<dayl1ght> hmm
11:20:14FromDiscord<dayl1ght> but it does _know_ the type I assume?
11:20:17Yardaniconot sure
11:20:21Yardanicothat's all we get
11:20:23Yardanicoso s.typ is nil
11:20:26FromDiscord<dayl1ght> right
11:21:00FromDiscord<dayl1ght> I'll look a bit more to see why s.typ is nil
11:21:15*zacharycarter joined #nim
11:27:16Yardanicoah well actually the compiler knows the type, yes
11:27:26Yardanicoi tried debugging newSymNode from ast.nim line 1221
11:27:46Yardanicoanyway it's not simple :P
11:28:49FromDiscord<dayl1ght> how are you debugging?
11:28:58Yardanico"debug" or "echo" :)
11:29:11Yardanicolike if sym.name.s == "xs": echo sym[]
11:29:13FromDiscord<dayl1ght> oh did you recompile the compiler?
11:29:16Yardanicono?
11:29:24Yardanicoyou don't have to since nimsuggest uses the compiler as a library
11:29:42Yardanicoso you can modify the compiler code and recompile nimsuggest
11:30:10FromDiscord<dayl1ght> I see
11:30:18FromDiscord<dayl1ght> that pretty much recompiles the whole compiler though, no? :p
11:30:33FromDiscord<dayl1ght> it takes a while to build nim in my laptop
11:32:57Yardanicosemstmts.nim line 333
11:33:06Yardanicothe thing is that it processes "xs" as an indent (which is correct, yes)
11:33:09Yardanicoand then gives a suggestion
11:34:22*dadada joined #nim
11:34:46*dadada is now known as Guest20166
11:34:59FromDiscord<dayl1ght> yardanico: how are you debugging?
11:35:03Yardanicoas I said
11:35:06Yardanicoecho and "debug" :)
11:35:08FromDiscord<dayl1ght> I've cloned nim, added a line to `ast.nim` in the line you said
11:35:12FromDiscord<dayl1ght> and recompiled nimsuggest with:
11:35:18FromDiscord<dayl1ght> `bin/nim c nimsuggest/nimsuggest.nim`
11:35:28FromDiscord<dayl1ght> then `nimsuggest/nimsuggest --stdin --debug myfile.nim`
11:35:38FromDiscord<dayl1ght> but I'm not getting my echos back
11:35:44FromDiscord<dayl1ght> oh nvm I'm stupid
11:35:52Yardanicoalso see https://nim-lang.org/docs/intern.html#debugging-the-compiler
11:41:16FromDiscord<dayl1ght> hmm `b compiler/semstmtst.nim:333` doesn't work in lldb 😦
11:41:27Yardanicodid you compile with --debugger:native ?
11:41:41FromDiscord<dayl1ght> I ran bin/nim c --debuginfo --linedir:on nimsuggest/nimsuggest.nim
11:41:49Yardanico--debuginfo is for C debug lines
11:41:56Yardanicoif you want to get nim source code lines you need --debugger:native
11:42:01Yardanicoalso --linedir:on is redundant here
11:42:09Yardanicosince you're compiling in debug mode anyway (not release/danger)
11:42:09FromDiscord<dayl1ght> kk, I'll try again
11:43:12FromDiscord<dayl1ght> worked now 🙂 thanks
11:43:25Yardanicoyou won't get pretty printed ast structure and stuff anyway :D
11:43:56Yardanicothere's nim-gdb to make gdb work for some nim name mangling, but nothing for lldb
11:45:10FromDiscord<dayl1ght> yeah debugging with lldb was one of the first things I tried when first using nim
11:45:25FromDiscord<dayl1ght> does nim-gdb support arbitrary nim expressions?
11:45:33Yardanicoof course not, how would it do that? :D
11:45:33FromDiscord<dayl1ght> i imagine it must be hard to add support for that
11:45:44FromDiscord<dayl1ght> I saw thta LLDB has an API to add support
11:45:52FromDiscord<dayl1ght> but maybe I misread it
11:46:01Yardanicoyes, there *is* a way to do that
11:46:08Yardanicolike apple has an lldb fork with repl for swift
11:47:03FromDiscord<dayl1ght> well I guess the answer to how hard it is is to diff apples fork and lldb and count the number of lines :p
11:48:03*konvertex joined #nim
11:48:05Yardanicoendb had some limited nim expression support
11:48:28Yardanicohttps://nim-lang.org/0.18.0/endb.html it's dead now though
11:48:38Yardanico(hence the doc for 0.18.0)
11:48:41FromDiscord<dayl1ght> looks like with python you can add support for custom formatting
11:48:47Yardanicoyes you can
11:48:51Yardanicolldb has a python api just like gdb
11:49:01FromDiscord<dayl1ght> but probably not nim expressions?
11:49:04Yardanicono :)
11:49:11Yardanicoit's a matter of time and script size :P but nim doesn't really have runtime type information in most cases
11:49:16FromDiscord<dayl1ght> that requires changing lldb internals I guess?
11:49:26Yardanicowell it's there for default GC and stuff, but it's going away with arc/orc which will become the default eventually
11:49:39FromDiscord<dayl1ght> hmm
11:49:54FromDiscord<Recruit_main707> arc hopefully, since orc is a "quickfix" to use async
11:49:58Yardanicouh no?
11:50:00Yardanicowtf
11:50:12Yardanicosometimes you *need* to have cycles in your program
11:50:19Yardanicoorc is not just made for async
11:50:58FromDiscord<Recruit_main707> oh, ok, its just that every time i heard of orc it came next to async
11:51:04FromDiscord<dom96> T R I G G E R E D
11:51:08YardanicoXD
11:51:43FromDiscord<dayl1ght> wait why would adding support for nim expressions require rtti? I'm thinking of things like `print "a,b,c".split(",")`
11:51:54Yardanico@dayl1ght I talked about pretty printing nim variables
11:51:59FromDiscord<dayl1ght> ah ok
11:52:04Yardanicoand the expressions themselves still will be hard to do
11:52:07FromDiscord<dayl1ght> yeah
11:55:24*luis_ joined #nim
11:55:25FromDiscord<dayl1ght> things like object variants probably could be pretty printed without RTTI
11:55:33FromDiscord<dayl1ght> but strings, seqs etc would require rtti I guess
11:55:38FromDiscord<Yardanico> No
11:56:07FromDiscord<dayl1ght> actually yeah, an object variant is still an opaque binary blob
11:56:10FromDiscord<Yardanico> strings and seqs aren't that complicated and nim-gdb supports them I think
11:56:16FromDiscord<dayl1ght> hmm
11:56:51FromDiscord<Yardanico> They're just an object with len, cap and the data itself in the raw C array (for the C backend)
11:57:21FromDiscord<dayl1ght> right
11:57:27FromDiscord<dayl1ght> but do you type `print_string` or just `print` ?
11:57:54FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/system/strs_v2.nim
11:58:39FromDiscord<dayl1ght> what I meant is
11:58:40FromDiscord<Yardanico> Check out https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py
11:58:50FromDiscord<dayl1ght> how does nim-gdb know that it's looking at a string
11:58:53livcdanyone deployed on an obscure platform?
11:59:14FromDiscord<Yardanico> @livcd depends on what your mean by that :D
11:59:23livcdmy most obscure platform is windows server 2008
11:59:26livcd:D
11:59:41FromDiscord<Yardanico> @dayl1ght you still have debug info from the C code
11:59:43FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py#L37
11:59:53livcdBut I am thinking along the lines of Nintendo Switch, HP-UX,AIX,Solaris etc
12:00:01*brainbomb joined #nim
12:00:15livcdbasically platforms where you *can't* use Go
12:00:24FromDiscord<Yardanico> Well I was able to run simple Nim programs easily on KolibriOS
12:00:37FromDiscord<Yardanico> os:any, arc, useMalloc, etc
12:00:53FromDiscord<Yardanico> Although that OS has a C library and it's x86
12:04:53Zevvlivcd: depends on what you call "obscure"
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:36*supakeen joined #nim
12:07:28livcdZevv: ahh you have those routers right
12:08:24*luis_ quit (Ping timeout: 272 seconds)
12:18:39Zevvno problem there
12:18:49ZevvI've run on almost anything with a C compiler lately
12:27:58*fredrikhr joined #nim
12:28:06FromDiscord<Yardanico> rust: "you can't just support almost any platform out there, that's illegal!" nim:"haha c compiler go brrrrr"
12:29:29FromDiscord<dayl1ght> anyone familiar with the compiler code knows what fileIndex in TLineInfo means?
12:30:30FromDiscord<dom96> @Yardanico haha, dare you to post that in r/nim 😛
12:30:42FromDiscord<dom96> or maybe we need a r/nimjerk ala rustjerk
12:36:19FromDiscord<willyboar> Do you want it in comic?
12:36:20FromDiscord<willyboar> 😛
12:36:50*Vladar quit (Quit: Leaving)
12:37:37zacharycartercool - imgui plugin is working - https://imgur.com/a/EsyXfhd
12:41:20zacharycarterof course now hot reloading breaks when I try to reload the app plugin - but I think I know why
12:44:18zacharycarteryay hot reloading works again!
12:50:59*zacharycarter quit (Ping timeout: 246 seconds)
12:52:51FromDiscord<dayl1ght> how print a string in lldb?
12:54:15FromDiscord<dayl1ght> ah, `print (char*) <string>->data`
12:55:48disruptekfileindex is an index into a list of files.
12:55:58FromDiscord<Rika> ?
12:57:06FromDiscord<dom96> The mitochondria is the powerhouse of the cell
12:57:16FromDiscord<Rika> water is wet
12:57:24*luis_ joined #nim
12:57:26disruptekclipper ships
12:57:36FromDiscord<Rika> shipper clips
12:57:43FromDiscord<dayl1ght> yeah, I was debugging the compiler and trying to find out where to use that index
12:58:00FromDiscord<dom96> hipper lips
12:58:05luis_Hi again, the function inDays from the times module returns an int64, but I need an int... how to cast?
12:58:08FromDiscord<dayl1ght> turns out it's `(lldb) print (char*)(c->graph->config->m.fileInfos[0]).data[fileIndex].shortName->data`
12:58:09FromDiscord<dayl1ght> 🙂
12:58:21FromDiscord<Rika> luis_ `theInt64.int`
12:58:31FromDiscord<Rika> day: damn, thats complicated
12:58:48FromDiscord<dayl1ght> I just want my vscode to show types on hover
12:58:56FromDiscord<dayl1ght> and now I'm debugging the internals of the nim compiler
12:58:58FromDiscord<dayl1ght> lol
12:59:01FromDiscord<Rika> lmao rip
12:59:10livcdYardanico: lol these memes
12:59:23disruptekthis is the wrong way to go about it.
12:59:26luis_works great, thanks
12:59:36FromDiscord<dayl1ght> disruptek: what is the right way?
13:00:28*brainbomb quit (Quit: Leaving.)
13:07:18*luis_ quit (Remote host closed the connection)
13:07:49*luis_ joined #nim
13:12:49*tdc quit (Ping timeout: 264 seconds)
13:15:05*haxscramper joined #nim
13:16:44*Senny joined #nim
13:26:35*luis_ quit (Ping timeout: 272 seconds)
13:27:11FromDiscord<willyboar> disruptek miss your streams
13:40:35*zacharycarter joined #nim
13:45:54*zacharycarter quit (Ping timeout: 240 seconds)
13:48:38FromGitter<zacharycarter> Meeee tooooo
13:56:58*filcuc joined #nim
14:09:26disruptekmy creditors say they miss my checks.
14:13:02*Senny quit (Ping timeout: 260 seconds)
14:13:32FromDiscord<willyboar> creditor sucks
14:13:44*filcuc quit (Ping timeout: 256 seconds)
14:14:48FromDiscord<willyboar> I hope more nim jobs open in the next years
14:15:30FromDiscord<willyboar> (edit) 'creditor' => 'creditors'
14:16:01*filcuc joined #nim
14:16:23*Guest20166 is now known as dadada
14:16:32dadadahi people
14:16:40dadadacase someString
14:16:47dadadaof "case1":
14:16:51dadadaof "case2":
14:17:13FromDiscord<Rika> ?
14:17:16dadadasay I want of "foobar" to be case insensitive for all cases
14:17:22dadadais there a simple way to do this?
14:17:31FromDiscord<Rika> make it lowercase 😛
14:17:40disruptekno, make it uppercase.
14:17:47FromDiscord<Rika> either works
14:17:48FromDiscord<Rika> ¯\_(ツ)_/¯
14:17:57dadadaoh my, I'm thinking entirely too complicated today
14:18:09FromDiscord<Rika> lmao thats fine
14:18:34dadadaI have used this exact technique hundreds of times ... what's wrong with me
14:19:04FromDiscord<Rika> brains work in mysterious ways
14:21:29*bjornroberg joined #nim
14:22:02Zevvmine does not work at all today
14:22:30FromDiscord<willyboar> dadada does moe supports nim-suggestions and this kind of futures?
14:24:10FromDiscord<willyboar> by the way onivim is very cool for inspirations
14:37:55dadadais there an intersection version of the in operator?
14:38:14dadadawhen I have to containers and I want to see if any of their elements are the same?
14:38:19dadadato=two
14:39:13dadadawillyboar: it's planned, there will be lsp support, so nimlsp will work
14:39:50dadadawillyboar: onivim looked enticing to me, hopefully moe will take inspiration from everything that is good
14:43:39FromDiscord<Rika> dadada: for sets, yes
14:50:51*narimiran joined #nim
14:56:01disruptekset1 * set2
15:01:02*Senny joined #nim
15:17:49*bung_ joined #nim
15:20:47*bung quit (Ping timeout: 246 seconds)
15:21:07FromDiscord<Technisha Circuit> Is there a way to compile multiple nim files into one file?
15:21:27FromDiscord<Technisha Circuit> Or a entire Nim library into one file preferably
15:21:44FromDiscord<Technisha Circuit> Like Dimscord for example
15:21:49FromDiscord<Rika> why
15:22:07FromDiscord<Rika> use `include` instead of `import`
15:22:14*ftsf quit (Ping timeout: 240 seconds)
15:22:33FromDiscord<Rika> but all nim libraries that arent dynamically loaded are already compiled to one file so i dont understand what you mean
15:25:32FromDiscord<Technisha Circuit> I want to make Dimscord available for Python and it'll be ideal if i can compile it into one file for Python
15:26:05FromDiscord<Rika> ???
15:26:32FromDiscord<Rika> why do you want to make dimscord available for python when the costs of FFI might be just as high as using the actual python library
15:30:20FromDiscord<Technisha Circuit> I'm going to use Nimpy aswell and idk I'm bored
15:30:28FromDiscord<Technisha Circuit> Can you blame me for being bored af?
15:30:39FromDiscord<Rika> no but i can point out that what youre doing makes no sense
15:30:52FromDiscord<Technisha Circuit> Yuo
15:30:54FromDiscord<Technisha Circuit> Yup*
15:33:19FromDiscord<Recruit_main707> @itmuckel is your intellij support still actively developed?
15:38:54*PMunch joined #nim
15:50:31*waleee-cl joined #nim
15:59:05FromDiscord<KrispPurg> How would I convert an array of numbers to a byte string like in python `bytes([6, 6, 6])`? https://media.discordapp.net/attachments/371759389889003532/716682169854066689/unknown.png
16:02:00*nuxdie quit (Quit: Connection closed for inactivity)
16:06:54leorizeno procs for that, but you can easily write one
16:07:34leorizevar s: string; for i in <array of numbers here>: s.add chr(i)
16:07:45leorize`var s: string; for i in <array of numbers here>: s.add chr(i)` <- formatting for discord peeps
16:16:58*filcuc quit (Ping timeout: 258 seconds)
16:35:09*filcuc joined #nim
16:37:44FromDiscord<__ibrahim__> hello, noob question: when i write things like {.importc: "SDL_Init"} procs, where does nim look for required files (dlls)?
16:37:54disruptekcwd
16:38:16FromDiscord<__ibrahim__> but i have nothing in my cwd, and it just works
16:39:16disruptekyou're loading the system's shared lib, i guess.
16:39:41leorizewhen you write something like that, nim doesn't look :P
16:39:45PMunchWhen you do `importc` it just tells Nim that "this comes from C code, just keep the name like this and don't worry about the implementation" so it's up to what the C compiler does and the flags you pass it how they get into your program.
16:40:02disrupteklinux behavior of the dlopen is pretty lousy, honestly.
16:40:35FromDiscord<__ibrahim__> where are these paths defined?
16:40:44disruptekthey aren't; that's the problem.
16:40:53FromDiscord<__ibrahim__> i should say that i have vcpkg installed
16:41:14leorizewhen you only write `{.importc.}`, nothing happens
16:41:17leorizeyou need more than that
16:41:28FromDiscord<__ibrahim__> i love that it just works, but i want to know how
16:41:45FromDiscord<__ibrahim__> proc init*(flags: uint32): cint {.importc: "SDL_Init", dynlib: libName.}
16:41:59leorizeusually the libraries you use will use `{.dynlib.}`, which will tell Nim to use the system dynamic loader to load the specified library
16:42:13FromDiscord<__ibrahim__> const libname* = "libSDL2.dylib"
16:42:28disruptekoh, osx.
16:42:30FromDiscord<__ibrahim__> yes exactly, but im trying to find which dylib it's fetching
16:42:38FromDiscord<__ibrahim__> it should work on any os
16:42:56leorizeit's magic :)
16:43:08leorizethe system dynamic loader have a set of paths that it will try to look for
16:43:10FromDiscord<__ibrahim__> xD
16:43:19FromDiscord<Recruit_main707> you can do --nimcache:./cache and check the c code
16:43:41leorizeyou will only find dlopen() there :)
16:44:03leorizethe behavior is os-dependant
16:44:20FromDiscord<__ibrahim__> the only reason i want to know is that what if i want to add more dlls
16:44:44Zevvright. on linux check "man dlopen" for the rules how it finds your lib
16:44:52FromDiscord<__ibrahim__> on my current os, its kind of a mess coz i installed dlls from multiple sources, so i dont know which one it is fetching
16:44:52leorizeusually it's healthier to think "how can I reduce the amount of dll I have" :P
16:45:15leorizeosx have DYLIB_LIBRARY_PATH env var
16:45:21leorizeusually it looks via that
16:45:32leorizeif it's unset then it looks at the system folders
16:45:41leorizebut don't quote me on that, I don't use mac
16:46:06Zevvi love how araq is always cursing as a madman about linux dlls, distributions and packages. while in practice this has worked mostly just fine for me for the last 20 years
16:46:28FromDiscord<__ibrahim__> ok. how would you go about setting up a nim project that is dependent on some dlls
16:46:39leorizeZevv: well try to package a distribution, you will understand what he meant :P
16:46:55Zevvleorize: sure, but thats what debian is for, right :)
16:47:08leorizeactually, try to generate a binary nim package for linux that will run everywhere :P
16:47:32disruptekactually, the problem is that nim doesn't use the shared library semantics that we use just about everywhere else in the os.
16:47:34ZevvI dont, there is just debian.
16:47:58Zevvi know perfectly well what ar4q means, but I choose not to make it my problem :)
16:48:04leorize:P
16:48:37leorize__ibrahim__: you, uh, just tell people to install the missing dlls into their system if they're on a sane os :P
16:48:41disruptekthe fact is, my hardware is dogshit under windows and brilliant under linux.
16:48:47disruptekdraw whatever conclusions you may.
16:49:07FromDiscord<__ibrahim__> lol i want to supply them with the dlls :D
16:49:09leorizeI wouldn't say nouveau is an actual improvment :P
16:49:42disruptektell me when microsoft reverse engineers an nvidia driver.
16:49:48FromDiscord<__ibrahim__> there is no such thing as a sane os? xD
16:50:42FromDiscord<__ibrahim__> leorize: LOL
16:51:02leorizewell if you want to supply them with the dlls... yea you can't :P
16:51:09Zevvhttps://itvision.altervista.org/why.linux.is.not.ready.for.the.desktop.current.html
16:51:14leorizethe mechanism differs between os
16:51:16FromDiscord<__ibrahim__> i cant put them next to the exe?
16:51:26leorizethat's a windows thing :P
16:51:39FromDiscord<__ibrahim__> oh
16:51:44*solitudesf quit (Remote host closed the connection)
16:52:03leorizewell you can
16:52:07*solitudesf joined #nim
16:52:10leorizeit's not simple
16:52:17FromDiscord<__ibrahim__> i guess for macos, nim finds the homebrew installs ?
16:52:24leorizenot always :)
16:52:42FromDiscord<__ibrahim__> xD
16:52:58leorizealso Nim don't look around, it's your os :P
16:53:14FromDiscord<__ibrahim__> it doesnt look around, and i cant tell it where to look?
16:53:15FromDiscord<Recruit_main707> how will the new windows based on linux kernel affect things?
16:53:16*sagax joined #nim
16:53:29leorizethey have that?
16:53:37FromDiscord<__ibrahim__> yes
16:53:55leorizewell finally I will have more games on linux? :P
16:53:57FromDiscord<Recruit_main707> will dlls now be .so for instance?
16:54:07leorizeprobably not
16:54:25leorizewhere's the windows based on linux kernel news? I haven't seen it :o
16:54:48FromDiscord<Recruit_main707> let me see
16:54:49FromDiscord<__ibrahim__> WSL
16:54:57FromDiscord<Recruit_main707> ah :)
16:54:59leorizethat's not windows based on linux kernel
16:55:05FromDiscord<__ibrahim__> https://docs.microsoft.com/en-us/windows/wsl/install-win10
16:55:16leorizeit's still the nt kernel underneath
16:55:25FromDiscord<__ibrahim__> oh maybe i missunderstood what @Recruit_main707 meant
16:56:15leorizeWSL 1 is basically wine but the other way around
16:56:31leorizeWSL 2 is "wine is hard so we virtualize instead"
16:56:51FromDiscord<__ibrahim__> leorize: so basically there is no "safe" way of installing dlls, you just need to tinker with it
16:57:21leorizewelcome to the age old problem of dependency management :P
16:57:27FromDiscord<__ibrahim__> xD
16:57:33FromDiscord<__ibrahim__> im trying to run away from it :D
16:57:39FromDiscord<__ibrahim__> from c++
16:57:40leorizethe popular way out is to statically link everything
16:57:57FromDiscord<__ibrahim__> fat exe
16:57:59leorizeyou are gonna face it a lot, since you're interfacing with C code :P
16:58:04FromDiscord<Rika> dynamic linking hell
16:58:43FromDiscord<Rika> fat exe is preferred over "issues being opened because the dll is missing lmao"
16:58:46leorizeyou can use dlls too if you use some -rpath tricks
16:58:50leorizebut yea fat exe is the best
16:58:52leorizeit just works
16:59:26leorizeofc if you are a linux distribution then dlls is the best since you control every single dll
17:00:17FromDiscord<__ibrahim__> .so right?
17:00:23leorizeyea
17:00:43leorizebut unless you are a distribution (which you probably aren't), static linking is the best
17:00:53leorizeunless that's not permitted by the license of your library
17:01:11FromDiscord<__ibrahim__> whats cool is that static and dynamic use the same workflow of {.importc.} right?
17:01:20leorizeyea
17:01:32FromDiscord<__ibrahim__> so its easy to swap
17:01:44leorize--dynlibOverride lets you disable the dlopen() generation
17:01:57leorizeso you can link however you want, just like with C code
17:02:14disruptekthis hasn't been my experience.
17:02:46FromDiscord<__ibrahim__> build systems hell :D
17:02:59FromDiscord<__ibrahim__> so many hells
17:03:03FromDiscord<__ibrahim__> call back hell
17:03:06FromDiscord<__ibrahim__> micro service hell
17:04:26FromDiscord<__ibrahim__> what was your experience disruptek
17:05:05disruptekwell, i cannot trivially link ssl/ssh statically.
17:08:14*filcuc quit (Ping timeout: 260 seconds)
17:17:04disruptek!last shashlick
17:17:04disbotshashlick spoke in 12#nim-offtopic 3 days ago
17:17:12disruptekyou okay, buddy?
17:20:46*zacharycarter joined #nim
17:24:49*idf quit (Read error: Connection reset by peer)
17:25:16*narimiran quit (Ping timeout: 256 seconds)
17:28:10*solitudesf quit (Remote host closed the connection)
17:28:24*solitudesf joined #nim
17:28:55disruptekbut what did he SAY?
17:33:12*zacharycarter quit (Ping timeout: 256 seconds)
17:35:43bjornrobergmaybe this helps? https://irclogs.nim-lang.org/28-05-2020.html
17:37:33leorizelol gateway timeout
17:39:00*NimBot joined #nim
17:43:28*fredrikhr quit (Ping timeout: 256 seconds)
17:55:06*hyuke joined #nim
17:58:21*zacharycarter joined #nim
18:03:50FromDiscord<Technisha Circuit> How does include work and why/what cases would i use it over import?
18:04:07leorizeinclude literally means include :P
18:04:10*Jjp137 quit (Read error: Connection reset by peer)
18:04:15leorizeit read the entire file into your current module
18:04:15FromDiscord<Recruit_main707> include takes that file and slaps it in the otehr one
18:04:22FromDiscord<Technisha Circuit> O
18:04:34FromDiscord<Technisha Circuit> So what cases would i use it in?
18:04:48Zevvdid mratsims raytracer make it to HN yet?
18:04:49leorizewhen you want to read a file directly into your current module :P
18:04:55FromDiscord<Technisha Circuit> Oh okay
18:05:12leorizeZevv: it hasn't even got to our frontpage :P
18:05:44Zevvit has not even been submitted to HN it seems :/
18:05:53Zevvwhos in charge of that?
18:05:56Zevvfire the bloke!
18:06:02leorizeusually narimiran :P
18:06:24*hyuke quit (Quit: leaving)
18:06:40Zevvno wonder! fire the bloke!
18:14:29ZevvI shall take the liberty to do this now then. "Trace of Radiance - Faster and safer raytracing with Nim?"
18:15:48*Jjp137 joined #nim
18:16:10ZevvWuha the guy embedded a h.264 encoder for animations
18:16:33ZevvWe have our own Fabrice Bellard!
18:20:31PMunchhttps://peterme.net/using-nimscript-as-a-configuration-language-embedding-nimscript-pt-1.html
18:20:40PMunchhttps://peterme.net/how-to-embed-nimscript-into-a-nim-program-embedding-nimscript-pt-2.html
18:20:42PMunchWoop woop
18:21:01Zevvbut why nimscript?
18:21:02Zevvwhy?!
18:21:25Zevvnice PMunch, nice.
18:21:31PMunch(For some weird reason my CMS really doesn't like the word "nimscript" in links, it converts it to "nimscxxxript", so all the links are broken..)
18:21:43PMunchCan't be arsed to figure out why atm
18:21:47Zevvhaha that's pretty weird
18:21:49PMunchZevv, read the first article ;)
18:22:13PMunchBut I've gotta run
18:22:14PMunchbbl
18:22:15*PMunch quit (Quit: leaving)
18:22:27ZevvWell, I id. but now I can't read the 2nd. "nimscxxxript" page not found :)
18:25:52Zevvanyway, trace of radiance: https://news.ycombinator.com/item?id=23371434
18:34:11*nphg joined #nim
18:49:36*PMunch joined #nim
18:49:56PMunchZevv, I posted both links :P
18:50:05Zevvyeah I know :)
18:50:19Zevvjust trolling
18:50:19*PMunch quit (Read error: Connection reset by peer)
18:55:42FromDiscord<dom96> Should have submitted that as a show hn
18:58:37Zevvsure, why not: https://news.ycombinator.com/item?id=23371721
18:58:45Zevvit only had 1 point so resubmitted, just for you :)
19:03:04FromDiscord<__ibrahim__> This code works on mac, but gives `attempting to access nil` error on windows. https://media.discordapp.net/attachments/371759389889003532/716728474286555136/sdl2nimtest.7z
19:04:05*chemist69_ quit (Ping timeout: 246 seconds)
19:05:16*chemist69 joined #nim
19:08:01FromDiscord<Technisha Circuit> Is there an assembly compiler in Nim?
19:08:11FromDiscord<Technisha Circuit> Where I can't use Nim stuff
19:10:12FromDiscord<Rika> ?
19:11:56*krux02 joined #nim
19:14:49disruptekbjornroberg: you gave me a cute idea; thanks.
19:14:54disruptek!last zevv
19:14:55disbotZevv spoke in 12#nim 16 minutes ago 12https://irclogs.nim-lang.org/31-05-2020.html#18:58:45
19:19:44leorize@Technisha wdym?
19:20:33FromDiscord<Technisha Circuit> I want to compile assembly using Nim :p
19:20:51FromDiscord<Recruit_main707> written in Nim?
19:21:06FromDiscord<Recruit_main707> or compiling asm from within nim code
19:21:55FromDiscord<Technisha Circuit> Depends what you mean
19:22:10FromDiscord<Technisha Circuit> I want an asm compiler written in Nim so i assume the first one
19:22:19FromDiscord<Technisha Circuit> !last Technisha
19:22:20disbotTechnisha never seen.
19:22:35FromDiscord<Technisha Circuit> !last Technisha Circuit
19:22:36disbotTechnisha Circuit spoke in 12#nim 15 seconds ago 12https://irclogs.nim-lang.org/31-05-2020.html#19:22:19
19:22:42FromDiscord<Technisha Circuit> Nice
19:22:42AvatarfighterAre you trying to compile ASM within nim code or using a compiler written in nim for assembly?
19:22:57FromDiscord<Recruit_main707> an assembler made in nim
19:23:13FromDiscord<Technisha Circuit> ^^^
19:23:18Avatarfighterohhhh
19:23:24FromDiscord<Rika> Y tho
19:23:25FromDiscord<Technisha Circuit> The latter for Avatar's question
19:23:33FromDiscord<Recruit_main707> > Y tho↵Y not
19:23:40FromDiscord<Technisha Circuit> ^^^
19:26:47FromDiscord<Rika> Perhaps there is a more specific reason than just why not
19:27:09FromDiscord<Rika> And if not then ok
19:27:25FromDiscord<Recruit_main707> I also had a season obsessed with assemblers
19:27:28FromDiscord<Technisha Circuit> Just curious specifically
19:27:31FromDiscord<Technisha Circuit> Also, I can't be bothered trying to track down an assembler for Termux :P
19:27:44FromDiscord<Technisha Circuit> But more of me just being curious
19:28:18FromDiscord<Recruit_main707> anyone knows how to use cmake?
19:30:11FromDiscord<Technisha Circuit> I just do `cmake .` normally and it works :P
19:30:22leorizeI'm pretty sure gas and nasm is available for termux
19:30:26FromDiscord<Technisha Circuit> But idk how to make something that uses Cmake to compile/build
19:30:32FromDiscord<Technisha Circuit> Lemme see
19:30:47leorizealso clang have an integrated assembler
19:31:20FromDiscord<Technisha Circuit> I found yasm
19:31:36Zevvdon't go cmake. it hurts.
19:31:58FromDiscord<Recruit_main707> its a sacrifice to get nim into https://github.com/google/flatbuffers
19:41:11*Senny quit (Ping timeout: 246 seconds)
19:45:42FromDiscord<Recruit_main707> is there a list of nim keywords?
19:45:47FromDiscord<treeform> can some one help me with this code? https://play.nim-lang.org/#ix=2nY6
19:45:53FromDiscord<Recruit_main707> possibly sorted in a cpp array? :P
19:45:56*beatmox_ quit (Quit: ZNC 1.8.0 - https://znc.in)
19:46:42*beatmox joined #nim
19:47:02*qwertfisch_ joined #nim
19:47:37FromDiscord<Recruit_main707> found it
19:47:45Zevvdoc/keywords.txt
19:48:50FromDiscord<Recruit_main707> @treeform cast seems to work
19:49:00FromDiscord<Recruit_main707> idk why it doesnt the other way though
19:49:52*qwertfisch quit (Ping timeout: 244 seconds)
19:51:50FromDiscord<treeform> you right cast does work
19:51:52FromDiscord<treeform> very strange!
19:53:29Zevvdisruptek: zup
19:53:54disruptekjust a test.
19:53:58disruptekwhat are you up to?
19:54:06Zevviteration #3
19:54:11disruptekbeer?
19:54:15Zevvxfrms
19:54:24disruptekoh, way less interesting. 😁
19:54:38disruptekhow does it look?
19:54:39*tdc joined #nim
19:54:43Zevvcrappy
19:54:45Zevvcan't be done
19:55:10disruptekbecause of info loss?
19:55:16Zevvbut I should be able to make something that works with caveats
19:55:16Zevvright
19:55:26disruptekdid you push it?
19:55:26Zevvwell, not "loss", but just not the right info there
19:55:36leorizetreeform: https://play.nim-lang.org/#ix=2nYa
19:55:42leorize@treeform
19:56:13Zevvdisruptek: nothing usable yet. Try #1 you saw yesterday I think, and #2 was never put in git
19:57:11FromDiscord<treeform> leorize, nice!
19:57:13disrupteki'm currently trying to figure out how to serialize self-referential objects, breaking them during write and restoring them during read.
19:58:12Zevvhm is that not solved in channels already?
19:58:12FromDiscord<treeform> like ones that have loops?
19:58:32disruptekis it? i thought channels was dead and buried.
19:58:40*haxscramper quit (Remote host closed the connection)
19:58:45Zevvoh I don't know actually. It's never clear to me what is and what isn't
19:59:36disruptekwell, i will look at them. thanks for the tip.
20:00:15*qwertfisch_ is now known as qwertfisch
20:01:08Zevvwell, it might *not* be solved there, but that would surprise me :)
20:03:30disruptekusing a channel as my api is a brilliant idea, but other than that, i don't think it helps me.
20:03:42Zevvwhat is your problem
20:03:52disrupteki'm underemployed and underemployable.
20:04:35Zevvright, no channels helping there
20:05:25disruptekbut it's still a super idea.
20:06:00Zevvnot it's not
20:06:08Zevvhttps://nim-lang.github.io/Nim/channels.html
20:06:12Zevvnote #3 on the top
20:06:17Zevv"Note: The current implementation of message passing does not work with cyclic data structures"
20:06:24disrupteki know.
20:06:34disruptekthat's why i said it doesn't help.
20:06:45Zevvah right
20:06:49disruptekbut it actually does, because i can build my api around a channel.
20:07:24disruptekthen you can transparently move your persistence to a thread, and anything that you currently move around via channels can be invisibly persisted.
20:07:29disruptekno additional code/api to learn.
20:07:39Zevvhm ok
20:08:00disruptekbut, yeah, i still have to solve this problem. but now i have a new api to work with to do so.
20:11:02ZevvI did something similar ages ago in lua. If i remember correctly it was something like this
20:11:12Zevv- have a set of pointers of objects already serialized
20:11:23Zevv- have a ref ID counter, starting at 0
20:11:26Zevvalgo:
20:11:40Zevv- check if your object is already in the serialized set, if so, return
20:11:53Zevv- emit the sequence number and seralize the object
20:11:58Zevv- recurse through all its child refs
20:12:24disruptekthis is almost exactly what i'm doing; only difference is that i don't use a counter -- i cast the memory address; it's a suitable unique identifier.
20:12:25Zevv- look up each address in the already serailized set. If the pointer is there, just note the id
20:12:48Zevvyeah but you can't just put it in an array easily
20:12:54Zevvbut it's basically the same of course.
20:13:02disruptekthe problem is only object self: ptr
20:13:24disruptekie. an object that has a field pointing to itself. and i think i licked it.
20:13:47Zevvhm that wasn't really a problem for me. It's ref Id just points to its own Id.
20:14:09disrupteki was thinking i'd just detach it by simply not recursing with the right value. we'll see if this iteration works, first.
20:14:45disruptekits own id has been recorded but not actually written yet, so...
20:15:14Zevvyeah, that's your own fault
20:15:22disrupteklol maybe you're right.
20:16:09disruptekit's like i reversed it because i foresaw this comin'.
20:16:48disruptekbut seriously... are we gonna make badges for fosdem2021 or won't it be held next year?
20:17:42Zevvwell, given the state of the venue and the amount of people crammed in, I wouldn't be surprised if fosdem was an essential link in the chain of getting corona spread through europe
20:18:08ZevvI must say I did enjoy meeting the Nim folks and spending time in the Nim room, but there was a lot I hated there
20:18:10disruptekbut i couldn't get sick there no matter how many toilet seats i licked.
20:18:45disruptekthere's just so much to hate about belgium.
20:18:51disrupteklet's be honest.
20:18:54Zevvlicking toilet seats is generally safe - just don't lick the door knobs
20:19:01disruptekit's not like there's anyone listening.
20:19:11Zevvoh I'm fine with brussels and all
20:19:49Zevvbut these *belgians*
20:19:59disruptekwimpy beer, huh
20:20:09Zevvno sir, nothing wrong with the beer sir
20:21:04Zevvbut conference-wise, I'm not sure if I would attend again, or recommend to friends&family
20:21:52disrupteki would do it again to hang-out, if i'm not in jail then.
20:23:10Zevvwe'll crowdfund bail for you, for the occasion
20:24:03disruptekawww you guys
20:24:59disrupteki think you just brought a tear to the eye of every agency reading my screen right now.
20:25:38Zevvyou bet
20:26:12disruptekit's the kind of material that will play well at my trial.
20:26:26disrupteklord knows i need as much of it as i can get.
20:27:05disrupteki guess this code is working after all.
20:27:17disruptekit's just reads that need impl.
20:27:28disruptekbut man, this channel idea is genius.
20:28:43Zevvi though channels was dead and buried
20:28:52disruptekright?
20:28:56Avatarfighterdeath never stops genius :P
20:29:29Zevvwell, I'm off for an early night, next time you come up with a genius idea to fix my lambda lifting
20:29:38disruptekaight peace
20:29:50Zevvkeep up the good work dude!
20:31:14disruptekhmm, an array.
20:32:40disrupteki'm using a table of address/pointer; i guess there's no advantage to switching.
20:48:26*bjornroberg quit (Quit: leaving)
20:57:55*tdc quit (Ping timeout: 246 seconds)
21:04:55*Trustable joined #nim
21:05:17FromDiscord<Clyybber> Araq: Isn't NRVO done after injectdestructors?
21:20:32FromDiscord<dom96> https://github.com/nim-lang/Nim/pull/14519 why though?
21:20:33disbotos module nodejs support
21:21:46FromDiscord<Rika> because nodejs supports os functionality?
21:39:04bung_nimsl test against js backend ,dont know why it cant find jsos identifier
21:41:00FromDiscord<dom96> why target nodejs with Nim?
21:42:27bung_just thought nim can compile to js , so
21:45:15bung_and I want nimpretty to be a js module
21:45:15FromDiscord<dom96> Yes, for browsers
21:45:28FromDiscord<dom96> Nim can run natively on servers
21:45:41FromDiscord<dom96> so there is little reason to use nodejs
21:46:08FromDiscord<Rika> dom: why's -d:nodejs still exist then
21:48:58FromDiscord<dom96> so that Nim's JS backend can be tested in CI without depending on a browser
21:50:06disruptekthat's ridiculous.
21:50:16disruptekit's useful to share logic between software with different backends.
21:52:27bung_I would like to write program in Nim like I does in typescript not vanilla js
21:55:10FromGitter<sheerluck> disruptek as an american what are your feelings about today (SpaceX's Dragon + ISS)?
21:55:31FromDiscord<Rika> #nim-offtopic?
21:55:55disrupteki pray that a bus somehow finds a way to run over musk at least once between now and the end of the day.
21:56:01*solitudesf quit (Ping timeout: 246 seconds)
21:56:28disruptekif not a bus, maybe he can die in a fire somehow.
21:56:51disruptekradiation would be cool, too.
22:00:41*nphg_ joined #nim
22:01:07AvatarfighterThe docking was super cool!
22:02:05*Trustable quit (Remote host closed the connection)
22:03:59*nphg quit (Ping timeout: 246 seconds)
22:18:53skrylar[m]drat. there's no way to reuse the futures in i/o loops is there
22:19:02skrylar[m]they dont take futurevars
22:25:54*dadada quit (Ping timeout: 240 seconds)
22:27:49*nphg_ quit (Ping timeout: 264 seconds)
22:28:53*dadada joined #nim
22:29:16*dadada is now known as Guest7896
22:29:52*nphg_ joined #nim
22:39:45FromDiscord<dom96> You mean to avoid reallocating them?
22:48:51*oprypin quit (Quit: Bye)
22:48:51*nphg_ quit (Read error: Connection reset by peer)
22:48:59*oprypin joined #nim
22:49:03*nphg_ joined #nim
22:53:07*Guest7896 quit (Ping timeout: 265 seconds)
22:55:47*leorize quit (Remote host closed the connection)
22:58:52*dadada__ joined #nim
22:59:23*fredrikhr joined #nim
22:59:27*nphg1 joined #nim
22:59:54*nphg_ quit (Read error: Connection reset by peer)
23:03:53*lritter joined #nim
23:04:37*nphg1 quit (Ping timeout: 246 seconds)
23:04:38Yardanicoleorize[m]: my PR doesn't fix all issues
23:04:45Yardanicosee the comment I just posted about another case with phantom errors
23:04:54YardanicoI'll try test_lazytree.nim though
23:04:59*nphg1 joined #nim
23:06:08leorize[m]if you can, please add tests
23:06:11Yardanicoyeah it's still not fixed
23:06:33Yardanicoleorize[m]: after my PR I get this output for lazytree example https://play.nim-lang.org/#ix=2nZ5
23:06:46Yardanicowell yeah, there are nimsuggest tests but AFAIK they're not a part of the CI
23:09:23leorize[m]they are a part of ci
23:09:30Yardanicooh really?
23:09:55leorize[m]yea
23:10:07*nphg1 quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
23:10:11leorize[m]try to see how `compiles()` interact with nimsuggest chk
23:10:42Yardanicoleorize[m]: error :)
23:10:45Yardanicofor simple echo compiles(2 + "hello")
23:10:53Yardanicotype mismatch
23:10:58leorize[m]that's your bug
23:11:02Yardanico:P
23:11:22leorize[m]fix that and it should solve the table issue
23:11:28YardanicoI'll try lol
23:12:45Yardanicoleorize[m]: seems like this type mismatch comes from notFoundError in semcall.nim
23:12:48Yardanicoline 276
23:13:28skrylar[m]yes
23:14:44skrylar[m]@reallocting futures each recv
23:16:40YardanicosemOverloadedCall line 590
23:17:03Prestigebung_: regarding running nodejs locally, why would you want to do that instead of running a program that was complied to a binary? Just trying to understand the use case
23:17:13*sschwarzer joined #nim
23:17:44FromGitter<sealmove> Hey, is there an exec in nimscript that returns the output?
23:19:49skrylar[m]Prestige: maybe they need to make a nodered module :)
23:20:28FromDiscord<Cut a weeb and a pedo bleeds> is there an alternative to system.marshal?
23:20:37leorize[m]Yardanico: https://github.com/nim-lang/Nim/blob/7ccc7d7e93e0fdfcf72aed239cf8b5d4c04e7de5/compiler/semexprs.nim#L2063
23:20:44FromDiscord<Cut a weeb and a pedo bleeds> it doesn't work on javascript backend (intentionally)
23:20:49Yardanicoyeah I found that one too :P leorize[m]
23:20:56leorize[m]Yardanico: probably you just need to remove the structuredErrorHook here before running the test semcheck
23:21:00Yardanicoohh
23:21:46FromGitter<PMunch> Disruptek, what kind of badges were you thinking of?
23:21:56Yardanico@PMunch btw we're fixing nimsuggest phantom errors :P
23:22:12FromGitter<PMunch> We were actually talking about making Nim shaped paper crowns :P
23:22:40FromGitter<PMunch> @Yardanico oh cool! Which ones are that?
23:22:41sschwarzerPMunch :-D
23:22:48Yardanicothe one with tables comes fro nimsuggest not being able to compiles()
23:22:52Yardanicoand another one https://github.com/nim-lang/Nim/pull/14526
23:22:55disbotChange severity of template instantiation message ; snippet at 12https://play.nim-lang.org/#ix=2nZ8
23:22:58FromGitter<PMunch> @Elegant Beef, did you see the articles?
23:23:01Yardanicobasically template/generic instantiation was reported as an error
23:23:05Yardanicowith severity of the error
23:23:17leorize[m]@Cut json.%
23:23:30FromDiscord<Elegant Beef> Did you at them to me?
23:24:10FromGitter<PMunch> Oh yeah, I've noticed that, was considering to hack it into NimLSP to stop them from being errors..
23:24:10FromGitter<PMunch> Ah no, I forgot..
23:24:20Yardanicowell that one is a 1-line fix, the compiles issue is a bit harder :D
23:24:40FromGitter<PMunch> @Elegant beef, they are the two last ones on peterme.net
23:24:42AvatarfighterDoes anyone know how to stop Httpclient socket handle leaks?
23:24:49YardanicoAvatarfighter: close httpclient?
23:24:51Yardanicoinstance
23:24:59leorize[m]it doesn't leak
23:25:03FromGitter<PMunch> Compiles error?
23:25:10Yardanicodiscard compiles(2 + "hello")
23:25:16Yardaniconimsuggest will report a type mismatch for this one
23:25:20Yardanicoit affects tables module
23:25:33leorize[m]Yardanico: after that one you might be able to fix this one: https://github.com/alaviss/nim.nvim/issues/18 :P
23:25:34disbotHighlighting sometimes disappears
23:25:37FromDiscord<Cut a weeb and a pedo bleeds> leorize, last time I checked % doesn't serialize mutiple references to the same object as such
23:25:54FromDiscord<Cut a weeb and a pedo bleeds> then they are deserialized as different objects
23:26:21AvatarfighterI swear httpclient has a leak, I close my client after every use but after ~1000 requests I get similar issues as this https://github.com/nim-lang/Nim/issues/12381
23:26:23disbotHttpClient socket handle leak ; snippet at 12https://play.nim-lang.org/#ix=2nZa
23:26:37FromGitter<PMunch> Yardanico , I see
23:26:39FromDiscord<dayl1ght> hey folks, I have repetitive code like this: https://play.nim-lang.org/#ix=2nZ9
23:26:39Avatarfighteroh dang this bot is fancy
23:27:03Yardanico@dayl1ght use templates?
23:27:06FromGitter<PMunch> Avatarfighter, which one? Disbot?
23:27:16FromDiscord<dayl1ght> I'm trying to refactor it to use macros:https://play.nim-lang.org/#ix=2nZb
23:27:20sschwarzerAvatarfighter: yep!
23:27:20FromDiscord<Rika> use templates
23:27:22AvatarfighterPMunch: Disbot is fancy
23:27:24YardanicoI don't think macros are needed there
23:27:27FromDiscord<Rika> its easier for your use case
23:27:30YardanicoI think templates should be enough
23:27:32FromDiscord<Rika> macros are overkill
23:27:46FromDiscord<dayl1ght> hmm how can I do it with templates? I need a special case for when the operator passed to binrayOp is "/"
23:28:05Yardanicothere's "when" statement
23:28:05Yardanicofor compile-time if
23:28:07FromDiscord<dayl1ght> I'm also having trouble passing `op.strVal` to the string inside the quotation
23:28:38FromDiscord<Elegant Beef> Pmunch you really need to stop looking up porn when writting hyperlinks, from part 1 ↵`https://peterme.net/how-to-embed-nimscxxxript-into-a-nim-program-embedding-nimscxxxript-pt-2.html`
23:28:50leorize[m]we really need to remove `void` from the language
23:29:00leorize[m]people are doing `: void` too much :P
23:29:05Yardanicowonder why :P
23:30:02FromGitter<PMunch> @Elegant Beef, I don't know what happened there.. It's my CMS that kept changing them. I tried like 7 times to manually edit them back, but each time I saved them the links went like that...
23:30:12FromDiscord<Elegant Beef> Suuuuure
23:30:39FromGitter<PMunch> I have a theory that CouchCMS is after NimScript!
23:30:46FromDiscord<Rika> @dayl1ght https://play.nim-lang.org/#ix=2nZd i think works
23:31:14FromGitter<PMunch> But I'm tired after celebrating my birthday yesterday and just wanted to get these out so I could go do something else :P
23:31:31leorize[m]@Rika do `bindSym` on it
23:31:56FromDiscord<Rika> ¯\_(ツ)_/¯
23:32:01FromDiscord<Rika> i dont know what that does
23:32:04FromDiscord<Cut a weeb and a pedo bleeds> @dayl1ght this should work, maybe https://play.nim-lang.org/#ix=2nZe
23:32:48Yardanicoleorize[m]: well I mean I guess I did it, but I don't know if it's the right way
23:32:59Yardanicoso basically I store the hook in a temp variable, set c.graph.config.structuredErrorHook to nil
23:33:01FromDiscord<dayl1ght> @Rika that does work, thanks!
23:33:02Yardanicoand then in the end restore c.graph.config.structuredErrorHook
23:33:05Yardanicothat way it works
23:33:07Yardanico:D
23:33:12FromDiscord<dayl1ght> @Cut a weeb and a pedo bleeds your solution works too, I didn't think of the nested template
23:33:22FromDiscord<dayl1ght> one thing that I'm confused about
23:33:26Yardanicoofc I do it under when defined(nimsuggest)
23:33:29FromDiscord<Rika> only issue for that other one is the string in the expression
23:33:37FromDiscord<dayl1ght> is in my macro I'm calling it with a string, e.g.: `binaryOp("+")`
23:34:07*krux02_ joined #nim
23:34:20FromDiscord<dayl1ght> if I call it with binaryOp(`+`) , what am I doing exactly?
23:34:24FromDiscord<dayl1ght> am I passing the identifier node to the macro?
23:34:58FromDiscord<dayl1ght> I meant ```↵binaryOp(`+`)↵```↵discord formatting is bad :p
23:35:12FromDiscord<Cut a weeb and a pedo bleeds> sure
23:35:36Yardanicoleorize[m]: with my fix lazytree seems to work fine
23:35:36FromDiscord<Cut a weeb and a pedo bleeds> you could treeRepr(op) to see it
23:35:36FromDiscord<Rika> you're passing `AccQuoted(Ident +)` to the macro
23:35:37FromDiscord<Rika> assuming that its untyped
23:35:38FromDiscord<Cut a weeb and a pedo bleeds> `echo treeRepr(op)`, exactly
23:35:51leorize[m]Yardanico: looking at the git blame it seems like that should be the right fix
23:35:56Yardanicooh okay :)
23:36:01YardanicoI'll make a separate PR for this one I guess
23:36:28FromDiscord<Elegant Beef> Pmunch i do have to ask if there's a way we could clean up this to not be so boilerplatey
23:36:28YardanicoNeed to figure out tests too
23:36:28FromDiscord<Rika> you can do treerepr to verify, but i think im right
23:36:51leorize[m]you can group them in one PR, except that the github flow is terrible and you can only review PRs, not commits :P
23:36:58Yardanicowell I mean just to be safe
23:37:01Yardanicoidk if it will break something
23:37:06Yardanicoand easier to review
23:37:07*krux02 quit (Ping timeout: 260 seconds)
23:37:08FromDiscord<Elegant Beef> if you use `+` it'll be `ident "+"` if you use `"+"` it'll be a `stringLit "+"`
23:37:20FromDiscord<Elegant Beef> Atleast if i understood the question
23:37:42FromDiscord<dayl1ght> I don't think it's ident "+"? I can't call .strVala on it
23:37:45FromDiscord<dayl1ght> .strVal*
23:37:55FromDiscord<Rika> > you're passing `AccQuoted(Ident +)` to the macro↵(this is for ``` `+` ```)
23:38:18FromDiscord<Rika> you have to do theUntyped[0].strVal
23:38:43FromDiscord<Rika> since its wrapped in an AccQuoted
23:38:43FromDiscord<dayl1ght> ahh ok
23:39:19FromDiscord<dayl1ght> thanks everyone!
23:39:19FromDiscord<Cut a weeb and a pedo bleeds> AccQuoted seems like boilerplate :P
23:39:42*NimBot joined #nim
23:39:42FromDiscord<Rika> accent?
23:39:58FromDiscord<Rika> 😛 my guess was right
23:40:01FromGitter<PMunch> @Elegant Beef, what do you mean boilerplate-y?
23:40:24FromDiscord<Cut a weeb and a pedo bleeds> unexpected
23:40:25FromDiscord<Rika> its not beef who said that
23:40:35FromDiscord<Elegant Beef> I mean let's say you make your WM config with nims, there is going to be a large portion dedicating to setting up up procs and the like
23:40:36FromDiscord<Elegant Beef> I did
23:40:39FromDiscord<Rika> oh?
23:40:42FromDiscord<Rika> maybe i missed it lol
23:40:45FromDiscord<Elegant Beef> Was talking about nims -> nim
23:40:49FromDiscord<Elegant Beef> Nah earlier
23:40:56FromDiscord<Rika> cut's message overwrote my context!
23:41:57FromGitter<PMunch> @Elegant Beef, well that would be put in a library and either string concatenated onto the file or put in the stdlib you'll need to ship anyways.
23:42:34FromDiscord<dayl1ght> and if I want to make my macro more "type-safe", is that possible? e.g. can I emit a compile-time error if it's called with anything other than +, -, *, /?
23:42:39FromGitter<PMunch> So you won't see it in the actual config. The idea is that the config will end up looking like e.g. the .nimble files
23:42:39Yardanicoyes
23:42:48Yardanicohttps://nim-lang.org/docs/macros.html#error%2Cstring%2CNimNode
23:42:58FromDiscord<dayl1ght> perfect
23:43:02FromDiscord<dayl1ght> thanks
23:43:41FromDiscord<Elegant Beef> Ah ok so we can abstract it away
23:43:45FromDiscord<Elegant Beef> That was my question
23:43:52FromDiscord<Elegant Beef> Cause this is just... interesting↵https://hatebin.com/wuvubukqrd
23:44:17FromDiscord<Elegant Beef> Well good stuff, do hope to find a place for this stuff
23:46:18FromGitter<PMunch> Oh right, yeah that kind of stuff would stay that way.. But that won't be in your config
23:46:41FromDiscord<Elegant Beef> Yea i got that now, i was worried it was going to be there
23:46:47Avatarfighterstupid question guys, in the uri module would this behavior be considered a bug https://play.nim-lang.org/#ix=2nZk
23:46:52FromDiscord<Elegant Beef> Seems like nimscript could be nice for game modding
23:47:11FromDiscord<dayl1ght> so another thing I don't understand (on a high level) are macros that change nim's syntax, e.g. sugar.`->`
23:47:17FromDiscord<dayl1ght> wouldn't (string) -> string be invalid for the nim parser?
23:47:29FromDiscord<dayl1ght> or does it build a valid AST for that
23:47:39FromDiscord<ThothLoki> Hey all. I am writing an app (sorry, don’t have code available right now as I am on mobile) and am using the nigui GUI module. I am trying to turn the text from a text box into a float variable. Does anyone have a code snippet I could reference?
23:47:47FromDiscord<Clyybber> it builds a valid ast
23:47:56FromDiscord<Clyybber> -> is an operator
23:47:56Yardanico@ThothLoki strutils.parseFloat(yourstring)
23:48:11Yardanico!eval import strutils; echo parseFloat("3.14")
23:48:14NimBot3.14
23:48:21Yardanicohttps://nim-lang.org/docs/strutils.html#parseFloat%2Cstring
23:48:26FromDiscord<ThothLoki> Will that handle jsonNode format as well?
23:48:29Yardanicono?
23:48:33Yardanicowell I mean it's only for floats
23:48:46Yardanicoif you want to get a float from json you need to use getFloat from json module for your JsonNode object
23:49:02FromDiscord<ThothLoki> I am also grabbing a number for on an API that returns in json
23:49:13Yardanicohttps://nim-lang.org/docs/json.html ?
23:49:21Yardanicosee https://nim-lang.org/docs/json.html#overview-reading-values
23:49:23FromDiscord<ThothLoki> Ok. I will have to dig more.
23:49:46FromDiscord<dayl1ght> hmm. but wouldn't the parser try to create some kind of type node, not any node after `proc x(fn:`?
23:49:59FromDiscord<dayl1ght> if -> is an operator, that would be an expression node no?
23:50:24FromGitter<PMunch> @Elegant Beef, it could definitely be, but if performance is critical it's likely better to use a dynamic library approach. That gives you a much easier time with types as well..
23:50:34FromDiscord<dayl1ght> I don't understand how the parser doesn't blow up on that
23:50:51FromDiscord<ThothLoki> Thanks Yardanico. Bookmarked those pages
23:51:45leorize[m]Avatarfighter: https://tools.ietf.org/html/rfc3986#section-3.1
23:52:05leorize[m]not really a bug, the standard said the scheme can't contain spaces :P
23:52:19Yardanicoleorize[m]: it's a bug that parseUri doesn't throw an exception :P
23:52:31leorize[m]why should it?
23:52:40FromDiscord<Elegant Beef> Yea pmunch i was more thinking of like two mod types low level and highlevel
23:53:28FromDiscord<Elegant Beef> Cause wouldnt dynamic libraries require relaunching?
23:54:32FromGitter<PMunch> Nope
23:54:36FromDiscord<Elegant Beef> Oh
23:54:40Yardanicoleorize[m]: ok figured out how to add tests :P
23:54:42FromDiscord<Elegant Beef> Im just a numpty
23:55:15bung_dayl1ght it's just strings
23:55:33FromGitter<PMunch> I'm going to bed now, I'll write up a NimScript vs. Sim dynamic library comparison as well
23:56:46sschwarzerGood night, PMunch :)
23:56:56Yardanicoleorize[m]: https://github.com/nim-lang/Nim/pull/14527
23:56:58disbotFix `compiles` for nimsuggest
23:57:17Yardanicowill add a test to my other PR too
23:57:31*ftsf joined #nim
23:58:40FromDiscord<Cut a weeb and a pedo bleeds> afaik none of the marshalling libraries work on js 😯
23:59:22leorize[m]well json will always work
23:59:23leorize[m]marshall probably won't
23:59:32leorize[m]it relies on Nim RTTI, which I don't think we emit for js