<< 03-05-2020 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:00:21*krux02 quit (Ping timeout: 244 seconds)
00:01:10*junland joined #nim
00:01:41FromDiscord<Rika> oh no, recursion, i have to make it a ref object or make the field take in a ref
00:01:48FromDiscord<Rika> hmm which one would be better
00:05:51FromDiscord<KingDarBoja> make it a ref
00:05:56FromDiscord<KingDarBoja> `ref object`
00:07:53FromDiscord<Rika> i know how but i'm asking which would be better
00:08:09FromDiscord<Rika> ref object ... field: TheObject
00:08:12FromDiscord<Rika> or
00:08:19FromDiscord<Rika> object ... field: ref TheObject
00:08:48FromDiscord<Rika> i assume the latter would be just fine to use
00:08:59FromDiscord<Rika> i dont really have a use for ref objects on this datatype
00:10:49FromDiscord<KingDarBoja> Doesn't the latter force you to deref everytime you want to use it on TheObject?
00:12:21FromDiscord<Rika> can just make a proc for that
00:12:47Yardanicofor [] ?
00:13:01FromDiscord<Rika> no, i mean, an accessor proc
00:13:26FromDiscord<Rika> proc fieldName(obj: TheObject): TheObject = obj.fieldName[]
00:13:29FromDiscord<Rika> something like that no?
00:13:32zacharycarterhow can I make this work? https://play.nim-lang.org/#ix=2kxb
00:14:04FromDiscord<Rika> make a proc == that accepts an AtomicInt
00:14:12FromDiscord<Rika> same thing for SpinLock
00:14:42FromDiscord<Rika> or if you think conversion would work then maybe try converting them back into int32s
00:14:54Yardanicozacharycarter: proc `==`[T: SomeNumber](a: AtomicInt, b: T): bool = stuff
00:14:59Yardanicothat'll work for any number type
00:15:03Yardanicoyou can just do b: int though
00:15:08zacharycarteriproc `==`[T: SomeNumber](a: AtomicInt, b: T): bool = stuff
00:15:12zacharycarteroops thanks
00:15:17zacharycarterI'll try that
00:15:26Yardanicodo you need to compare for different number types?
00:15:39zacharycarterprobably just int32 but I can modify it for that
00:15:47Yardanicowell yeah
00:15:56Yardanicoproc `==`(a: AtomicInt, b: int32): bool = stuff
00:16:02Yardanicoalso don't forget to export it with *
00:16:57zacharycarterI don't think that's really a solution though...
00:17:06zacharycarterbecause what am I going to replace stuff with
00:17:31Yardanico?
00:17:58zacharycarterin C I can call `==` on an int32 and a fe_lock_t because they're both just int32's
00:18:10zacharycarterbut Nim's type system is preventing me from doing that
00:18:16Yardanicowell use casts
00:19:34zacharycartergoing to have to I guess
00:20:00Yardanicowell if you're already doing {.emit.} and {.importc.} cast is nothing :P
00:20:56zacharycarterit's not that I"m worried about using casts it's just the volatile typedef qualifier and the alignment attribute
00:23:07zacharycarter`The volatile type qualifier declares an item whose value can legitimately be changed by something beyond the control of the program in which it appears, such as a concurrently executing thread.`
00:23:15zacharycarterso I guess it doesn't matter too much
00:23:21zacharycarterif I cast it to an int32
00:23:48*chapl joined #nim
00:30:21FromGitter<dumjyl> nim has volatile and align pragmas that may help: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-align-pragma
00:30:31zacharycarterneither can be used on a type
00:30:42zacharycarternor can codgenDecl
01:01:34skrylar[m]bleh. was dealing with someone who doesn't seem to understand the morale consequences for not writing a language in itself :eyes:
01:03:07skrylar[m]had to point out that every major player does it, and most minor players do, which means its expected, and differing from expectation requires a good reason, and often they can't affirmatively excuse it and only negatively excuse it ("well you are just dumb for wanting that.")
01:03:47skrylar[m]i'm not entirely sure why you're expected to write things in themselves; i think its a social proof thing, but. shurgs
01:05:28FromDiscord<bedwardly-down> Might also be so that the end user doesnโ€™t need to juggle multiple languages to get up and running with one or to fix issues when they appear?
01:05:54skrylar[m]i listed some reasons like that and they just said "oh but you can get around all that" and its like, whatevs dood
01:06:49skrylar[m]you don't get a whole lot of space to allay people's fears in the narrow selection period of a new project, and if you have to waste some of it on "why isn't it self hosted?" "because its a one man project and he doesn't see it as a valuable use of his time" "Oh so its a one man project? Guess we need something more mature." RIP.
01:07:38skrylar[m]but yeah the haxe cope of "if you aren't smart enough to learn OCaml, you are too dumb to work on compilers" hasn't won them any friends when it came to backend ports
01:07:38*krux02_ quit (Read error: Connection reset by peer)
01:08:01skrylar[m]i dunno if nim has gotten 'more' help because its written in itself
01:08:19zacharycarterprobably not
01:08:27Yardanicoi think yes
01:08:31Yardanicoa bit :P
01:09:20skrylar[m]to be fair i did try to use beef on windows until it complainde about msvc, then on linux without the ide until it complained about some deep llvm internals, and then went well this is more effort than anyone in their right mind would have spent, so. ๐Ÿคฃ
01:10:25zacharycarterbeef does look interesting but yeah Nim seems much more mature
01:10:40zacharycarterI guess not even seems, is
01:10:57Yardanicohttps://www.beeflang.org/ ?
01:12:05zacharycarterhmm so I guess I need to emit this stuff not in the file I'm defining the wrapper types in
01:12:13zacharycarterbut everywhere that the wrapper types are imported
01:12:16zacharycarterthat's annoying :/
01:12:51zacharycarterthere has to be a better way
01:13:24skrylar[m]Yardanico: thats the one
01:14:07FromDiscord<dayl1ght> Hey, I'm completely new to nim and I'm having trouble doing basic imports: https://ghostbin.co/paste/7hx6h
01:14:25FromDiscord<Rika> you need to export it
01:14:27FromDiscord<dayl1ght> I've also tried from "./types"
01:14:31FromDiscord<Rika> type MyType* = int
01:14:38FromDiscord<dayl1ght> * exports identifiers?
01:14:38FromDiscord<Rika> see that asterisk?
01:14:39FromDiscord<codic> https://github.com/Yardanico/nimpylib is just amazing
01:14:41FromDiscord<Rika> thats to export it
01:14:47Yardanico@codic don't use it for real code XD
01:14:49FromDiscord<Rika> you can export a lot of things
01:14:56Yardanicoit's just shows how to (ab)use generics and stuff
01:14:58Yardanicotype MyType* = int
01:15:07FromDiscord<codic> Haha yeah, the only useful thing is the class support
01:15:14FromDiscord<dayl1ght> perfect, so all identifiers are private to a file except when I add an asterisk
01:15:17Yardanicoyes
01:15:17Yardanicohttps://nim-lang.org/docs/tut1.html#modules
01:15:38FromDiscord<codic> i'm gonna split classes into a seperate module hahaha
01:15:38FromDiscord<codic> then add inheritance if i can
01:15:44FromDiscord<dayl1ght> oh well that's what I get for not reading the whole tutorial, I was just skimming through the code examples :p
01:15:50FromDiscord<Rika> yardanico, i've started committing everything to circa's temp-all branch now
01:15:52Yardanico@codic well it shouldn't be too hard
01:15:54FromDiscord<dayl1ght> thanks folks
01:15:57Yardanico@Rika nice
01:15:57FromDiscord<codic> yeah
01:16:05FromDiscord<codic> do nim objects have inheritance?
01:16:09FromDiscord<Rika> my files are a mess though xd
01:16:13FromDiscord<Rika> yes they do
01:16:14Yardanico"object of AnotherType"
01:16:22Yardanicobut inheritance is mostly useful with methods
01:16:29FromDiscord<codic> boom https://github.com/Yardanico/nimpylib/blob/master/src/pylib/class.nim
01:16:30Yardanicoso you gotta change it so it makes methods instead of procs
01:16:47FromDiscord<codic> what's the difference?
01:16:55Yardanicoruntime dispatch vs static dispatch
01:17:00FromDiscord<Rika> *imo*, nim's oop isnt as strong as most other languages', but OOP is meh to me anyway so im not super annoyed
01:17:02Yardanicothe latter is of course faster
01:17:14FromDiscord<codic> so how do i change it to make methods/
01:17:24FromDiscord<codic> Since i don't see anything making a proc in there haha
01:17:27Yardanicohttps://nim-lang.org/docs/macros.html
01:17:33*LLuz joined #nim
01:17:42Yardanicohttps://github.com/Yardanico/nimpylib/blob/master/src/pylib/class.nim#L76
01:17:49Yardanicohttps://nim-lang.org/docs/macros.html#newProc%2CopenArray%5BNimNode%5D%2CNimNode%2CNimNode
01:17:51FromDiscord<codic> O
01:18:17FromDiscord<codic> hmm, that page doesn't have newMethod when ctrl-fing
01:18:18Yardanicobasically change nnkProcDef to nnkMethodDef and it *might* work
01:18:32FromDiscord<codic> does have nnkMethodDef tho
01:18:33FromDiscord<codic> oh
01:18:34Yardanico@codic last argument is routine type
01:18:42Yardanicowell, not the last one
01:18:43Yardanico"procType = nnkProcDef;"
01:18:46FromDiscord<Rika> you still need to make {.base.} methods though
01:18:48FromDiscord<Rika> gl, hf wit hthat
01:18:49Yardanicoyeah
01:18:54FromDiscord<codic> hm
01:19:13Yardanico@codic if you really want to extend it you gotta read a lot of stuff in https://nim-lang.org/docs/macros.html :P
01:19:15Yardanicoand experiment
01:20:48Yardanicoi'm surprised pylib has that much stars
01:21:21Yardanicoalthough https://github.com/metacraft-labs/py2nim has even more stars which is completely justified (the code is in https://github.com/metacraft-labs/py2nim_deprecated/ )
01:22:40FromDiscord<codic> Hahaha
01:22:40FromDiscord<codic> I have a very quick question, does your class implementation support classmethods?
01:23:19Yardanicowell this class macro is reaaally simple
01:23:23Yardanicoit doesn't do advanced stuff
01:24:10FromDiscord<codic> also, instead of the `type whatever = ref object(param: type)` could I use `var self.thing="O"` as a replacement for `self.thing="O"`
01:24:13FromDiscord<codic> yeah i know :P
01:24:30Yardanicovar self.thing="O" no
01:24:34*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
01:24:37Yardanicothat's not how it works
01:24:48Yardanicowith "var" you declare a new variable, and fields must be known in object type definitions
01:24:58Yardanicoyou can't declare new fields with "var"
01:25:11FromDiscord<codic> oh
01:25:22FromDiscord<Rika> you cant declare new fields on runtime
01:25:33FromDiscord<codic> welpy
01:26:02FromDiscord<codic> the main thing that's missing is classmethods, once i understand pragmas i'll allow `def thing(params) {.classmethod.}` if that's possible?
01:27:16Yardanicopython decorator syntax is valid nim syntax so you can have it the same as in python originally
01:27:29*LLuz quit (Quit: Quit)
01:27:32Yardanicolike "@classmethod<newline>def from_string(stuff)"
01:28:02FromDiscord<Rika> but you'll have to wrap the file in a megamacro no?
01:28:06Yardanicoyes ofc
01:28:19Yardanicobut really I'd suggest to not extend this class macro, not all python syntax is correct nim syntax
01:28:25FromDiscord<Rika> now i see how them C# source generators come into play...
01:28:26Yardanicoe.g. "a, b = stuff" is not valid nim syntax
01:28:38FromDiscord<Rika> i mean technically it is
01:28:40Yardanico@Rika well with "class" you basicall write stuff like in Python
01:28:43Yardanico@Rika it's not
01:28:44YardanicoI just checked
01:28:50FromDiscord<Rika> var a, b = stuff just sets both a and b to stuff's value
01:28:55FromDiscord<Rika> ah ou mean w/o the var?
01:28:57Yardanicoyes
01:29:02FromDiscord<Rika> yeah
01:29:16FromDiscord<Rika> why would you want to convert nim into python anyway
01:29:23Yardanicoikr
01:29:27Yardanicopylib is just a PoC :P
01:29:28FromDiscord<Rika> just use python if you're that hungry for it
01:29:30FromDiscord<codic> idk
01:29:33FromDiscord<codic> for fun
01:29:37FromDiscord<Rika> if you need speed use pypy with python
01:29:39FromDiscord<codic> i like the class syntax, that's all
01:29:44FromDiscord<Rika> its not gonna be fun to implement
01:29:47Yardanicothe only useful thing in it is https://github.com/Yardanico/nimpylib/blob/master/src/pylib/range.nim
01:30:00Yardanicoreplicates python-like range object
01:30:22Yardanicopython3-like*
01:30:29FromDiscord<KingDarBoja> .-.
01:30:39FromDiscord<Rika> hello
01:30:46FromDiscord<KingDarBoja> Hi, just saw the chat
01:30:54FromDiscord<KingDarBoja> I will be back, working on OOP + OV
01:30:57FromDiscord<KingDarBoja> Object variants*
01:31:20FromDiscord<codic> Fiiiiiiiine
01:31:21FromDiscord<codic> i won't
01:31:26FromDiscord<KingDarBoja> So far so good Rika-sensei
01:32:10FromDiscord<KingDarBoja> Just hit a nested object variant need but I do think I will scrap the parent type
01:32:28FromDiscord<KingDarBoja> At the end, I am doing all leaf types by groups
01:32:30FromDiscord<Rika> im here absolutely dying from beatmap difficulty calculation
01:32:44FromDiscord<Rika> like, its such a massive project converting oop to ov for me
01:32:44FromDiscord<KingDarBoja> Then all of them will inherit of a single Node base
01:32:55FromDiscord<KingDarBoja> D:
01:33:05FromDiscord<KingDarBoja> I know that feeling
01:33:22FromDiscord<KingDarBoja> Going backwards until I reach the parent base type
01:34:54FromDiscord<KingDarBoja> Hummmm
01:35:44FromDiscord<KingDarBoja> https://imgur.com/cBhadHR Rika Rika
01:36:33Yardanico@KingDarBoja you know you can basically have really much less kinds and just have a generic "sons" field of seq[Node] ?
01:36:53Yardanicosee https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L723
01:36:59FromDiscord<KingDarBoja> That's what I am doing
01:37:01Yardanicono?
01:37:04Yardanicothat's the node ast definition for nim AST
01:37:11FromDiscord<KingDarBoja> Yup, I saw that
01:37:11Yardanico"else: sons: TNodeSeq"
01:37:22FromDiscord<KingDarBoja> Not that part
01:37:41FromDiscord<KingDarBoja> > Then all of them will inherit of a single Node base
01:37:58FromDiscord<KingDarBoja> So all my leafs will have the Node as root ๐Ÿ™‚
01:38:01Yardanicothen you'll have one object
01:38:13Yardanicoi mean object type
01:38:22FromDiscord<KingDarBoja> Yup, just doing backward refactoring
01:38:37FromDiscord<KingDarBoja> So first grouping the leafs by parent types
01:38:45FromDiscord<KingDarBoja> Then scraping it and make it Node
01:39:20FromDiscord<KingDarBoja> The screenshot I sent was more a question, but forgot to ask
01:39:46FromDiscord<KingDarBoja> In case I had something like left side (nested Object variants), how I can provide the second kind `tdKind` ?
01:40:07Yardanico?
01:40:18FromDiscord<KingDarBoja> So `Parent` has a kind, one of its kind has a subkind
01:40:47FromDiscord<KingDarBoja> So If I do `Parent(kind: ChildTwo)`, how I can set the kind of the Child?
01:41:01FromDiscord<KingDarBoja> Like ChildTwo has a `cKind` field (subkind)
01:41:09Yardanicoyou can have as much kinds as you want in object variants
01:41:31Yardanico@KingDarBoja I don't understand without code :P
01:42:05FromDiscord<codic> earlier here, someone referened me to https://github.com/trustable-code/NiGui/blob/84a2b5c326658460d213b540e4f122b422deb5d6/examples/example_10_drawing.nim#L54 to change the font family and size in nigui. however i don't have a canvas, what would the other way to do it be?
01:42:18Yardanicoidk :P it was me, but I don't use nigui realy
01:42:29FromDiscord<codic> (if there are docs please link me to em)
01:42:34YardanicofontFamily is only for canvas
01:42:37Yardanicohttps://github.com/trustable-code/NiGui/search?q=fontFamily&unscoped_q=fontFamily
01:42:54Yardaniconigui is quite simple, it might not have some advanced stuff
01:43:24FromDiscord<codic> awww so I can't change the font of regular windows?
01:43:31Yardanicodoesn't seem so
01:44:27FromDiscord<codic> Yesssss!
01:44:37FromDiscord<codic> app.defaultFontFamily
01:44:47Yardanico?
01:44:51FromDiscord<codic> that worked
01:44:56Yardanicoah I see
01:44:58FromDiscord<codic> and app.defaultFontSize
01:44:59FromDiscord<codic> yay
01:45:57FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2kxN
01:46:02FromDiscord<KingDarBoja> This is what I meant
01:46:12Yardanicoso what's the issue here?
01:46:14*FromDiscord <KingDarBoja> Ignore those prop names lol
01:46:37Yardanicoah I see
01:46:38FromDiscord<KingDarBoja> If I wanted something like that...
01:46:49Yardanicothat's how you do it
01:46:51Yardanicohttps://play.nim-lang.org/#ix=2kxO
01:46:59Yardanicoif you have nested object variants it's still the same object
01:47:11FromDiscord<KingDarBoja> Oh ok
01:47:28FromDiscord<KingDarBoja> Also, I noticed the `repr` does print the subkind but it has a different formatting
01:47:41Yardanicorepr shouldn't really be used for normal printing
01:47:42FromDiscord<KingDarBoja> [count = 5, germanyidkProp = "", lightspeed = 0]
01:47:43Yardanicoit's for debugging
01:48:00FromDiscord<KingDarBoja> Ok
01:48:25FromDiscord<KingDarBoja> Oh, a simple echo is enough
01:48:27FromDiscord<KingDarBoja> Thank you ๐Ÿ™‚
01:48:47*chemist69 quit (Ping timeout: 240 seconds)
01:49:46FromDiscord<KingDarBoja> ๐Ÿ˜—
01:50:42FromDiscord<KingDarBoja> I am happy with how I got rid of those type conversions by using OV
01:50:44FromDiscord<Rika> no kissing, its social distancing rn
01:50:51FromDiscord<Rika> smh
01:51:01FromDiscord<KingDarBoja> ๐Ÿ‘
01:51:03*chemist69 joined #nim
01:52:33*FromDiscord <KingDarBoja> Is this the true Nim power?
01:52:43*FromDiscord <KingDarBoja> Because I like it ๐Ÿ•ถ๏ธ
01:54:17FromDiscord<Rika> yeah i guess it is
01:54:25FromDiscord<Rika> it feels so good consolidating many types into one
01:54:47Yardanicoalthough object variants is still runtime dispatch in a way, but yeah, it's certainly better than 100500 types
01:55:06Yardanicobecause you do different stuff based on different kinds of objects and kind is decided at runtime
01:55:54FromDiscord<KingDarBoja> I like when my tests still passing after each refactor step
01:56:03FromDiscord<KingDarBoja> I am getting closer to one single kind
01:56:10Yardanicoobject*
01:56:19*FromDiscord <KingDarBoja> be proud Rika-sensei
01:56:55FromDiscord<Rika> > tests
01:56:58FromDiscord<Rika> me: ._.
01:57:00YardanicoXDD
01:57:05FromDiscord<Rika> "what tests:
01:57:22FromDiscord<Rika> man i have to write tests for so many beatmaps its pretty insane
01:58:06Yardanicowell nim itself has around 1.8k test files
01:58:19Yardanicoand that's ~100k cloc of of Nim code
01:58:41Yardanicothe compiler itself is 60k cloc
01:58:50Yardanicostdlib 80k cloc
01:59:30FromDiscord<Rika> ``` ~> find /home/deodex/Documents/CODE/Nim/circa/test_suite/ -type f | wc -l 2020ๅนด05ๆœˆ03ๆ—ฅ 09ๆ™‚58ๅˆ†13็ง’
01:59:30FromDiscord<Rika> 5975```
01:59:39FromDiscord<Rika> oops, left the date
01:59:51Yardanicowell but you mostly test the same software and stuff :P
01:59:55Yardanicobut yeah, cool that there's a lot of tests
02:00:01FromDiscord<Rika> its not tests
02:00:05FromDiscord<Rika> its just beatmap files
02:00:11FromDiscord<Rika> i still have to write the tess
02:00:16Yardanicoautomatically generate them
02:00:31FromDiscord<Rika> not easy wrt. difficulty calc tests
02:00:46FromDiscord<KingDarBoja> `if Rika not lazy then do tests else be lazy`
02:00:53FromDiscord<Rika> because i need to query the API for that, for each map, each gamemode, and each mod combination
02:01:04FromDiscord<Rika> which is a lot of queries
02:01:16Yardanicodoesn't the osu db contain diff calculation?
02:01:20Yardanicojust use the osu database lol
02:01:22FromDiscord<Rika> i dont need to do all mod combinations, but i'll need all game modes
02:01:30Yardanicoit'll calculate all diffs and then you just query the DB
02:01:42FromDiscord<Rika> hmm actually osu has a tool
02:01:45Yardanicoit uses sqlite
02:01:51FromDiscord<Rika> yeah okay thisll be easier than i though
02:01:59FromDiscord<Rika> first, ill finish the code
02:02:19FromDiscord<KingDarBoja> I am adding comments to the spec, that's why I am slower
02:02:32FromDiscord<KingDarBoja> So anyone willing to look at it, just need to look at each url lol
02:06:38*dddddd quit (Remote host closed the connection)
02:07:51FromDiscord<KingDarBoja> Question
02:07:55YardanicoAnswer
02:08:01FromDiscord<KingDarBoja> Style guide says
02:08:07FromDiscord<KingDarBoja> > Unless marked with the {.pure.} pragma, members of enums should have an identifying prefix, such as an abbreviation of the enum's name.
02:08:17Yardanicoyeah that's outdated
02:08:32Yardanicoyou don't need pure pragma to specify enum members without full qualification
02:08:41FromDiscord<KingDarBoja> But it is okay to prefix my kinds like nkChild
02:08:44Yardanicoyeah ofc
02:08:49FromDiscord<KingDarBoja> As my parent type is Node lol
02:08:53FromDiscord<KingDarBoja> Ok
02:08:57Yardanicostyle guide is not mandatory
02:09:24FromDiscord<KingDarBoja> Just curious ๐Ÿ™‚
02:10:28*NimBot joined #nim
02:14:15*monok joined #nim
02:16:58*mono quit (Ping timeout: 272 seconds)
02:18:31FromDiscord<KingDarBoja> bollocks, the same field name on shared kinds is annoying
02:18:36FromDiscord<KingDarBoja> Need to rename them ๐Ÿ˜ข
02:18:41Yardanicojust prefix them
02:18:46YardanicosField
02:18:48YardanicoobjField
02:18:50YardanicopropField
02:21:17FromDiscord<KingDarBoja> Jum, I can't put `##` comments before each `of kind`
02:21:21FromDiscord<KingDarBoja> Only after the
02:21:26FromDiscord<KingDarBoja> after them*
02:21:34Yardanicoofc lol
02:21:37Yardanico what did you expet
02:21:40Yardanicoexpect*
02:22:20FromDiscord<KingDarBoja> I didn't know lol
02:24:52*muffindrake quit (Ping timeout: 260 seconds)
02:27:01*muffindrake joined #nim
02:34:12FromDiscord<dayl1ght> in vscode, is there a way to view the typesof a nim variable/expression?
02:34:34Yardanicoyes, hover over it
02:34:56Yardanicoctrl+lmb to go to definition
02:36:01FromDiscord<dayl1ght> hover doesn't work for me ๐Ÿ˜ https://imgur.com/a/2Ipy67p
02:36:29Yardanicoah, in this case it won't work
02:36:48Yardanicowhen you reference "test" somewhere else and hover over that - it'll show the type
02:37:12FromDiscord<exelotl> maybe the warning is swallowing the other useful information
02:37:21Yardaniconah
02:37:24FromDiscord<dayl1ght> ah referencing works, thanks
02:52:38FromDiscord<dayl1ght> so apparently toTable doesn't work when {.experimental: "codeReordering".} is set
02:55:56*Hideki joined #nim
02:56:19*Hideki is now known as Guest40274
02:56:27FromDiscord<dayl1ght> oh I had tabs in my source file and that affected the .toTable call somehow lol
02:58:44*Guest40274 quit (Remote host closed the connection)
03:00:24FromDiscord<Cerberus|The Enby> Can nim build a disassembler?
03:05:36FromDiscord<Rika> why not
03:05:56FromDiscord<bedwardly-down> Possibly. I mean any language can do pretty anything with the right design and will
03:06:06FromDiscord<bedwardly-down> Possibly. I mean any language can do pretty much anything with the right design and will
03:10:28FromDiscord<KingDarBoja> and patient, don't forget that
03:16:55FromDiscord<dayl1ght> is it possible to have stack-allocated objects with mutable fields? I'm getting the following error https://ghostbin.co/paste/nw3gu
03:17:16FromDiscord<Rika> no need to make them variable in the type
03:17:36FromDiscord<Rika> all fields are var if the type is instantiated in a `var`
03:17:45FromDiscord<Rika> fields immutable if in a `let`
03:17:48FromDiscord<dayl1ght> ah my full code had `let object = ...` so that was the problem
03:17:50FromDiscord<dayl1ght> thanks!
03:18:43FromDiscord<dayl1ght> is it possible to make _some_ of the fields immutable though?
03:18:49FromDiscord<Rika> no
03:18:54FromDiscord<Rika> well, technically
03:19:16FromDiscord<Rika> with accessor procs and the like then making the field itself not exported
03:19:21FromDiscord<Rika> within the same file, not at all
03:20:31leorize!repo nim-final
03:20:45FromDiscord<Rika> dead
03:20:51FromDiscord<Rika> rest in peace, disbot
03:23:42leorizenimble.directory is also dead federico3
03:25:01leorizehttps://github.com/Quelklef/nim-finals
03:25:04leorizehere it is
03:28:56FromDiscord<dayl1ght> nice!
03:33:00leorizethis module could probably use some updates
03:37:49*waleee-cl quit (Quit: Connection closed for inactivity)
03:38:32skrylar[m]interesting
03:38:56skrylar[m]i do on rare occasion wonder why nim doesn't have proper constness, but then usually shrug
03:41:25skrylar[m]in rust they have this pattern of builders where you have a sequence of mutable calls on the builder object, and then a "build" that gives you the final const-y version
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:09*silvernode joined #nim
04:06:40*supakeen joined #nim
04:06:48*audiofile joined #nim
04:06:58audiofilepmunch does your vim-lsp not work with ale?
04:07:02audiofileoh hes not here
04:07:05audiofilefrowny face
04:07:24audiofiles/vim/nim
04:08:34*chapl quit (Quit: leaving)
04:09:42Prestigeaudiofile: it should if ale supports lsp
04:10:19Prestigenimlsp just doesn't support a ton of features yet, and only evaluates the buffer on write
04:10:36Prestigebut you should get diagnostics and autocomplete, at least
04:14:03audiofileoh ok, I'll have to look into it then, thanks for confirming, Prestige
04:15:06PrestigeSure thing - fwiw I'm using coc-nvim and have it working. PMunch and I fixed a bug in nimlsp recently so make sure it's up to date as well
04:16:04FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae4584d898fe7a37615a25]
04:16:10FromGitter<bung87> what wrong with this?
04:16:29audiofileI've been hearing a lot about 'coc' what is it -- is it an lsp?
04:17:12Prestigeaudiofile: yeah, lsp client. It's pretty great but nothing is perfect
04:17:21PrestigeI prefer it to ale personally
04:18:07audiofilewhat am I missing?
04:18:44audiofilejust curious =)
04:21:59FromGitter<bung87> `expression 'await read(future)' has no type (or is ambiguous)`
04:22:26FromDiscord<Rika> its not an async proc?
04:22:47FromGitter<bung87> `asyncstreams.read: proc (future: FutureStream[read.T]): Future[tuple of (bool, T)]`
04:23:01FromDiscord<Rika> the callback proc
04:23:02FromDiscord<Rika> isnt
04:24:16FromDiscord<Rika> did that fix it?
04:26:25FromGitter<bung87> ok, I am trying
04:27:33disruptektonight's devel is still producing nil derefs in async.
04:28:27disrupteki'll run the bot w/o orc for now, i guess.
04:30:29FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae48e522f9c45c2a67941f]
04:39:45skrylar[m]after peering over some of the memory stuff in beef i guess i slightly understand newruntime better
04:40:04skrylar[m]i do kind of like the way they handle stack/arena allocators and pointer ownership
04:40:25*thomasross quit (Ping timeout: 264 seconds)
04:43:19FromGitter<bung87> `discard dest.writeFromStream(future)` solved
04:59:16*silvernode quit (Ping timeout: 246 seconds)
05:02:41Prestigeaudiofile: tbh I don't remember the differences, but it's worth checking out imo
05:31:41skrylar[m]https://media.discordapp.net/attachments/239881657908330499/706377233958174742/unknown.png not sure this was worth the effort :nervous:
05:37:08*NimBot joined #nim
05:40:16audiofile???
05:41:13Prestigewhat
05:48:39*kungtotte quit (Read error: Connection reset by peer)
05:49:35*kungtotte joined #nim
05:51:23FromGitter<bung87> ```Exception message: Empty deque. โŽ Exception type: [IndexError]``` โŽ โŽ any idea what causes this problem? [https://gitter.im/nim-lang/Nim?at=5eae5bdb22f9c45c2a67b181]
05:52:31*zacharyc2rter joined #nim
05:52:56zacharyc2rterhow do I deal with - is not GC-safe as it performs an indirect call and `--gc:arc`?
05:53:13audiofileno, I ??? that image by skrylar[m]
05:54:46skrylar[m]text engine in nim =p
05:55:05zacharyc2rterI guess there's now way to do this now? ughhhh
05:55:05zacharyc2rterhttps://github.com/nim-lang/RFCs/issues/142
05:55:07disbotโžฅ Proposal to remove the `.gcsafe` effect from Nim ; snippet at 12https://play.nim-lang.org/#ix=26qX
05:55:07audiofileyou mean like markove sentence generators?
05:56:46skrylar[m]no, knuth-plass linebreaking
05:58:18audiofileoh
05:58:39FromDiscord<Yardanico> @zacharyc2rter well you can use gcsafe in the proc body itself
05:58:45zacharyc2rteryeah it's just annoying
05:59:06FromDiscord<Yardanico> I know, it just needs to be disabled for arc/orc/boehm guess
05:59:11FromDiscord<Yardanico> Not sure how much work is that
05:59:54leorize[m]the ones with shared heaps can lax the requirements, but you can't fully remove it
06:00:04zacharyc2rteryeah
06:12:49FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae60e19f0c955d7d9f3035]
06:13:10FromGitter<bung87> `Exception message: No handles or timers registered in dispatcher. โŽ Exception type: [ValueError]` what's wrong with the code ?
06:20:48*NimBot joined #nim
06:20:51FromDiscord<Yardanico> This usually means that the future already completed and you're still trying to run global dispatcher
06:23:21FromDiscord<Yardanico> Or run that future
06:24:29*solitudesf joined #nim
06:25:15FromGitter<bung87> ok , let me think of it
06:30:24FromGitter<bung87> no idea, if I dont using `waitFor`, process finish before complete, if I using it error throw.
06:40:49FromGitter<bung87> using `copyFile` for now,just one line :(
06:42:13Yardanicoanyway you should never call waitFor in async procedures
06:47:49FromGitter<bung87> ok, I leave this for now,thanks
06:49:39*solitudesf quit (Remote host closed the connection)
06:53:00*chapl joined #nim
06:55:19*solitudesf joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:02:05*NimBot joined #nim
07:04:46*gmpreussner joined #nim
07:05:35FromDiscord<Rika> flatmap not in sequtils?
07:05:38FromDiscord<Rika> odd
07:10:31*zacharyc2rter quit (Ping timeout: 246 seconds)
07:11:28*zacharyc1rter quit (Ping timeout: 272 seconds)
07:11:28*zacharycarter quit (Ping timeout: 272 seconds)
07:20:24*chapl quit (Quit: Leaving)
07:46:14*idf joined #nim
07:46:39*zacharyc1rter joined #nim
07:46:39*zacharycarter joined #nim
07:46:40*zacharyc2rter joined #nim
07:50:32AraqI don't understand open source software
07:51:22*zacharyc1rter quit (Ping timeout: 272 seconds)
07:51:23*zacharycarter quit (Ping timeout: 272 seconds)
07:52:00*zacharyc2rter quit (Ping timeout: 272 seconds)
07:52:35Araqso now the obsolete, unsupported -d:useWinAnsi switch got bugfixes :-)
07:54:28Araqmaybe Windows RT only supports the ansi versions?
07:56:30Zevvdon't unsupport or obsolete, just throw it out already!
07:57:32*gangstacat quit (Ping timeout: 265 seconds)
07:59:25Araqwell it is useful to the one guy who now maintains it
07:59:35Araqit is fine
08:21:37*Vladar joined #nim
08:23:31skrylar[m]Zevv: no, bad. *hits with newspaper*
08:23:39skrylar[m]you can only delete stuff after its been deprecated a cycle
08:25:21Araqskrylar[m]: it's been deprecated for a long time and it's not documented anymore, but maybe there is a reason it got PRs
08:25:50Araqas I said, iirc Windows RT is built upon the ansi char versions
08:27:01*zacharyc1rter joined #nim
08:27:01*zacharycarter joined #nim
08:27:02*zacharyc2rter joined #nim
08:27:32Araqzacharyc1rter: your problem is easily solved with a ``{.gcsafe}: ...`` block
08:31:40*zacharyc2rter quit (Ping timeout: 256 seconds)
08:31:40*zacharyc1rter quit (Ping timeout: 256 seconds)
08:31:40*zacharycarter quit (Ping timeout: 256 seconds)
08:46:38*Vladar quit (Quit: Leaving)
08:58:04*letto quit (Quit: Konversation terminated!)
09:02:59*dddddd joined #nim
09:06:10*letto joined #nim
09:07:17*Vladar joined #nim
09:09:20FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae8a407a24ff01b0fb4676]
09:09:30FromGitter<bung87> what's wrong with this code?
09:10:05Yardanicoyou're discarding a future
09:10:21Yardanico"discard src.readToStream(destStream)" should be "await src.readToStream(destStream)"
09:10:32FromGitter<bung87> but await , waitFor also not wrok
09:10:35Yardanicoor if you don't want to wait for completion, asyncCheck
09:10:42Yardanico@bung87 well discard is wrong here anyway
09:11:13FromGitter<bung87> `template/generic instantiation of `await` from here`
09:11:29Yardanicogive full error from the compiler itself please
09:11:51FromDiscord<Recruit_main707> i remember this
09:11:56FromGitter<bung87> I only have `copyFile ` one solution, I just want figure it out
09:12:42FromGitter<bung87> `Error: Await only available within .async`
09:13:13FromGitter<bung87> editor also mark `{.async.}` as error
09:13:54Yardanicoi don't need editor
09:14:02Yardanicoplease post full output from the compiler itself when trying to compile this example
09:15:29FromGitter<bung87> ok let me find some place to paste
09:16:23FromGitter<bung87> https://pastebin.com/0ddTUxgs
09:16:44FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae8bfcadb0ec5c2be04f62]
09:20:14FromGitter<bung87> full code is here https://github.com/bung87/icon/blob/master/src/iconpkg/favicon.nim
09:25:08*lritter joined #nim
09:31:00*gangstacat joined #nim
09:31:47FromGitter<bung87> oh, I solved it
09:43:35*audiofile quit (Quit: Going offline, see ya! (www.adiirc.com))
10:40:25FromGitter<jorjun_twitter> beginning to adore this language. My current thankyou is to send a link to great new English musick. Later when I know more I will try to help out.
10:40:25FromGitter<jorjun_twitter> https://www.youtube.com/watch?v=IoVqSk4cloI
10:45:15*zacharycarter joined #nim
10:45:16*zacharyc1rter joined #nim
10:45:17*zacharyc2rter joined #nim
10:49:52*fredrikhr joined #nim
10:51:20*sz0 quit (Quit: Connection closed for inactivity)
10:54:18skrylar[m]alright i forgot there was a clever trick to this. coded it in and now things work okay.
10:58:20Yardanicoi guess that's a good enough documentation :P https://yardanico.github.io/nim-mathexpr/mathexpr.html
10:58:52Yardanicoapparently github pages won't display any files unless you set a default jekyll theme (even if you're not using one) lol
11:16:47Yardanicowow I didn't know using the VM in custom code was so easy https://forum.nim-lang.org/t/6287
11:17:44AraqYardanico: awaiting your bug report :-)
11:18:27YardanicoAraq: well I tried to minimize it a bit, only got to the point where I made the output of the async macro work (expandMacros and then removing gensym things and some other fixes)
11:18:48Yardanicoit still depends on quite a lot of stuff and quite big (~600 loc), and most of all it depends on the network
11:19:26Araqsubmit it anyway I'm bored and it's Sunday
11:19:49Yardanicowait I thought today was monday lol
11:20:16Yardanicoit's https://gist.github.com/Yardanico/0b5fd6a630bb2a99ba2dce320a9a0d05, IDk if you would prefer the original async version or this one
11:20:38Yardanicothis one doesn't use the async macro and only needs asyncdispatch for the dispatcher (and asyncfutures for futures)
11:21:28Yardanicowith default GC it connects to #nim-test without issues, with arc/orc it either stops executing after "No ident response" (exists with 0 exit code) or throws an error "Exception message: File descriptor not registered."
11:21:38Yardanico*exits
11:25:05Yardanicowell ofc it's due to sink inference as well (it works without it)
11:27:25Araqwell the sinkInference exposed bugs but is usually not the root cause
11:27:34Yardanicooh
11:28:20Araqsee my tests, I used 'sink T {.nosinks.}' in your other bug report to trigger the same bug
11:28:40Yardanicoohh
11:29:07YardanicoI'll try poking random procs with {.nosinks.} :P
11:29:26Araqawesome, thanks
11:33:30federico3leorize: looks pretty alive to me ;)
11:35:22AraqYardanico: I get
11:35:26YardanicoAraq: seems like adding nosinks to wasBuffered solves the issue
11:35:30Araq[":beckett.freenode.net NOTICE * :*** Looking up your hostname..."]
11:35:30Araq[":beckett.freenode.net NOTICE * :*** Checking Ident"]
11:35:30Araq[":beckett.freenode.net NOTICE * :*** Found your hostname"]
11:35:32Araq[":beckett.freenode.net NOTICE * :*** No Ident response"]
11:35:42Yardanicoyeah after that it hangs and then exits with exit code 0 or crashes
11:35:53Yardanicowith default GC it further connects to the channel #nim-test
11:35:56Araqah ok, it took a while but now it crashed
11:36:23Yardanicoyeah I checked, wasBuffered with {.nosinks.} makes it work for some reason
11:36:34Yardanicoah wait no
11:36:40Yardanicomaybe not it, I have nosinks in a few other places too
11:37:20Yardanicoah no, after all it really is wasBuffered
11:40:36Araqsame here, seems to work with .nosinks for wasBuffered, how strange
11:40:44AraqwasBuffered is pretty simple
11:41:00dom96cool, thanks for looking at fixing IRC with orc
11:41:14Yardanicodom96: well it already works with --sinkInference:off :P
11:41:30Araqwe want sink inference though, it's excellent
11:41:44dom96Next step, test nimforum? :)
11:42:02YardanicoAraq: well adding nosinks to "send" (which is just below the wasBuffered) instead of wasBuffered solves it too
11:42:02Araqand you can always trigger the same bugs with explicit 'sink T' anyway
11:42:25AraqYardanico: yeah I see it, send is also getting 'sink' inference otherwise
11:42:52dom96what does `sink` mean again?
11:42:53*abm joined #nim
11:43:18Araqdom96: "I am stealing this parameter"
11:44:50Yardanicobtw my old social network bot seems to work with orc, although it only uses async httpclient for async stuff
11:45:08Araqfor example, put(h: var Table; key: sink K; value: sink V) # h takes over the (key, value) pair
11:45:41Araqyou don't have to use it, but it can make the code faster
11:46:07dom96takes it over in what sense? any docs on this?
11:46:13Yardanicohttps://nim-lang.org/docs/destructors.html#sink-parameters
11:46:28Araqdom96: it was part of my fosdem talk too
11:46:32Yardanicobasically it doesn't make a copy I guess
11:46:37Yardanicoor something like that
11:47:52dom96ahh, so it ensures that the calling code does not modify those parameters
11:47:56Araqit's about moving things into the right place rather than copying them, yes
11:48:31dom96so what happens if I write var x = 42; table.put("foo", x); x = 52?
11:48:39Araqdom96: no, "mutability" doesn't play a role here
11:48:49Yardanicodom96: it'll work as expected
11:48:52*zacharyc2rter quit (Ping timeout: 258 seconds)
11:48:52*zacharyc1rter quit (Ping timeout: 258 seconds)
11:48:52*zacharycarter quit (Ping timeout: 258 seconds)
11:49:05Yardanicobecause control flow analysis will understand that you still need x afterwards :P (my guess)
11:49:17Araqdom96: it's then turned into table.put("foo", copyof(x))
11:49:45dom96so `sink` enables this analysis?
11:49:50Yardanicoor automatic sink inference
11:49:54dom96i.e. if no `sink` is specified we always get `copyof`
11:49:54Yardanicowhich is enabled by default
11:50:07dom96(assuming `sink` is not inferred)
11:50:13Araqdom96: not quite... :-)
11:50:26*filcuc joined #nim
11:50:37dom96explain :)
11:50:48Araqif you don't have the 'sink', inside the *body* of 'put' the copy has to be made
11:51:17Araqbut if you have the 'sink' the compiler can the copy into a move inside the body of 'put'
11:51:47Yardanico"As a nice bonus, files and sockets and the like will not require manual close calls anymore." btw this will be added to stdlib right?
11:51:51Yardanicoeven for stuff like HttpClient
11:52:06Yardanicoso we don't need to close it explicitly :P
11:52:14Araqbut this move must be sound, so the caller must ensure it's not used afterwards. if it is used afterwards then the 'copyof' kicks in, saving the soundness of the design
11:53:09Araqin the end, the copies bubble up to the places where they really are required and we end up with the minimal amount of required copies
11:53:10dom96so we annotate the types, but what matters is when that parameter is used in the body
11:53:18dom96or do we annotate it with `sink` in the body too?
11:54:13Araqno, 'sink' is only for parameters
11:54:19Yardanicodom96: there's also "lent" btw
11:54:40Araqand also, the inference ensures that you don't have to do anything, the compiler does it all for you
11:58:14AraqYardanico: we are also getting 'lent' inference :P
11:58:20Yardanicolol
11:59:58*fredrikhr quit (Read error: Connection reset by peer)
12:00:17YardanicoAraq: also is there a reliable way to check if orc leaks memory or not? do GC_fullCollect() at the end of the program and -d:useMalloc ?
12:00:22*fredrikhr joined #nim
12:00:45Araqyeah but the async event loop leaks memory
12:00:49Yardanicooh
12:01:02Araqas it creates a large seq in a thread local variable iirc
12:01:24Araqdom96 can fix it for us :-)
12:01:29Yardanicohah
12:01:46dom9690% sure I wasn't the one who added whatever large seq you're talking about :P
12:01:53AraqI know
12:01:57dom96maybe we should ask the person that did to fix it? :D
12:02:06Yardanicoorc with async with threads
12:02:13Yardanicothe ultimate dream is near
12:02:30Araqdoesn't have to be fixed, only needs an API 'nukeSelectors'
12:02:31dom96you'll still need a way to await channels/FlowVars afaik
12:02:57dom96Araq, but why would this seq leak, it surely doesn't grow forever?
12:03:20Araqdom96: right but it does make things harder to measure
12:03:39AraqYardanico: I'm using
12:03:42Araqproc wasBuffered(irc: Irc; message: sink string; sendImmediately: bool): bool
12:03:42Araqproc send(irc: Irc; message: string; sendImmediately = false): Future[void] {.nosinks.}
12:03:52Araqand it's also stable with that variation
12:04:24Yardanicoyeah works for me too
12:05:38Araqbbl
12:05:54dom96Araq, how so? You can still get the memory usage and if it grows you've got a leak
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:40*supakeen joined #nim
12:11:02FromDiscord<Recruit_main707> can you manually manage memory with arc to avoid leaks with async? (its just hypothetical, i am not using async yet)
12:11:15Yardanicothat would be really complicated
12:11:34Yardanicoyou clearly haven't seen output of the async macro with all of its iterators and closures (it's cool, but it's not that easy :P)
12:18:13*PMunch joined #nim
12:19:14dom96it's a fair question
12:19:45dom96AFAIK the problem is with the fundamental building blocks of async: iterator closures
12:20:32*sagax quit (Quit: Konversation terminated!)
12:20:49*sagax joined #nim
12:24:28Yardanicoseems like ircord is relatively stable, it can run for 2 days straight (the current one runs in #nim-offtopic for since 1th of May from 16:00)
12:24:37Yardanicoand when it crashes it's easy to restart with a script :P
12:24:53FromDiscord<Recruit_main707> good job :)
12:25:12Yardanicowell setting intents and fixes in dimscord itself helped that quite a lot
12:26:00Yardanicolast crash was maybe due to my PC losing internet connection or something (yes it still runs on my PC, the PC already has a 10 day uptime lol)
12:26:12Yardanico"Error: unhandled exception: Device or resource busy" "Additional info: "No address associated with hostname" [OSError]"
12:30:20leorize[m]getaddrinfo crashing again lol
12:30:56leorize[m]ignore the errno, it's not supposed to make sense for that error
12:31:21Yardanicowell it seems to be related to websocket lib "Error while reading websocket data ::"
12:32:16*xcm_ quit (Remote host closed the connection)
12:33:59*Vladar quit (Quit: Leaving)
12:34:31*xcm joined #nim
12:37:04*zacharyc1rter joined #nim
12:37:04*zacharycarter joined #nim
12:37:05*zacharyc2rter joined #nim
12:37:12zacharycartermorning
12:38:30Yardanicowhy do you have 3 IRC accounts? :D
12:39:33zacharycarterI have lost tmux sessions I think
12:39:37zacharycarterand they're probably still connected to irc lol
12:40:04zacharycarteror I guess one still is at least
12:40:07zacharycarterbut at least I got my nick back!
12:40:24Yardanicowell register it on freenode to not lose it :P
12:40:26zacharycarterI'm almost ready to show off this fiber based job system
12:40:30zacharycarteroh I am registered
12:41:03zacharycarterit's just the account was still connected so it changed my nick to zacharyc1rter or whatever
12:41:24FromDiscord<Joshua S. Grant> Is discord's offtopic channel and #nim-offtopic bridged? It doesn't seem like it
12:41:30zacharycarterno they'r enot
12:41:42zacharycarterI think gitter and Nim are though
12:41:58Yardanicothey are
12:42:01zacharycarteroh
12:42:29FromGitter<sheerluck> I'm in gitter
12:42:43YardanicoI run ircord on my own PC right now which bridges #nim-offtopic with discord
12:42:52Yardanicofor debugging/testing stuff
12:48:22FromDiscord<KrispPurg> Yardancio, what is your common WS Error.
12:48:35FromDiscord<KrispPurg> Yardancio, what is your common ws Error?
12:48:36YardanicoError while reading websocket data :: socket closed
12:48:42FromDiscord<KrispPurg> Ah
12:48:49Yardanicoa lot of times there's also "An error occurred while parsing data: ๏ฟฝ" but it doesn't seem to crash with that
12:49:07FromDiscord<KrispPurg> I am aware of that one.
12:49:29livcdYardanico: oh so in theory we can own you through ircord right now!
12:49:37Yardanicowat?
12:49:53FromDiscord<KrispPurg> wut
12:51:49FromDiscord<KrispPurg> Also, I fixed a bug of ratelimits for shards that over 2, now. (The commit hasn't been pushed yet.)
12:52:15*badge joined #nim
12:53:34Yardanicowhat happens if we compile nim compiler with LTO and PGO? hmm
12:53:47Yardanicowell for PGO we'll use compiler itself to generate profiled data
12:54:14*badge quit (Remote host closed the connection)
12:56:55Yardanicolinking takes quite a while as expected :P
13:00:13livcdhttps://github.com/christianscott/levenshtein-distance-benchmarks
13:00:19livcdhttps://www.christianfscott.com/making-rust-as-fast-as-go/
13:00:38Yardanicowat
13:00:51Yardanico"making-rust-as-fast-as-go" did i read that correctly
13:07:01livcdTLDR: default osx mem allocator that Rust uses is slower than Go's allocator
13:07:17*PMunch quit (Quit: leaving)
13:13:42leorizeYardanico: I'd not recommend PGO though
13:13:59*fredrikhr quit (Read error: Connection reset by peer)
13:14:11leorizethe nim compiler doesn't do that much metaprogramming
13:14:23leorizefor quality profiles compile some of mratsim's projects
13:14:25*fredrikhr joined #nim
13:14:39Yardanicooh
13:14:45Yardanicoso I guess the VM will benefit a lot from PGO?
13:14:51Yardanicowell yeah that's understandable
13:15:10Yardanicothat's why most interpreted languages ship binaries with PGO :P
13:21:33disruptekdisbot: you alive?
13:21:34disbotyep. ๐Ÿ˜Š
13:21:53Yardanico#14159
13:21:55disbothttps://github.com/nim-lang/Nim/issues/14159 -- 5[ARC] Segfault with cyclic references (?) ; snippet at 12https://play.nim-lang.org/#ix=2k4U
13:21:56Yardanicoyay
13:22:16Yardanicodisruptek: you alive?
13:22:42disruptekthe bot crashes with orc and sinkinference off.
13:22:47disruptekbbiab
13:23:11Yardanicowow
13:25:46*filcuc quit (Ping timeout: 272 seconds)
13:55:46*tane joined #nim
13:57:19disruptekAraq: i could use some direction today.
13:59:51*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
14:00:21*ehmry joined #nim
14:02:12ZevvI could use some direction in my life, in genal
14:02:14Zevvgeneral
14:02:23disruptekzevv, you're back
14:02:52ZevvI was never away
14:03:46disruptekhow are you holdin' up in the midst of this pandemic?
14:04:14disruptekit must really chaffe your ass that you cannot mingle with the throngs at the shops.
14:04:45Zevvoh well, life is not too different from usual I guess. I kind of stopped being social long ago, working from home has always been part of my life. So hey, it could be worse.
14:04:55ZevvI do miss concerts and making music the most I think
14:05:06FromGitter<Bennyelg> Hi @dom96 Can I how can I wrap the resp object in jester ?
14:05:12Zevvalthough I do the latter online these days
14:05:34Yardanicowdym by that @Bennyelg
14:07:27disrupteklemme hear your music.
14:09:01Zevvit's volatile
14:09:07Zevvit plays and then its gone
14:09:16disrupteki'm okay with that.
14:09:59zacharycarterI have an emit statement at the top of a module that emtis some C code and then I have an object that I bind to that type via importc
14:10:17zacharycarterwhen I compile though, I get an error about the c type being unknown from stdlib_system.nim.c
14:10:25zacharycarterdafuq? why is a reference to that type in that file?
14:10:28*fredrikhr quit (Read error: Connection reset by peer)
14:10:44Yardanicozacharycarter: maybe you pass your object to some template or something like that from system
14:10:50zacharycarterhmmm
14:10:52*fredrikhr joined #nim
14:10:59leorizemaybe don't use emit? :P
14:11:25zacharycarteradd a way to add volatile qualifiers to types and I will :P
14:11:39zacharycartercan we just make codegenDecl work with types too?
14:11:43zacharycarterthat would solve all my problems
14:13:15dom96Bennyelg: not sure what you mean by "wrap"
14:15:08leorizezacharycarter: what are you using volatile for?
14:15:08disruptekzacharycarter: make an issue, it might be something in my neck of the woods.
14:16:02disrupteki would need a test, though.
14:16:41zacharycarterleorize - to mark the C type as volatile which to my understanding tells the compiler that its value can be changed legitimately by something beyond the program's control like a concurrently executing thread
14:16:56zacharycarterit'd also be nice for adding attributes to typedefs like alignment attributes
14:17:24zacharycarterto declare minimum alignment for types
14:17:38zacharycarterdisruptek: it probably needs to go through an RFC first right?
14:17:52zacharycartermaybe Araqq would have reservations
14:17:56disruptekideally. maybe someone has a workaround.
14:18:00leorize{.align.} is already a thing?
14:18:04disrupteki'm thinking it's a pragma.
14:18:07zacharycarterbut it doesn't work for types
14:18:15zacharycarteronly procs and member variables - which is fine
14:18:26zacharycartererr sorry member properties and variables
14:18:35*filcuc joined #nim
14:19:04zacharycarterI'm fine with not having {.align.} and {.volatile.} for types - but I should at least be able to modify the generated C code for them I think
14:19:26leorizewell RFC then :P
14:19:31zacharycarterokay :)
14:21:47leorizethough I'm not sure if volatile is the solution to your problem
14:22:49leorizeactually I'm not even sure what's the problem :P
14:25:29zacharycarterWell my original complaint was that my emitted code is being referenced in a system source file.
14:25:52zacharycarterI'm marking an int32 alaias as volatile because I'm using it in atomic builtins
14:25:59*PMunch joined #nim
14:26:32FromGitter<Bennyelg> how can I avoid something like this: โŽ import ../models/model1 โŽ import ../db_models/model1 โŽ import ../utils/utils [https://gitter.im/nim-lang/Nim?at=5eaed4987a24ff01b0fbdf58]
14:26:43Yardanico?
14:26:49Yardanicohow would you like it instead?
14:26:53leorizezacharycarter: shouldn't you be able to use atomic without volatile?
14:26:53zacharycarterlike - `__sync_lock_test_and_set`
14:26:59FromGitter<Bennyelg> I'll explain the problem:
14:27:34zacharycartertwo threads might share the volatile int though
14:27:43FromGitter<Bennyelg> create router with jester and import some models there.. โŽ go outside and create the route: with all the routes and extend model1, "/"
14:28:01zacharycarterbut sure I guess I can
14:28:15zacharycarterI don't think anything will blow up if I dont' mark the type alias as being volatile
14:28:19FromGitter<Bennyelg> you get error since functions are not there (but they are - its probably an import errors)
14:28:21leorizezacharycarter: the edits inside same program doesn't need volatile afaict
14:28:25disruptekdon't actually make a pr to rfcs; just create an issue.
14:28:43leorizeyou need volatile when nothing even try to touch that variable and it can still change :)
14:29:08leorizeI might be wrong though :P
14:29:16zacharycarterhmm yeah I'm not 100% sure either
14:29:22FromGitter<Bennyelg> you get something like: โŽ /Users/benny/DLM/backend/src/routes/model1.nim(10, 33) Error: undeclared identifier: 'getModel1'
14:29:29zacharycarterI'll do more research - in a lot of example code i read online though they're using volatile
14:29:32zacharycarterbut a lot of example code is wrong too
14:29:33FromGitter<Bennyelg> but if you compile the file directly - all passes
14:30:20leorizethough this is the kind of thing you'd use memory barriers on
14:30:40leorizevolatile is a bit too broad and will prevent certain optimizations
14:32:26*silvernode joined #nim
14:32:28zacharycarterokay yeah that makes sense could be more precise with types of barriers
14:32:37zacharycarterneed to take the doggos out for a walk, bbl
14:33:25dom96Nim in Action is 50% off today in case anyone wants to grab a copy: https://book.picheta.me
14:34:28Yardanicoi will :P (yes I still haven't bought it)
14:34:49Yardanicowant a printed book about nim
14:34:52*xcm quit (Remote host closed the connection)
14:35:01dom96awesome
14:35:02FromDiscord<Recruit_main707> 25 bucks is something i might be able to afford
14:36:19*krux02 joined #nim
14:36:19dom96also, likes and RTs on my tweet appreciated, I wonder if I can beat a similar tweet about Rust in Action :P
14:36:42*zacharyc1rter quit (Ping timeout: 272 seconds)
14:37:04*xcm joined #nim
14:37:20FromGitter<Bennyelg> ```code paste, see link``` โŽ โŽ failed with the reason of undeclared identifier but when I run r1 individually it compiled and all right โŽ any helpp [https://gitter.im/nim-lang/Nim?at=5eaed72022f9c45c2a68a103]
14:37:20*zacharyc2rter quit (Ping timeout: 272 seconds)
14:37:20*zacharycarter quit (Ping timeout: 272 seconds)
14:37:30Yardanicoalthough shipping to Russia costs quite a bit with manning, but it's ok I guess :P
14:37:54Yardanico$35 total ($10 shipping to Russia lol :P)
14:38:11leorizeone day I'll have the money to buy it :P
14:38:16*Vladar joined #nim
14:38:30dom96Yardanico, is amazon operating in Russia?
14:38:37Yardanicodom96: kinda yes
14:38:50YardanicoI mean there's no russian amazon
14:38:59Yardanicobut you can order from other countries' amazon websites to ship to russia
14:39:09dom96might be worth checking if it's cheaper that way
14:39:17dom96I've seen it much cheaper in UK amazon for example
14:39:21*thomasross joined #nim
14:39:27Yardanicocan't ship to russia from UK amazon for some reason :P
14:39:45supakeenPfft Russians are much more inventive.
14:39:51Yardanicoand anyway I already paid for it, now comes the wait :D
14:40:10supakeenI often get the option 'we can ship from $nearest-eu country for 5 dollars more'.
14:40:10Yardanicowell I mean I can access the ebook right away
14:40:19supakeenAnd then I guess they drive over the border and ship it from there.
14:40:54supakeenIt's much faster than goign through customs.
14:41:39supakeenThings shipping from Ukraine or Russia always take forever otherwise :(
14:42:33Yardanicomy biggest international order was my PC (3700X with wraith prism + mobo + 16gb ram) from Germany (computeruniverse)
14:42:48Yardanicoit's cheaper because I didn't have to pay for 20% russian VAT lol
14:43:01supakeenHehe.
14:43:11supakeenI order a lot of ex-Soviet electronics on ebay.
14:43:18leorize[m]the german didn't tax you or do they tax less? :p
14:43:24Yardanicothey didn't tax me
14:43:28Yardanicosince i'm not from EU
14:43:43Yardanicoalthough some european stores already add russian VAT (and it's kinda required, idk why CU doesn't do that)
14:43:50Yardanicofor example hetzner already does 20% russian VAT automatically
14:44:12supakeenprobably depends if they have a russian entity as well?
14:44:13leorize[m]you get to abuse it while you still can :p
14:44:27supakeen(or did enough business with russians to figure it out)
14:44:56leorize[m]probably because too many used the loophole
14:45:18Yardanicowell that "loophole" if you call it that was around for at least 6 years
14:45:53leorize[m]where I'm from they just close the loophole with a huge import tax :)
14:46:43supakeenyea over here if i send stuff to outside-the-EU i only need to register it as export
14:46:49supakeenthe rest of it is up to the receiving country
14:46:59supakeenif they don't check incoming packages/do other stuff hey no taxes
14:47:03Yardanicowell yeah we have import tax in russia too
14:48:18Yardanicoand before 1st january 2020 it was 30% if you order something over 500 euro
14:48:24supakeenthat's steep
14:48:45Yardaniconow it's 15% if you order over 200 euro
14:49:02supakeenwe pay no import fees and vat for things under 25, no import fees but vat for up to 150, over 150 you pay both
14:49:22supakeenand this only applies to things coming from outside the EU
14:49:31supakeenbecause those are all exempt from everything :p
14:49:44Yardanicowell before 1st january it was 500 euro limit _monthly_ for all your orders
14:49:55Yardaniconow it's individual so you can order as many 199 euro deliveries as you want
14:50:14Araqso ... if you think C++ templates are misdesigned junk because they are Turing complete, here is the bad news: https://arxiv.org/pdf/1605.05274.pdf
14:50:28supakeeni see a new business here, drop shipping for russia by splitting shipments to fall below the limit
14:51:43leorize[m]Araq: lol
14:54:30YardanicoAraq: what about Nim? :P
14:54:47Yardanicowell i guess there's no need to question that since we already have a compile-time VM :P
14:54:58Yardanicobut I just wonder about generics/static
14:55:06leorize[m]it's turing complete until you hit a generics bug
14:55:06FromGitter<Bennyelg> @Yardanico https://github.com/dom96/jester/issues/178 this is the bug - I wanted to open one but found an issue (2018)
14:55:07Araqit's probably both undecidable and unsound, just like Java.
14:55:48leorize[m]@Bennyelg: put everything in a template, then call that template in the router
14:56:05leorize[m]we should probably implement that in jester too
14:56:17Araqhttps://docs.microsoft.com/en-us/archive/blogs/ericlippert/lambda-expressions-vs-anonymous-methods-part-five
14:58:45*Vladar quit (Quit: Leaving)
14:59:05disruptekAraq: mumble?
14:59:31Araqdisruptek: I'm on the wrong computer fro mumble, what's up?
15:00:15disruptekso the sealing is done, i guess. now i need to figure out how the backend works.
15:00:30disruptekwe just let it mutate locations? or move those into a new backend ast?
15:00:57disrupteknot sure how ambitious you want the next step to be.
15:01:35disruptekthe caching is a state machine now, which feels much more workable.
15:05:56Araqdon't touch the backend, the backend should read the database and keep doing what it always did
15:06:15FromGitter<Bennyelg> not exactly followed, can you show me a quick example ?
15:06:17disruptekthe problem is in the backend, though, afaik.
15:06:36disruptekjust let it do whatever?
15:06:42Araqyeah
15:06:47disruptekokay
15:06:50Araqdon't cache snippets or anything like that
15:06:56*liblq-dev joined #nim
15:06:56disrupteklemme get this working, then.
15:07:08disrupteki wanna gut loc so bad.
15:07:28Araqit's only the backend, we all know it sucks
15:07:44Araqif you want to, give it a decent IR
15:08:09leorizequestion: should I create multiple API for different kinds of process execution?
15:08:12disruptekyeah, lemme make it work then i'll make it correct.
15:08:35leorizecurrently I'm having an `exec()` API that takes the process configuration DSL and execute the process accordingly
15:08:54leorizebut then there are use cases like only caring about the output, exitcode, etc.
15:09:42leorizeshould I make more API or should I add something like: `capture(output)` to the DSL?
15:10:01FromDiscord<treeform> When did nim's error messages get this good? `Error: the syntax for tuple types is 'tuple[...]', not 'tuple(...)'
15:10:39FromGitter<Bennyelg> I triied this:
15:10:46FromGitter<Bennyelg> ``````
15:10:47FromGitter<Bennyelg> ``````
15:10:49FromGitter<Bennyelg> import jester โŽ import ../utils/util โŽ โŽ template tp*(body: untyped): untyped = โŽ ... [https://gitter.im/nim-lang/Nim?at=5eaedef87a24ff01b0fbf438]
15:10:56FromGitter<Bennyelg> `````` [https://gitter.im/nim-lang/Nim?at=5eaedf00adb0ec5c2be0f718]
15:11:50*zacharyc1rter joined #nim
15:11:50*zacharycarter joined #nim
15:11:51*zacharyc2rter joined #nim
15:12:35leorizeBennyelg: looks like the indentation is all broken
15:14:01Araqtreeform: when the survey told us to make them better
15:15:20*Vladar joined #nim
15:16:36*zacharyc2rter quit (Ping timeout: 256 seconds)
15:16:36*zacharyc1rter quit (Ping timeout: 256 seconds)
15:16:36*zacharycarter quit (Ping timeout: 256 seconds)
15:19:40*filcuc quit (Ping timeout: 256 seconds)
15:20:46FromDiscord<treeform> Survey did good
15:26:38*zacharyc1rter joined #nim
15:26:38*zacharycarter joined #nim
15:26:38*zacharyc2rter joined #nim
15:34:48Araqleorize: make the API complete with streams etc and then add a simple DSL on top of the API
15:34:56Araqdon't do things that only the DSL allows
15:35:15leorizeyea I have that planned
15:35:22leorizetoo bad we don't have an async version of streams
15:35:35leorizeand the name asyncstreams has been taken for something completely unrelated
15:39:36Araqwhen we wrote it, we thought these are async streams :P
15:39:57disrupteklol
15:42:12dom96"Its api is still experimental and so is subject to change"
15:42:30dom96and "Unstable api" in the docs
15:42:40dom96means backwards compat rules don't apply
15:42:54dom96(Don't really see much of a reason why what exists can't be kept for backwards compat though)
15:43:07Yardanicowell same goes for "endians" but if you suddenly change its api some packages will break :P
15:43:16Yardanicowonder why endians is "unstable api" though
15:43:25leorizecan we import chronos's asyncbuffers and friends? :P
15:44:06Araqleorize: try it
15:45:07*chapl joined #nim
15:56:27*liblq-dev quit (Quit: WeeChat 2.8)
16:05:43*chaplchapl joined #nim
16:08:22Yardanicohttps://github.com/loloicci/nimly was really surprised to find out it's GPLv3 :P
16:09:18Yardanicobtw, just a question - what would be the license of the code generated by the macro which is a part of a GPLv3 library?
16:09:20Yardanicoin nim
16:10:39*PMunch quit (Quit: leaving)
16:10:57FromDiscord<mratsim> I suppose you can refer to GCC which is GPLv3 and can generate assembly from MIT code.
16:12:55AraqYardanico: ask nimly's author but usually code generators have no influence on the license
16:13:14Yardanicowell seems like nimly was initially under MIT but then the author made it GPLv3 :P
16:13:18Yardaniconot that i need to use it though
16:13:28Araqit can only be different for code you need to compile/link with your code
16:13:33Yardanicoah ok
16:14:05Araqif your code A is in MIT and you run it through an obfuscator/macro/compiler it's still MIT afterwards
16:14:13AraqI think...
16:14:45leorize[m]gcc license permits it to be used without changing whatever it consumes into GPL
16:14:53leorize[m]however the AST from gcc is GPL :)
16:15:50leorize[m]https://www.gnu.org/licenses/gpl-faq.html#OOPLang
16:15:53Yardanicolol
16:15:54leorize[m]^ might be related
16:17:49Yardanicoit's nice when searching for "lexbase" in google the nim docs is 4th result (although google knows about what I search so my results are biased)
16:19:41FromGitter<Bennyelg> :/
16:21:52disrupteki'm streaming, btw
16:21:54disruptek~stream
16:21:54disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
16:22:27Yardanicoyour titles are getting increasingly creative
16:29:59*abm quit (Read error: Connection reset by peer)
16:33:34FromGitter<Bennyelg> I modify jester code, how do i re-compile and make my in version to run with it ?
16:33:58Yardanico"nimble develop" in the folder with your modified jester is the simplest way
16:42:28*nsf joined #nim
17:04:43*chaplchapl quit (Remote host closed the connection)
17:04:43*chapl quit (Remote host closed the connection)
17:11:49dom96I created a gamedev channel on Discord in case anyone is interested in joining :)
17:12:15YardanicoI can try to bridge it to the same #nim irc
17:12:18Yardanicoor no?
17:12:34Yardanicoor maybe bridge to #nim-offtopic instead
17:13:30FromDiscord<Recruit_main707> or just use discord and accept that irc is dying :P
17:13:41Yardaniconot gonna happen anytime soon
17:14:01dom96nooo
17:14:08dom96don't bridge
17:14:13dom96this one is Discord-only
17:14:16Yardanicolol ok
17:14:23YardanicoI see what you're trying to do dom96 :P
17:14:28FromDiscord<Recruit_main707> its free premium
17:15:18leorize[m]dom96: can I bridge it with matrix then? :P
17:17:17*Jesin quit (Quit: Leaving)
17:23:51*Jesin joined #nim
17:27:31Araqdom96: discord? why not telegram?
17:27:52*vqrs quit (Ping timeout: 260 seconds)
17:28:53FromDiscord<Chiqqum_Ngbata> I tried a direct translation of the python/go code here just for fun and nim didn't perform well https://github.com/christianscott/levenshtein-distance-benchmarks
17:29:25*vqrs joined #nim
17:29:44FromDiscord<Recruit_main707> -d:release and gc:arc?
17:29:44Yardanicoshow the code
17:29:48Yardanico-d:danger *
17:30:11FromDiscord<Chiqqum_Ngbata> Yeah, I added all the fixin's
17:30:35Yardanicowell show the code :P
17:30:48Yardanicoas a paste
17:31:33FromGitter<Willyboar> It would be nice to have specific channel for game, desktop, web etc
17:32:27FromDiscord<Chiqqum_Ngbata> Paste inbound. go: 1.772757 javascript: 7.016 nim: 4.774278109 rust: 2.154426004
17:32:58*fredrikhr quit (Read error: Connection reset by peer)
17:33:25*fredrikhr joined #nim
17:35:09Yardanicoand did you see https://nim-lang.org/docs/editdistance.html
17:35:27leorize[m]gimme code and it will be as fast if not faster that the fastest :p
17:35:31FromDiscord<Chiqqum_Ngbata> https://play.nim-lang.org/#ix=2kE3
17:38:18FromDiscord<Chiqqum_Ngbata> Like I say, it's a translation of the go/python which doesn't seem very optimal either.. I'll look at editdistance for fun
17:41:03FromDiscord<Varriount> @Chiqqum_Ngbata If I had to guess, it's doing lots of string slicing and assignment
17:44:23FromDiscord<Chiqqum_Ngbata> Yeah, editdistance makes it faster than the rest by a healthy margin
17:45:13leorizewhy does it have to be run via node...
17:45:15leorizeI don't have node
17:45:31leorizefine I'll just optimize the nim version :P
17:45:37leorizethen I'll leave the benchmarking to you
17:45:44FromDiscord<Chiqqum_Ngbata> Will do
17:49:26*silvernode quit (Ping timeout: 265 seconds)
17:50:05*silvernode joined #nim
17:54:50AraqYardanico: any progress? which 'send' call is it?
17:54:55*fredrikhr quit (Read error: Connection reset by peer)
17:55:22*fredrikhr joined #nim
17:56:18leorizeYardanico, Chiqqum_Ngbata: wanna guess the bottleneck? :)
17:57:52Araqconsole output?
17:58:03leorizetoRunes()
17:58:12Araqlol
17:58:12Yardanicoright there's an iterator
17:58:15leorize3.9 seconds was spent converting the string to runes
17:58:22*Vladar quit (Quit: Leaving)
17:58:27leorizethat's 90% of the runtime
17:58:36Yardanicoso you changed it to utf8 iterator?
17:59:33YardanicoAraq: trying to figure it out, sorry, I didn't look before :P i still have quite a lot of time
18:00:36*audiofile joined #nim
18:00:43*audiofile quit (Changing host)
18:00:43*audiofile joined #nim
18:00:59leorizeYardanico: if I wanna win against Go fair and square, I got to keep the algo
18:01:23Araqon a related note I did improve my best time by 30s today
18:01:32Yardanicobest time of what? :P
18:01:36Yardanicobenchmarks?
18:01:46Yardanicoor running?
18:01:49Araqmy 10km run
18:02:51Araqbut I think it's pretty bad, practisising for 6 weeks only to become 30s faster :D
18:03:17leorizeAraq: what is this Marker_ proc?
18:03:26Araqleorize: the GC
18:04:27leorizearc saved the day :p
18:04:47Araqbut in my defense I swallowed a big beetle and had to recover from that during my run
18:05:07YardanicoAraq: also seems like if I remove wasBuffer call at all (and result = newFuture and complete) and basically only call send(irc.sock, ...) inside of that send it works
18:05:24YardanicoI mean if the send in that file will only be as "return send(irc.sock, message & "\c\n", {SocketFlag.SafeDisconn})" it works without any nosinks
18:06:56Yardanicomaybe it's due to wasBuffered adding stuff to messageBuffer and then something happens with that one
18:08:28dom96Since my book is 50% off today I'm going to post an AMA on reddit for it
18:09:00Araqdom96: I can register under a new account and ask questions (just kidding)
18:09:03leorizeChiqqum_Ngbata: do you happen to know that's Go's string semantics?
18:09:06YardanicoAraq: lol
18:09:27leorizewhat's*
18:09:30Yardanicoi wonder how long will I wait till pBook comes to me to Russia :P
18:09:30Araqleorize: immutable with O(1) slicing
18:09:47leorizeno wonder why this style of loop favors them
18:10:19Araqyeah it's optimized for the moron's version, well it's Go...
18:11:30leorizeis lent T a thing?
18:11:34FromDiscord<clyybber> yeah
18:11:44leorizeI mean as value type
18:11:59leorizenope it's not
18:12:20Araqleorize: you can always use 'ptr', it exists
18:12:37FromDiscord<dom96> https://www.reddit.com/r/nim/comments/gcv88z/dominik_picheta_here_writer_of_nim_in_action_and/
18:12:55Yardanicoshould've made it in r/programming :P
18:13:04Yardanicoor cross-post, idk
18:13:26dom96Yardanico, good idea, wanna cross post it yourself? :)
18:13:33Yardanicosure
18:13:42FromDiscord<clyybber> dom96: Why not bridge the gamedev channel?
18:13:50Yardanicodom96: ah "This community does not allow for crossposting of text posts"
18:13:52Yardanicofor r/programming
18:14:37dom96Yardanico, lol, just submit a link and give it a title like "Dominik Picheta, core developer of Nim is doing an AMA in r/nim right now"
18:14:38dom96or something
18:14:45dom96clyybber: I don't really care that much tbh
18:15:13dom96but having all these messages from IRC breaks the inclusiveness IMO
18:15:33FromDiscord<clyybber> huh? But its not exactly inclusive to exclude IRC users either :p
18:15:43Yardanicodom96: ok I'll post :P
18:16:15Yardanicoi hope i don't get downvoted lol
18:16:34*FromDiscord <KingDarBoja> downvote
18:21:09*solitudesf quit (Read error: Connection reset by peer)
18:21:26*Trustable joined #nim
18:21:42*solitudesf joined #nim
18:22:08leorizeahh, rust cheat with a slightly different algo
18:22:13leorizemight as well borrow that :)
18:23:47Araqleorize: you can also implement COW O(1) slicing strings for arc/orc
18:24:02leorizethat's overkill for a microbench
18:24:04Araqit's rather simple since the new implementation is cleaner
18:24:10leorizeand I'm not sure if O(1) is a good idea
18:24:15leorizesorry, COW
18:24:25Araqit's not overkill for Nim
18:24:35Araqit's the future, should write an RFC though
18:24:59leorizethe last time I hang around free pascal mailing list they were talking about how COW strings were a mistake to be in the language
18:25:06FromDiscord<clyybber> Araq: One could consider it part of the lent RFC
18:25:12FromDiscord<clyybber> or the view one
18:25:45Araqleorize: they do atomic RC though, we don't
18:27:26Araqleorize: also do you have a link to the discussion?
18:28:04leorizeno, it's been a couple of years since
18:28:24*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:29:09*Senketsu joined #nim
18:32:40leorize[m]Araq: https://play.nim-lang.org/#ix=2kEp <- is that a bug?
18:33:34Araqyou cannot pass inline iterators around
18:33:55leorize[m]so basically I'd need to write a macro for this
18:33:59Araqfor enumerate use the for loop macro
18:34:00*letto_ joined #nim
18:34:13Araqwhy isn't this in the stdlib already? probably forgot about it?
18:36:43*letto quit (Ping timeout: 260 seconds)
18:44:35*waleee-cl joined #nim
18:49:19FromGitter<Willyboar> @dom96 better start answering.... :P
18:49:40*abm joined #nim
18:50:13livcdWhere is this AMA?
18:50:16livcdah reddit
18:50:28FromDiscord<Recruit_main707> AMA?
18:50:57livcdAmerican Muscle Asses
18:51:08FromDiscord<Recruit_main707> ah
18:54:12Yardanico"What would be the best resource to learn more about mom and it's many garbage collection models?"
18:54:18Yardanicolmao
18:54:25Yardanicoi know its autocorrection but still
18:55:02FromDiscord<KingDarBoja> lool
18:55:28*xcm quit (Remote host closed the connection)
18:55:37FromDiscord<KingDarBoja> > _Also do you think the lead developers will begin to create videos to discuss new or exciting aspects of the language to provide a lower barrier to entry?_
18:55:59leorize[m]Yardanico, @Chiqqum_Ngbata: https://play.nim-lang.org/#ix=2kEC
18:56:14leorize[m]-d:danger --gc:arc and this thing will be close to go
18:56:19*Trustable quit (Remote host closed the connection)
18:56:32FromDiscord<KingDarBoja> I don't think lead devs bother about making videos ๐Ÿ˜ข
18:56:34leorize[m]without both then should be as fast as rust
18:57:25*Trustable joined #nim
18:57:26livcdWell Araq streams. Just not the type of stuff beginners are interested in
18:57:42*xcm joined #nim
18:58:14FromDiscord<KingDarBoja> I could watch the stream if I weren't working as my time zone is always 7 hours behind Germany
18:58:28Araqcan't stream anymore, Corona
18:58:34Yardanicolol
18:58:38Araqmy kids are around all day long
18:58:41disruptekwut
18:58:45Yardanicoahh
18:58:59disruptek~stream
18:58:59disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
18:59:06disruptekking: you can ask me whatever you want, buddy.
18:59:47AraqYardanico: I wrote a sendSafe proc that is .nosinks
18:59:50FromDiscord<KingDarBoja> Sure bro!
18:59:59Araqand used it inside 'connect' and then the crash is gone
19:00:18FromDiscord<KingDarBoja> I have switched to Object variants as you previously stated ๐Ÿ˜„
19:00:19Araqso we fail to pass '&' expressions to 'sink' inside 'connect', so weird
19:02:07leorize[m]lol the rust ver uses `include_str!`
19:02:15leorize[m]they cheated a hell lo
19:02:23leorize[m]lot*
19:02:30Yardanicowait what
19:02:32Yardanico"The file is located relative to the current file. (similarly to how modules are found)"
19:02:38Yardanicocompile-time string include lol?
19:03:25leorize[m]yes :)
19:05:05leorize[m]go is the king in this benchmark
19:05:53leorize[m]immutable strings let them win points in the main loop
19:06:08leorize[m]and their string to rune implementation seems to be really fast
19:06:32FromDiscord<KingDarBoja> Hey 4raq, just curious, has been any progress regarding this -> https://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871
19:06:33disbotโžฅ Allow usage of the same attribute name in different branches within variant types
19:06:42leorize[m]though I'm not sure of that's the case or their optimizer just inlined the string-to-rune and the loop after that
19:07:51leorize[m]if*
19:12:24FromDiscord<KingDarBoja> I installed gary nim extension but I really miss some colors on the syntax highlight lol
19:15:02FromDiscord<Recruit_main707> you can add them with an small change in your settings.json
19:15:54FromDiscord<Recruit_main707> ill dm it to you
19:17:36FromDiscord<KingDarBoja> Thanks ๐Ÿ˜„
19:17:46FromDiscord<Recruit_main707> np
19:18:12FromDiscord<KingDarBoja> So now all basic types are red, clever
19:18:27FromDiscord<Recruit_main707> you can change the color
19:18:34FromDiscord<Recruit_main707> i have it to fit my color theme
19:18:36FromDiscord<KingDarBoja> I know, but I like the red ๐Ÿ˜„
19:21:25AraqKingDarBoja: only in the sense that the arc/orc allow us to make the impl more flexible
19:24:15*nsf quit (Quit: WeeChat 2.8)
19:28:47*Senketsu quit (Quit: WeeChat 2.8)
19:41:13FromDiscord<KingDarBoja> Okie Dokie ๐Ÿ˜„
19:42:33FromDiscord<KingDarBoja> Does autocompletion for OV works in VSCode? seems like not :/
19:43:15Yardanicoit does
19:43:27FromDiscord<Recruit_main707> its just the original extension with the syntax color problems fixed
19:44:00FromDiscord<KingDarBoja> Yardanico: did you saw the link on offtopic channel?
19:44:05Yardanicoyes
19:44:11Yardanicobut it works for me
19:44:20FromDiscord<KingDarBoja> ๐Ÿค”
19:44:38FromDiscord<KingDarBoja> I am screwed
19:46:02FromDiscord<KingDarBoja> I see it will start showing possible fields after typing `.someCharacter`
19:46:12FromDiscord<KingDarBoja> But hard to guess which kind I do have ๐Ÿค”
19:46:28FromDiscord<KingDarBoja> Unless I am misunderstanding how OV works
19:46:39Yardanicoobject variants work at runtime
19:46:54Yardanicocompiler can't know which kinds will be for which fields without a lot of analysis
19:47:24FromDiscord<KingDarBoja> Ahhh that why...
19:47:49FromDiscord<KingDarBoja> So I have to guess which kind it is and use the proper fields
19:53:48FromDiscord<KingDarBoja> Thank you Yard ๐Ÿ˜—
20:01:15FromDiscord<KingDarBoja> This is a whack-a-mole now x.x
20:04:08*letto_ quit (Ping timeout: 272 seconds)
20:07:47dom96yay lots of questions
20:09:12dom96damn, these are good questions
20:10:44FromDiscord<KingDarBoja> lmao
20:10:50*FromDiscord <KingDarBoja> Just ask herself? I don't think that taking out trash needs some great model, just do it and help your mom.
20:17:13*NimBot joined #nim
20:23:08*letto_ joined #nim
20:36:41FromDiscord<mahfiles> Is there a method to find the current directory of an executable? Not the directory it's being run from, but the directory it's actually in.
20:37:20disrupteksee the os module.
20:42:02FromDiscord<mahfiles> I tried checking the documentation before asking; but only found getting the current directory it's being run from, rather than where the executable actually is
20:42:48*jwm224 joined #nim
20:43:04disruptekgetAppDir, getAppFilename?
20:43:09disruptekwhich manual are you reading?
20:44:56FromDiscord<mahfiles> I was reading off the doc page; and i somehow just missed it; but it is on there. thanks, sorry about that
20:45:14disruptekit's okay, i thought maybe the docs were br0xored.
20:47:57*vqrs quit (Ping timeout: 265 seconds)
20:48:44*vqrs joined #nim
20:56:13*covidian joined #nim
21:04:33FromDiscord<KingDarBoja> Okay I pushed the OV thing into another branch so I don't mess up master on my repo
21:04:45FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/commit/ac6f2a47e1b318642bdf7eb4b7d0ff4ca5ccbc8e still not happy about having to guess the field names :/
21:05:22covidiankewl
21:05:32covidiannim roxx!
21:05:37*lritter quit (Quit: Leaving)
21:05:48FromDiscord<KingDarBoja> Whereas the mixed OOP + OV seems to be okay to get rid of type conversions and also bring me type inference at compile time
21:05:52FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/commit/2242dfbefb35b26b8cf0ae272e6a0d6624666b6e
21:06:07FromDiscord<KingDarBoja> what do you think disruptek?
21:08:39Araqlooks ok
21:08:43Araqcovidian: thanks
21:11:40Prestigedom96: Just purchased your book, thanks for the discount code :)
21:12:35covidiankewl... which book is it ? (newbie here)
21:12:57covidianthough I dabbled in nim already
21:13:11dom96Prestige, yay, thanks for picking it up!
21:13:22dom96covidian, https://book.picheta.me
21:13:25covidianOK
21:14:09covidiannice website dude
21:14:24dom96thanks :)
21:15:31covidianI always thought nim is kinda nice. now we need to bring the GuixSD people onboard ;-)
21:16:03covidianthey have a bรถner for guile / LISP
21:16:32*PMunch joined #nim
21:16:53covidianfor whatever reason...
21:18:59*PMunch quit (Client Quit)
21:21:12FromDiscord<Yardanico> Well you know it's kinda expected considering Guix is in Guile
21:24:17covidianbut can't they see? ;-)
21:25:11covidianmaybe we have to put up with guile/LISP for packaging. it is truely amazing what they do.
21:25:24FromDiscord<Yardanico> NixOS uses Nix
21:25:33dom96TIL an AMA is hard work
21:25:45FromDiscord<Yardanico> It's a functional DSL, not lisp family
21:25:48covidianyes they are kinda linked guix + nixos
21:25:57FromDiscord<Yardanico> GuixSD was initially based on NixOS
21:26:03covidianOK
21:27:15covidianI would really like an AMA against those pro-covid doctors
21:27:50FromDiscord<Never Listen To Beef> A pro covid doctor is called a mortician
21:28:08covidianlawl or a former unemployed or sth.
21:28:24FromDiscord<Never Listen To Beef> A pro covid doctor is like a pro bullet soldier
21:28:34*abm quit (Quit: Leaving)
21:28:57covidiandude u drank the Kool Aid...
21:29:04FromDiscord<Never Listen To Beef> What?
21:29:30covidianwere you joking? I think there is a mega hysteria ongoing.
21:29:36FromDiscord<bedwardly-down> Ummmm... I might be hopping on at the wrong time. ๐Ÿ˜ฎ
21:30:15FromDiscord<Never Listen To Beef> Im both joking and questioning what a pro covid doctor is, seems like doctors would be against a virus since you know they're doctors
21:30:38covidianin fact, those covid numbers are less reliable than the estimates on POTUS IQ.
21:31:48FromDiscord<Never Listen To Beef> I dont even get what you're saying
21:31:51covidianwell take Prof Drosten, the covid pope from Germany. in an AMA I would ask him how many million โ‚ฌโ‚ฌ his portfolio grew recently.
21:32:34covidianin stock options of Big Pharma
21:32:54covidianPOTUS = president o0f the united states
21:33:10FromDiscord<Never Listen To Beef> Are you explaining that for yourself?
21:33:38covidianso what do u not get?
21:33:54FromDiscord<Never Listen To Beef> The entirety of what you've said
21:34:06FromDiscord<Never Listen To Beef> "Pro covid doctor" is one im really stuck on
21:34:58covidianMr. Drosten PhD is a doctor and makes his money with covid. he is a pro-covid doctor in a manner of speaking.
21:35:28solitudesfcool. there is offtopic channel for that.
21:35:51FromDiscord<Never Listen To Beef> Yea i was going to say, but felt that'd be silly to say after enticing them
21:35:59FromDiscord<Never Listen To Beef> Anywho, uhh nim eh?
21:37:04covidianyou mean my nickname "covidian" sounds like I myself drank the KOOL AID ? lol
21:38:05covidiannim roxx, let me tell u
21:38:45*drewr quit (Ping timeout: 240 seconds)
21:39:06covidianwill the covid19 hoax ever end?
21:39:52*audiophile joined #nim
21:40:14*solitudesf quit (Ping timeout: 256 seconds)
21:40:39FromDiscord<Never Listen To Beef> Offtopic, but "hoax" the virus doesnt exist?
21:41:08FromDiscord<Never Listen To Beef> Like go spew you silly illinformed bullshit elsewhere that isnt nim related in the slightist
21:42:14*audiofile quit (Ping timeout: 240 seconds)
21:42:18*audiophile is now known as audiofile
21:44:31*PMunch joined #nim
21:46:23FromGitter<jorjun_twitter> Bit of JS backend help pls pls
21:46:23FromGitter<jorjun_twitter> https://pastebin.com/98HsMbM6
21:52:28FromGitter<jorjun_twitter> couldnโ€™t see how to refer to the proc for requestAnimationFrame.. almost got my first three.js demo working.
21:54:04dom96jorjun_twitter: pretty sure dom defines a `window`
21:54:28dom96also your `render` proc needs to take a float parameter
21:56:27*fredrikhr quit (Read error: Connection reset by peer)
21:56:51*fredrikhr joined #nim
22:00:35*tane quit (Quit: Leaving)
22:01:06FromGitter<jorjun_twitter> Thanks @dom96 removed the window def, tried this: proc render(time: float = 30.0): int = โŽ โŽ ```requestAnimationFrame(window, render)``` [https://gitter.im/nim-lang/Nim?at=5eaf3f2270a7fb75e6232576]
22:01:18FromGitter<jorjun_twitter> Error: type mismatch: got <Window, proc (time: float): int> โŽ but expected one of: โŽ proc requestAnimationFrame(w: Window; function: proc (time: float)): int
22:02:24dom96hm, not sure. I use it like this in my game library in case the example helps you figure out the problem: https://github.com/dom96/gamelight/blob/master/gamelight/graphics.nim#L495
22:02:27dom96good night
22:02:42covidiangn
22:03:06FromGitter<jorjun_twitter> merci
22:03:12*gmpreussner quit (Ping timeout: 260 seconds)
22:03:27*fredrikhr quit (Read error: Connection reset by peer)
22:03:54*fredrikhr joined #nim
22:11:08AraqYardanico: found the problem
22:11:25*PMunch quit (Ping timeout: 246 seconds)
22:12:14*PMunch joined #nim
22:12:51*fredrikhr quit (Ping timeout: 265 seconds)
22:13:37*PMunch quit (Remote host closed the connection)
22:14:07*xcm quit (Remote host closed the connection)
22:16:23*xcm joined #nim
22:19:11AraqYardanico: https://github.com/nim-lang/Nim/issues/14207 your bug
22:19:30FromDiscord<Technisha Circuit> Is there an easy way to call NodeJS and Python in Nim?
22:19:39FromDiscord<Technisha Circuit> For Python i can use Nimpy
22:19:45FromDiscord<Technisha Circuit> But how about NodeJS?
22:20:19Araqyou can compile to JS and import libraries from NodeJS
22:20:43FromDiscord<Technisha Circuit> But then i wouldn't be able to call Python, would i?
22:20:52FromDiscord<codic> not in the same file, no
22:21:04FromDiscord<Technisha Circuit> :/
22:22:09FromDiscord<Technisha Circuit> I just want to be able to use multiple languages that i like in one file so i can make them interact with eachother
22:22:25FromDiscord<Technisha Circuit> I could use websockets but i don't want to mess with websockets rn
22:22:54FromDiscord<Rika> isnt websockets for uh
22:22:56FromDiscord<Rika> the web
22:22:58leorizetechnically you can make it work, it just that you wouldn't want to
22:23:28FromDiscord<Technisha Circuit> > isnt websockets for uh
22:23:28FromDiscord<Technisha Circuit> You can get websockets to work with other stuff
22:23:33FromDiscord<codic> websockets can be used for sharing data between programs
22:23:35FromDiscord<Rika> also i realized you changed your name from technicae to technisha
22:23:39FromDiscord<Rika> i mean yeah
22:23:39FromDiscord<Technisha Circuit> Hahaha
22:23:44FromDiscord<Rika> but is that a good idea
22:23:46FromDiscord<codic> although, for the case of *Linux* specifically, dbus is a much better way
22:23:58FromDiscord<Technisha Circuit> What's dbus? ๐Ÿ˜…
22:24:00FromDiscord<codic> and windows and mac probs have similar things
22:24:01FromDiscord<codic> Data-Bus
22:24:09FromDiscord<Rika> raw sockets ๐Ÿ˜›
22:24:10FromDiscord<codic> it allows programs to interface with each other by sharing data
22:24:11FromDiscord<Technisha Circuit> > but is that a good idea
22:24:12FromDiscord<Technisha Circuit> No, but I'm stupid so :P
22:24:28FromDiscord<Technisha Circuit> Oh? So how would i do it for NodeJS, Nim and Python?
22:24:36FromDiscord<codic> Yup, windows has an IPC mechanism called COM
22:24:41leorizedbus is a "simple" specification for an ipc system :p
22:24:52FromDiscord<codic> and macos has distributed notification
22:24:55FromDiscord<codic> yeah haha
22:25:04FromDiscord<Rika> is dbus easy to use
22:25:12FromDiscord<codic> don't know, never used it
22:25:12FromDiscord<KingDarBoja> sigh
22:25:18FromDiscord<Rika> i might just use that for a plugin system lol
22:25:18FromDiscord<codic> @KingDarBoja what?
22:25:24FromDiscord<Technisha Circuit> Hm
22:25:25FromDiscord<codic> It's linux only though
22:25:25leorizedbus is so easy to use it's author put a warning that you should never use it in the C api :)
22:25:38FromDiscord<Rika> oh lord
22:25:38leorizedbus is cross platform actually
22:25:42FromDiscord<codic> anyways https://github.com/zielmicha/nim-dbus
22:25:45FromDiscord<codic> Yeah but it requires ports
22:25:49FromDiscord<Technisha Circuit> Oh? Why should you not use it in the C API?
22:25:55FromDiscord<codic> it's not natively available on every windows and mac system
22:25:56covidianbash likes dbus LOL
22:26:08FromDiscord<codic> XD
22:26:35FromDiscord<Technisha Circuit> I wonder why i am so stupid ๐Ÿคฆ
22:26:50FromDiscord<codic> hmmm....
22:26:55FromDiscord<Technisha Circuit> So what would be the best way for me to share data between the three langs?
22:26:55FromDiscord<codic> Hold on
22:27:07leorizeTechnisha Circuit: it's not about three langs
22:27:10FromDiscord<codic>
22:27:10FromDiscord<codic> https://cdn.discordapp.com/attachments/371759389889003532/706632972748587159/unknown.png
22:27:14leorizeit's about how you have three runtimes :)
22:27:25FromDiscord<Technisha Circuit> Wdym?
22:28:13leorizenim <-> python is easy, because python has a C interface that we can hook into
22:28:17FromDiscord<Rika> what RPC protocol do yall recommend then, if not dbus?
22:28:19leorizefind one for js and you're set
22:28:30leorizeRika: depends on what you're doing
22:28:52covidianeschew JS!
22:28:53FromDiscord<Rika> i dont know what it depends on
22:29:05covidianespouse nim!
22:29:36leorizewell, why do you need an ipc system?
22:29:46FromDiscord<codic> websockets
22:29:50FromDiscord<codic> ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚
22:29:52FromDiscord<codic> best ipc system
22:29:55leorizeand what can access this system?
22:30:13*Trustable quit (Remote host closed the connection)
22:30:15FromDiscord<codic> if you're asking me, any language supporting websockes
22:30:25leorizeI'm asking Rika :P
22:30:28FromDiscord<codic> ah
22:30:32FromDiscord<Rika> well i can always use the `plugin` package, but i dont have confidence in it
22:30:48leorizeuse the plugin package
22:31:08FromDiscord<Rika> i want to be able to withstand someone suddenly removing the plugin's dll
22:31:15FromDiscord<Rika> and not crash in that case
22:31:24leorizedoesn't the plugin package support that?
22:31:33leorizeI mean, that's the whole point of a plugin system?
22:31:47FromDiscord<Rika> im not sure
22:32:21leorizeif you worry about someone removing the dll at runtime then don't worry, once a file is opened it will stay alive until all handles to it are gone
22:33:23Araqdon't write plugin systems before you have something to plug into
22:33:25FromDiscord<Technisha Circuit> NodeJS has a C api
22:33:40FromDiscord<Technisha Circuit> But I can't find a lib to let me interact with it
22:33:58FromDiscord<Rika> araq, what do you mean?
22:35:00Araqdon't write plugin systems if you can avoid it. by construction they make code impossible to follow
22:35:19FromDiscord<Rika> okay
22:36:33Araqbut worse than that, they encourage you to worry about the wrong things. first get your app running, then optimize the user experience and only then offer your users a plugin ecosystem.
22:37:09Araqand keep in mind that most of us don't enjoy hunting for adblockers as plugins
22:37:17FromDiscord<KingDarBoja> Can I use a OV kind as type?
22:37:30Araqwe're happier when the browser simply ships with a good one by default...
22:38:43Araqsame with editors, editors are better when they ship with syntax highlighting etc out of the box instead of making me hunt for extensions that then don't work
22:38:56FromDiscord<Rika> i'm more of thinking "how do i make this bot run 24/7 with at least some of its functionality all the time" or so
22:39:19FromDiscord<Rika> aka i want to make sure i dont lose all service because i was swapping out one of the services
22:39:48Araqso use a load balancer
22:42:01FromDiscord<Rika> ill think about that
22:47:42Araqโ€žAs always: depends on the use case.
22:47:42AraqWe're using Erlang as the primary language environment for our IoT product for a lot of reasons but one big one is: Hot code loading and a very robust release upgrade environment with a lot of control over the process (including restarting everything inside the VM if that's what we wish to do).
22:47:42AraqFor our product, a digital light switch / dimmer, high uptime guarantees is a very important requirement and Erlang has it all plus many other wonderful features.โ€œ
22:47:59Araqer ... is that a joke?
22:58:19*zacharyc1rter quit (Ping timeout: 246 seconds)
22:58:19*zacharycarter quit (Ping timeout: 246 seconds)
22:58:40*zacharyc2rter quit (Ping timeout: 246 seconds)
23:00:23FromGitter<jorjun_twitter> So all this stuff in the jsffi module should be generic typed, then. Think it is holding me back.
23:00:24FromGitter<jorjun_twitter> proc `+=` *(x, y: JsObject): JsObject {.importcpp: "(# += #)", discardable.} โŽ proc `-=` *(x, y: JsObject): JsObject {.importcpp: "(# -= #)", discardable.} โŽ proc `*=` *(x, y: JsObject): JsObject {.importcpp: "(# *= #)", discardable.}
23:01:30FromGitter<jorjun_twitter> better go bed
23:29:03*ryan__ joined #nim
23:30:10*audiophile joined #nim
23:30:33*zacharyc1rter joined #nim
23:30:33*zacharycarter joined #nim
23:30:34*zacharyc2rter joined #nim
23:30:41FromDiscord<codic> i have a quick question, if I have this code `import json; echo %*["O"][0]`, why is O printed literally in quotes (`"O"` instead of `O`)?
23:31:14Araqbecause json.`$` returns the JSON stuff in its ascii representation
23:31:30Araqand echo uses `$`
23:31:52*ryan_ quit (Ping timeout: 260 seconds)
23:32:37*audiofile quit (Ping timeout: 246 seconds)
23:32:45*audiophile is now known as audiofile
23:33:00FromDiscord<codic> ah, so how can I not have the quotes?
23:33:14FromDiscord<codic> modify echo?
23:33:37PrestigeIs there a way to have nullable culongs? I'm wanting a value to be nil by default for a type I'm creating
23:35:06*rockcavera joined #nim
23:35:22*zacharyc2rter quit (Ping timeout: 260 seconds)
23:35:22*zacharyc1rter quit (Ping timeout: 260 seconds)
23:35:22*zacharycarter quit (Ping timeout: 260 seconds)
23:36:21FromDiscord<codic> or should I make a different function `jsonecho` haha
23:36:43FromDiscord<dayl1ght> I'm debugging nim code using lldb. Is it possible to run nim expressions in lldb?
23:39:44AraqPrestige: use the Option[T] type
23:39:55PrestigeThanks!
23:40:03Araqcodic: you should understand the json api
23:40:24leorizedayl1ght: we don't have lldb support yet
23:40:29Araqdal1ght: no, you need to use C syntax, unfortunately
23:40:53FromDiscord<dayl1ght> ah ๐Ÿ˜ is there any trick to print nim arrays?
23:41:22Araqnim arrays are just C arrays
23:41:30FromDiscord<dayl1ght> oops I mean seq
23:42:11FromDiscord<codic> araq: ah, where can i find the docs? Just the nim ones?
23:42:25FromDiscord<codic> so https://nim-lang.org/docs/json.html
23:42:50Araqyeah
23:42:57FromDiscord<Rika> look for how strings are stored in JsonNodes
23:43:09Araqyou're looking for .getStr
23:43:30FromDiscord<codic> Oh great there's also getInt getBiggestInt GetFloat getBool etc
23:43:33FromDiscord<codic> *getFloat
23:44:04FromDiscord<Rika> look at the type def not the procs
23:44:12FromDiscord<Rika> (though the procs are recommended)
23:45:03FromDiscord<Rika> @codic why not just use getStr
23:45:15FromDiscord<Rika> also why is it called getStr and not getString?
23:45:23FromDiscord<codic> I am gonna use getStr
23:45:31FromDiscord<codic> I was looking at the others in case I wanted the other types
23:45:39FromDiscord<Rika> i see
23:45:53FromDiscord<codic> Aw `echo %*["O"][0].getStr` fails
23:45:57FromDiscord<codic> type mismatch
23:46:32leorize!eval import json; echo `%`(["0"][0].getStr)
23:46:35NimBotCompile failed: /usercode/in.nim(1, 31) Error: type mismatch: got <string>
23:46:43leorize!eval import json; echo `%`(["0"][0]).getStr
23:46:46NimBot0
23:46:50leorizeit's due to operator precedence
23:47:06FromDiscord<codic> ahhhh
23:47:08FromDiscord<codic> okay, thanks!
23:55:31*krux02_ joined #nim
23:55:59shashlickOh - some interest in the plugin system
23:57:59*ftsf joined #nim
23:59:17*krux02 quit (Ping timeout: 260 seconds)