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:41 | FromDiscord | <Rika> oh no, recursion, i have to make it a ref object or make the field take in a ref |
00:01:48 | FromDiscord | <Rika> hmm which one would be better |
00:05:51 | FromDiscord | <KingDarBoja> make it a ref |
00:05:56 | FromDiscord | <KingDarBoja> `ref object` |
00:07:53 | FromDiscord | <Rika> i know how but i'm asking which would be better |
00:08:09 | FromDiscord | <Rika> ref object ... field: TheObject |
00:08:12 | FromDiscord | <Rika> or |
00:08:19 | FromDiscord | <Rika> object ... field: ref TheObject |
00:08:48 | FromDiscord | <Rika> i assume the latter would be just fine to use |
00:08:59 | FromDiscord | <Rika> i dont really have a use for ref objects on this datatype |
00:10:49 | FromDiscord | <KingDarBoja> Doesn't the latter force you to deref everytime you want to use it on TheObject? |
00:12:21 | FromDiscord | <Rika> can just make a proc for that |
00:12:47 | Yardanico | for [] ? |
00:13:01 | FromDiscord | <Rika> no, i mean, an accessor proc |
00:13:26 | FromDiscord | <Rika> proc fieldName(obj: TheObject): TheObject = obj.fieldName[] |
00:13:29 | FromDiscord | <Rika> something like that no? |
00:13:32 | zacharycarter | how can I make this work? https://play.nim-lang.org/#ix=2kxb |
00:14:04 | FromDiscord | <Rika> make a proc == that accepts an AtomicInt |
00:14:12 | FromDiscord | <Rika> same thing for SpinLock |
00:14:42 | FromDiscord | <Rika> or if you think conversion would work then maybe try converting them back into int32s |
00:14:54 | Yardanico | zacharycarter: proc `==`[T: SomeNumber](a: AtomicInt, b: T): bool = stuff |
00:14:59 | Yardanico | that'll work for any number type |
00:15:03 | Yardanico | you can just do b: int though |
00:15:08 | zacharycarter | iproc `==`[T: SomeNumber](a: AtomicInt, b: T): bool = stuff |
00:15:12 | zacharycarter | oops thanks |
00:15:17 | zacharycarter | I'll try that |
00:15:26 | Yardanico | do you need to compare for different number types? |
00:15:39 | zacharycarter | probably just int32 but I can modify it for that |
00:15:47 | Yardanico | well yeah |
00:15:56 | Yardanico | proc `==`(a: AtomicInt, b: int32): bool = stuff |
00:16:02 | Yardanico | also don't forget to export it with * |
00:16:57 | zacharycarter | I don't think that's really a solution though... |
00:17:06 | zacharycarter | because what am I going to replace stuff with |
00:17:31 | Yardanico | ? |
00:17:58 | zacharycarter | in C I can call `==` on an int32 and a fe_lock_t because they're both just int32's |
00:18:10 | zacharycarter | but Nim's type system is preventing me from doing that |
00:18:16 | Yardanico | well use casts |
00:19:34 | zacharycarter | going to have to I guess |
00:20:00 | Yardanico | well if you're already doing {.emit.} and {.importc.} cast is nothing :P |
00:20:56 | zacharycarter | it's not that I"m worried about using casts it's just the volatile typedef qualifier and the alignment attribute |
00:23:07 | zacharycarter | `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:15 | zacharycarter | so I guess it doesn't matter too much |
00:23:21 | zacharycarter | if I cast it to an int32 |
00:23:48 | * | chapl joined #nim |
00:30:21 | FromGitter | <dumjyl> nim has volatile and align pragmas that may help: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-align-pragma |
00:30:31 | zacharycarter | neither can be used on a type |
00:30:42 | zacharycarter | nor can codgenDecl |
01:01:34 | skrylar[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:07 | skrylar[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:47 | skrylar[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:28 | FromDiscord | <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:54 | skrylar[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:49 | skrylar[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:38 | skrylar[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:01 | skrylar[m] | i dunno if nim has gotten 'more' help because its written in itself |
01:08:19 | zacharycarter | probably not |
01:08:27 | Yardanico | i think yes |
01:08:31 | Yardanico | a bit :P |
01:09:20 | skrylar[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:25 | zacharycarter | beef does look interesting but yeah Nim seems much more mature |
01:10:40 | zacharycarter | I guess not even seems, is |
01:10:57 | Yardanico | https://www.beeflang.org/ ? |
01:12:05 | zacharycarter | hmm so I guess I need to emit this stuff not in the file I'm defining the wrapper types in |
01:12:13 | zacharycarter | but everywhere that the wrapper types are imported |
01:12:16 | zacharycarter | that's annoying :/ |
01:12:51 | zacharycarter | there has to be a better way |
01:13:24 | skrylar[m] | Yardanico: thats the one |
01:14:07 | FromDiscord | <dayl1ght> Hey, I'm completely new to nim and I'm having trouble doing basic imports: https://ghostbin.co/paste/7hx6h |
01:14:25 | FromDiscord | <Rika> you need to export it |
01:14:27 | FromDiscord | <dayl1ght> I've also tried from "./types" |
01:14:31 | FromDiscord | <Rika> type MyType* = int |
01:14:38 | FromDiscord | <dayl1ght> * exports identifiers? |
01:14:38 | FromDiscord | <Rika> see that asterisk? |
01:14:39 | FromDiscord | <codic> https://github.com/Yardanico/nimpylib is just amazing |
01:14:41 | FromDiscord | <Rika> thats to export it |
01:14:47 | Yardanico | @codic don't use it for real code XD |
01:14:49 | FromDiscord | <Rika> you can export a lot of things |
01:14:56 | Yardanico | it's just shows how to (ab)use generics and stuff |
01:14:58 | Yardanico | type MyType* = int |
01:15:07 | FromDiscord | <codic> Haha yeah, the only useful thing is the class support |
01:15:14 | FromDiscord | <dayl1ght> perfect, so all identifiers are private to a file except when I add an asterisk |
01:15:17 | Yardanico | yes |
01:15:17 | Yardanico | https://nim-lang.org/docs/tut1.html#modules |
01:15:38 | FromDiscord | <codic> i'm gonna split classes into a seperate module hahaha |
01:15:38 | FromDiscord | <codic> then add inheritance if i can |
01:15:44 | FromDiscord | <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:50 | FromDiscord | <Rika> yardanico, i've started committing everything to circa's temp-all branch now |
01:15:52 | Yardanico | @codic well it shouldn't be too hard |
01:15:54 | FromDiscord | <dayl1ght> thanks folks |
01:15:57 | Yardanico | @Rika nice |
01:15:57 | FromDiscord | <codic> yeah |
01:16:05 | FromDiscord | <codic> do nim objects have inheritance? |
01:16:09 | FromDiscord | <Rika> my files are a mess though xd |
01:16:13 | FromDiscord | <Rika> yes they do |
01:16:14 | Yardanico | "object of AnotherType" |
01:16:22 | Yardanico | but inheritance is mostly useful with methods |
01:16:29 | FromDiscord | <codic> boom https://github.com/Yardanico/nimpylib/blob/master/src/pylib/class.nim |
01:16:30 | Yardanico | so you gotta change it so it makes methods instead of procs |
01:16:47 | FromDiscord | <codic> what's the difference? |
01:16:55 | Yardanico | runtime dispatch vs static dispatch |
01:17:00 | FromDiscord | <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:02 | Yardanico | the latter is of course faster |
01:17:14 | FromDiscord | <codic> so how do i change it to make methods/ |
01:17:24 | FromDiscord | <codic> Since i don't see anything making a proc in there haha |
01:17:27 | Yardanico | https://nim-lang.org/docs/macros.html |
01:17:33 | * | LLuz joined #nim |
01:17:42 | Yardanico | https://github.com/Yardanico/nimpylib/blob/master/src/pylib/class.nim#L76 |
01:17:49 | Yardanico | https://nim-lang.org/docs/macros.html#newProc%2CopenArray%5BNimNode%5D%2CNimNode%2CNimNode |
01:17:51 | FromDiscord | <codic> O |
01:18:17 | FromDiscord | <codic> hmm, that page doesn't have newMethod when ctrl-fing |
01:18:18 | Yardanico | basically change nnkProcDef to nnkMethodDef and it *might* work |
01:18:32 | FromDiscord | <codic> does have nnkMethodDef tho |
01:18:33 | FromDiscord | <codic> oh |
01:18:34 | Yardanico | @codic last argument is routine type |
01:18:42 | Yardanico | well, not the last one |
01:18:43 | Yardanico | "procType = nnkProcDef;" |
01:18:46 | FromDiscord | <Rika> you still need to make {.base.} methods though |
01:18:48 | FromDiscord | <Rika> gl, hf wit hthat |
01:18:49 | Yardanico | yeah |
01:18:54 | FromDiscord | <codic> hm |
01:19:13 | Yardanico | @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:15 | Yardanico | and experiment |
01:20:48 | Yardanico | i'm surprised pylib has that much stars |
01:21:21 | Yardanico | although 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:40 | FromDiscord | <codic> Hahaha |
01:22:40 | FromDiscord | <codic> I have a very quick question, does your class implementation support classmethods? |
01:23:19 | Yardanico | well this class macro is reaaally simple |
01:23:23 | Yardanico | it doesn't do advanced stuff |
01:24:10 | FromDiscord | <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:13 | FromDiscord | <codic> yeah i know :P |
01:24:30 | Yardanico | var self.thing="O" no |
01:24:34 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
01:24:37 | Yardanico | that's not how it works |
01:24:48 | Yardanico | with "var" you declare a new variable, and fields must be known in object type definitions |
01:24:58 | Yardanico | you can't declare new fields with "var" |
01:25:11 | FromDiscord | <codic> oh |
01:25:22 | FromDiscord | <Rika> you cant declare new fields on runtime |
01:25:33 | FromDiscord | <codic> welpy |
01:26:02 | FromDiscord | <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:16 | Yardanico | python 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:32 | Yardanico | like "@classmethod<newline>def from_string(stuff)" |
01:28:02 | FromDiscord | <Rika> but you'll have to wrap the file in a megamacro no? |
01:28:06 | Yardanico | yes ofc |
01:28:19 | Yardanico | but really I'd suggest to not extend this class macro, not all python syntax is correct nim syntax |
01:28:25 | FromDiscord | <Rika> now i see how them C# source generators come into play... |
01:28:26 | Yardanico | e.g. "a, b = stuff" is not valid nim syntax |
01:28:38 | FromDiscord | <Rika> i mean technically it is |
01:28:40 | Yardanico | @Rika well with "class" you basicall write stuff like in Python |
01:28:43 | Yardanico | @Rika it's not |
01:28:44 | Yardanico | I just checked |
01:28:50 | FromDiscord | <Rika> var a, b = stuff just sets both a and b to stuff's value |
01:28:55 | FromDiscord | <Rika> ah ou mean w/o the var? |
01:28:57 | Yardanico | yes |
01:29:02 | FromDiscord | <Rika> yeah |
01:29:16 | FromDiscord | <Rika> why would you want to convert nim into python anyway |
01:29:23 | Yardanico | ikr |
01:29:27 | Yardanico | pylib is just a PoC :P |
01:29:28 | FromDiscord | <Rika> just use python if you're that hungry for it |
01:29:30 | FromDiscord | <codic> idk |
01:29:33 | FromDiscord | <codic> for fun |
01:29:37 | FromDiscord | <Rika> if you need speed use pypy with python |
01:29:39 | FromDiscord | <codic> i like the class syntax, that's all |
01:29:44 | FromDiscord | <Rika> its not gonna be fun to implement |
01:29:47 | Yardanico | the only useful thing in it is https://github.com/Yardanico/nimpylib/blob/master/src/pylib/range.nim |
01:30:00 | Yardanico | replicates python-like range object |
01:30:22 | Yardanico | python3-like* |
01:30:29 | FromDiscord | <KingDarBoja> .-. |
01:30:39 | FromDiscord | <Rika> hello |
01:30:46 | FromDiscord | <KingDarBoja> Hi, just saw the chat |
01:30:54 | FromDiscord | <KingDarBoja> I will be back, working on OOP + OV |
01:30:57 | FromDiscord | <KingDarBoja> Object variants* |
01:31:20 | FromDiscord | <codic> Fiiiiiiiine |
01:31:21 | FromDiscord | <codic> i won't |
01:31:26 | FromDiscord | <KingDarBoja> So far so good Rika-sensei |
01:32:10 | FromDiscord | <KingDarBoja> Just hit a nested object variant need but I do think I will scrap the parent type |
01:32:28 | FromDiscord | <KingDarBoja> At the end, I am doing all leaf types by groups |
01:32:30 | FromDiscord | <Rika> im here absolutely dying from beatmap difficulty calculation |
01:32:44 | FromDiscord | <Rika> like, its such a massive project converting oop to ov for me |
01:32:44 | FromDiscord | <KingDarBoja> Then all of them will inherit of a single Node base |
01:32:55 | FromDiscord | <KingDarBoja> D: |
01:33:05 | FromDiscord | <KingDarBoja> I know that feeling |
01:33:22 | FromDiscord | <KingDarBoja> Going backwards until I reach the parent base type |
01:34:54 | FromDiscord | <KingDarBoja> Hummmm |
01:35:44 | FromDiscord | <KingDarBoja> https://imgur.com/cBhadHR Rika Rika |
01:36:33 | Yardanico | @KingDarBoja you know you can basically have really much less kinds and just have a generic "sons" field of seq[Node] ? |
01:36:53 | Yardanico | see https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L723 |
01:36:59 | FromDiscord | <KingDarBoja> That's what I am doing |
01:37:01 | Yardanico | no? |
01:37:04 | Yardanico | that's the node ast definition for nim AST |
01:37:11 | FromDiscord | <KingDarBoja> Yup, I saw that |
01:37:11 | Yardanico | "else: sons: TNodeSeq" |
01:37:22 | FromDiscord | <KingDarBoja> Not that part |
01:37:41 | FromDiscord | <KingDarBoja> > Then all of them will inherit of a single Node base |
01:37:58 | FromDiscord | <KingDarBoja> So all my leafs will have the Node as root ๐ |
01:38:01 | Yardanico | then you'll have one object |
01:38:13 | Yardanico | i mean object type |
01:38:22 | FromDiscord | <KingDarBoja> Yup, just doing backward refactoring |
01:38:37 | FromDiscord | <KingDarBoja> So first grouping the leafs by parent types |
01:38:45 | FromDiscord | <KingDarBoja> Then scraping it and make it Node |
01:39:20 | FromDiscord | <KingDarBoja> The screenshot I sent was more a question, but forgot to ask |
01:39:46 | FromDiscord | <KingDarBoja> In case I had something like left side (nested Object variants), how I can provide the second kind `tdKind` ? |
01:40:07 | Yardanico | ? |
01:40:18 | FromDiscord | <KingDarBoja> So `Parent` has a kind, one of its kind has a subkind |
01:40:47 | FromDiscord | <KingDarBoja> So If I do `Parent(kind: ChildTwo)`, how I can set the kind of the Child? |
01:41:01 | FromDiscord | <KingDarBoja> Like ChildTwo has a `cKind` field (subkind) |
01:41:09 | Yardanico | you can have as much kinds as you want in object variants |
01:41:31 | Yardanico | @KingDarBoja I don't understand without code :P |
01:42:05 | FromDiscord | <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:18 | Yardanico | idk :P it was me, but I don't use nigui realy |
01:42:29 | FromDiscord | <codic> (if there are docs please link me to em) |
01:42:34 | Yardanico | fontFamily is only for canvas |
01:42:37 | Yardanico | https://github.com/trustable-code/NiGui/search?q=fontFamily&unscoped_q=fontFamily |
01:42:54 | Yardanico | nigui is quite simple, it might not have some advanced stuff |
01:43:24 | FromDiscord | <codic> awww so I can't change the font of regular windows? |
01:43:31 | Yardanico | doesn't seem so |
01:44:27 | FromDiscord | <codic> Yesssss! |
01:44:37 | FromDiscord | <codic> app.defaultFontFamily |
01:44:47 | Yardanico | ? |
01:44:51 | FromDiscord | <codic> that worked |
01:44:56 | Yardanico | ah I see |
01:44:58 | FromDiscord | <codic> and app.defaultFontSize |
01:44:59 | FromDiscord | <codic> yay |
01:45:57 | FromDiscord | <KingDarBoja> https://play.nim-lang.org/#ix=2kxN |
01:46:02 | FromDiscord | <KingDarBoja> This is what I meant |
01:46:12 | Yardanico | so what's the issue here? |
01:46:14 | * | FromDiscord <KingDarBoja> Ignore those prop names lol |
01:46:37 | Yardanico | ah I see |
01:46:38 | FromDiscord | <KingDarBoja> If I wanted something like that... |
01:46:49 | Yardanico | that's how you do it |
01:46:51 | Yardanico | https://play.nim-lang.org/#ix=2kxO |
01:46:59 | Yardanico | if you have nested object variants it's still the same object |
01:47:11 | FromDiscord | <KingDarBoja> Oh ok |
01:47:28 | FromDiscord | <KingDarBoja> Also, I noticed the `repr` does print the subkind but it has a different formatting |
01:47:41 | Yardanico | repr shouldn't really be used for normal printing |
01:47:42 | FromDiscord | <KingDarBoja> [count = 5, germanyidkProp = "", lightspeed = 0] |
01:47:43 | Yardanico | it's for debugging |
01:48:00 | FromDiscord | <KingDarBoja> Ok |
01:48:25 | FromDiscord | <KingDarBoja> Oh, a simple echo is enough |
01:48:27 | FromDiscord | <KingDarBoja> Thank you ๐ |
01:48:47 | * | chemist69 quit (Ping timeout: 240 seconds) |
01:49:46 | FromDiscord | <KingDarBoja> ๐ |
01:50:42 | FromDiscord | <KingDarBoja> I am happy with how I got rid of those type conversions by using OV |
01:50:44 | FromDiscord | <Rika> no kissing, its social distancing rn |
01:50:51 | FromDiscord | <Rika> smh |
01:51:01 | FromDiscord | <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:17 | FromDiscord | <Rika> yeah i guess it is |
01:54:25 | FromDiscord | <Rika> it feels so good consolidating many types into one |
01:54:47 | Yardanico | although object variants is still runtime dispatch in a way, but yeah, it's certainly better than 100500 types |
01:55:06 | Yardanico | because you do different stuff based on different kinds of objects and kind is decided at runtime |
01:55:54 | FromDiscord | <KingDarBoja> I like when my tests still passing after each refactor step |
01:56:03 | FromDiscord | <KingDarBoja> I am getting closer to one single kind |
01:56:10 | Yardanico | object* |
01:56:19 | * | FromDiscord <KingDarBoja> be proud Rika-sensei |
01:56:55 | FromDiscord | <Rika> > tests |
01:56:58 | FromDiscord | <Rika> me: ._. |
01:57:00 | Yardanico | XDD |
01:57:05 | FromDiscord | <Rika> "what tests: |
01:57:22 | FromDiscord | <Rika> man i have to write tests for so many beatmaps its pretty insane |
01:58:06 | Yardanico | well nim itself has around 1.8k test files |
01:58:19 | Yardanico | and that's ~100k cloc of of Nim code |
01:58:41 | Yardanico | the compiler itself is 60k cloc |
01:58:50 | Yardanico | stdlib 80k cloc |
01:59:30 | FromDiscord | <Rika> ``` ~> find /home/deodex/Documents/CODE/Nim/circa/test_suite/ -type f | wc -l 2020ๅนด05ๆ03ๆฅ 09ๆ58ๅ13็ง |
01:59:30 | FromDiscord | <Rika> 5975``` |
01:59:39 | FromDiscord | <Rika> oops, left the date |
01:59:51 | Yardanico | well but you mostly test the same software and stuff :P |
01:59:55 | Yardanico | but yeah, cool that there's a lot of tests |
02:00:01 | FromDiscord | <Rika> its not tests |
02:00:05 | FromDiscord | <Rika> its just beatmap files |
02:00:11 | FromDiscord | <Rika> i still have to write the tess |
02:00:16 | Yardanico | automatically generate them |
02:00:31 | FromDiscord | <Rika> not easy wrt. difficulty calc tests |
02:00:46 | FromDiscord | <KingDarBoja> `if Rika not lazy then do tests else be lazy` |
02:00:53 | FromDiscord | <Rika> because i need to query the API for that, for each map, each gamemode, and each mod combination |
02:01:04 | FromDiscord | <Rika> which is a lot of queries |
02:01:16 | Yardanico | doesn't the osu db contain diff calculation? |
02:01:20 | Yardanico | just use the osu database lol |
02:01:22 | FromDiscord | <Rika> i dont need to do all mod combinations, but i'll need all game modes |
02:01:30 | Yardanico | it'll calculate all diffs and then you just query the DB |
02:01:42 | FromDiscord | <Rika> hmm actually osu has a tool |
02:01:45 | Yardanico | it uses sqlite |
02:01:51 | FromDiscord | <Rika> yeah okay thisll be easier than i though |
02:01:59 | FromDiscord | <Rika> first, ill finish the code |
02:02:19 | FromDiscord | <KingDarBoja> I am adding comments to the spec, that's why I am slower |
02:02:32 | FromDiscord | <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:51 | FromDiscord | <KingDarBoja> Question |
02:07:55 | Yardanico | Answer |
02:08:01 | FromDiscord | <KingDarBoja> Style guide says |
02:08:07 | FromDiscord | <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:17 | Yardanico | yeah that's outdated |
02:08:32 | Yardanico | you don't need pure pragma to specify enum members without full qualification |
02:08:41 | FromDiscord | <KingDarBoja> But it is okay to prefix my kinds like nkChild |
02:08:44 | Yardanico | yeah ofc |
02:08:49 | FromDiscord | <KingDarBoja> As my parent type is Node lol |
02:08:53 | FromDiscord | <KingDarBoja> Ok |
02:08:57 | Yardanico | style guide is not mandatory |
02:09:24 | FromDiscord | <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:31 | FromDiscord | <KingDarBoja> bollocks, the same field name on shared kinds is annoying |
02:18:36 | FromDiscord | <KingDarBoja> Need to rename them ๐ข |
02:18:41 | Yardanico | just prefix them |
02:18:46 | Yardanico | sField |
02:18:48 | Yardanico | objField |
02:18:50 | Yardanico | propField |
02:21:17 | FromDiscord | <KingDarBoja> Jum, I can't put `##` comments before each `of kind` |
02:21:21 | FromDiscord | <KingDarBoja> Only after the |
02:21:26 | FromDiscord | <KingDarBoja> after them* |
02:21:34 | Yardanico | ofc lol |
02:21:37 | Yardanico | what did you expet |
02:21:40 | Yardanico | expect* |
02:22:20 | FromDiscord | <KingDarBoja> I didn't know lol |
02:24:52 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:27:01 | * | muffindrake joined #nim |
02:34:12 | FromDiscord | <dayl1ght> in vscode, is there a way to view the typesof a nim variable/expression? |
02:34:34 | Yardanico | yes, hover over it |
02:34:56 | Yardanico | ctrl+lmb to go to definition |
02:36:01 | FromDiscord | <dayl1ght> hover doesn't work for me ๐ https://imgur.com/a/2Ipy67p |
02:36:29 | Yardanico | ah, in this case it won't work |
02:36:48 | Yardanico | when you reference "test" somewhere else and hover over that - it'll show the type |
02:37:12 | FromDiscord | <exelotl> maybe the warning is swallowing the other useful information |
02:37:21 | Yardanico | nah |
02:37:24 | FromDiscord | <dayl1ght> ah referencing works, thanks |
02:52:38 | FromDiscord | <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:27 | FromDiscord | <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:24 | FromDiscord | <Cerberus|The Enby> Can nim build a disassembler? |
03:05:36 | FromDiscord | <Rika> why not |
03:05:56 | FromDiscord | <bedwardly-down> Possibly. I mean any language can do pretty anything with the right design and will |
03:06:06 | FromDiscord | <bedwardly-down> Possibly. I mean any language can do pretty much anything with the right design and will |
03:10:28 | FromDiscord | <KingDarBoja> and patient, don't forget that |
03:16:55 | FromDiscord | <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:16 | FromDiscord | <Rika> no need to make them variable in the type |
03:17:36 | FromDiscord | <Rika> all fields are var if the type is instantiated in a `var` |
03:17:45 | FromDiscord | <Rika> fields immutable if in a `let` |
03:17:48 | FromDiscord | <dayl1ght> ah my full code had `let object = ...` so that was the problem |
03:17:50 | FromDiscord | <dayl1ght> thanks! |
03:18:43 | FromDiscord | <dayl1ght> is it possible to make _some_ of the fields immutable though? |
03:18:49 | FromDiscord | <Rika> no |
03:18:54 | FromDiscord | <Rika> well, technically |
03:19:16 | FromDiscord | <Rika> with accessor procs and the like then making the field itself not exported |
03:19:21 | FromDiscord | <Rika> within the same file, not at all |
03:20:31 | leorize | !repo nim-final |
03:20:45 | FromDiscord | <Rika> dead |
03:20:51 | FromDiscord | <Rika> rest in peace, disbot |
03:23:42 | leorize | nimble.directory is also dead federico3 |
03:25:01 | leorize | https://github.com/Quelklef/nim-finals |
03:25:04 | leorize | here it is |
03:28:56 | FromDiscord | <dayl1ght> nice! |
03:33:00 | leorize | this module could probably use some updates |
03:37:49 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:38:32 | skrylar[m] | interesting |
03:38:56 | skrylar[m] | i do on rare occasion wonder why nim doesn't have proper constness, but then usually shrug |
03:41:25 | skrylar[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:58 | audiofile | pmunch does your vim-lsp not work with ale? |
04:07:02 | audiofile | oh hes not here |
04:07:05 | audiofile | frowny face |
04:07:24 | audiofile | s/vim/nim |
04:08:34 | * | chapl quit (Quit: leaving) |
04:09:42 | Prestige | audiofile: it should if ale supports lsp |
04:10:19 | Prestige | nimlsp just doesn't support a ton of features yet, and only evaluates the buffer on write |
04:10:36 | Prestige | but you should get diagnostics and autocomplete, at least |
04:14:03 | audiofile | oh ok, I'll have to look into it then, thanks for confirming, Prestige |
04:15:06 | Prestige | Sure 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:04 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae4584d898fe7a37615a25] |
04:16:10 | FromGitter | <bung87> what wrong with this? |
04:16:29 | audiofile | I've been hearing a lot about 'coc' what is it -- is it an lsp? |
04:17:12 | Prestige | audiofile: yeah, lsp client. It's pretty great but nothing is perfect |
04:17:21 | Prestige | I prefer it to ale personally |
04:18:07 | audiofile | what am I missing? |
04:18:44 | audiofile | just curious =) |
04:21:59 | FromGitter | <bung87> `expression 'await read(future)' has no type (or is ambiguous)` |
04:22:26 | FromDiscord | <Rika> its not an async proc? |
04:22:47 | FromGitter | <bung87> `asyncstreams.read: proc (future: FutureStream[read.T]): Future[tuple of (bool, T)]` |
04:23:01 | FromDiscord | <Rika> the callback proc |
04:23:02 | FromDiscord | <Rika> isnt |
04:24:16 | FromDiscord | <Rika> did that fix it? |
04:26:25 | FromGitter | <bung87> ok, I am trying |
04:27:33 | disruptek | tonight's devel is still producing nil derefs in async. |
04:28:27 | disruptek | i'll run the bot w/o orc for now, i guess. |
04:30:29 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae48e522f9c45c2a67941f] |
04:39:45 | skrylar[m] | after peering over some of the memory stuff in beef i guess i slightly understand newruntime better |
04:40:04 | skrylar[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:19 | FromGitter | <bung87> `discard dest.writeFromStream(future)` solved |
04:59:16 | * | silvernode quit (Ping timeout: 246 seconds) |
05:02:41 | Prestige | audiofile: tbh I don't remember the differences, but it's worth checking out imo |
05:31:41 | skrylar[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:16 | audiofile | ??? |
05:41:13 | Prestige | what |
05:48:39 | * | kungtotte quit (Read error: Connection reset by peer) |
05:49:35 | * | kungtotte joined #nim |
05:51:23 | FromGitter | <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:56 | zacharyc2rter | how do I deal with - is not GC-safe as it performs an indirect call and `--gc:arc`? |
05:53:13 | audiofile | no, I ??? that image by skrylar[m] |
05:54:46 | skrylar[m] | text engine in nim =p |
05:55:05 | zacharyc2rter | I guess there's now way to do this now? ughhhh |
05:55:05 | zacharyc2rter | https://github.com/nim-lang/RFCs/issues/142 |
05:55:07 | disbot | โฅ Proposal to remove the `.gcsafe` effect from Nim ; snippet at 12https://play.nim-lang.org/#ix=26qX |
05:55:07 | audiofile | you mean like markove sentence generators? |
05:56:46 | skrylar[m] | no, knuth-plass linebreaking |
05:58:18 | audiofile | oh |
05:58:39 | FromDiscord | <Yardanico> @zacharyc2rter well you can use gcsafe in the proc body itself |
05:58:45 | zacharyc2rter | yeah it's just annoying |
05:59:06 | FromDiscord | <Yardanico> I know, it just needs to be disabled for arc/orc/boehm guess |
05:59:11 | FromDiscord | <Yardanico> Not sure how much work is that |
05:59:54 | leorize[m] | the ones with shared heaps can lax the requirements, but you can't fully remove it |
06:00:04 | zacharyc2rter | yeah |
06:12:49 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae60e19f0c955d7d9f3035] |
06:13:10 | FromGitter | <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:51 | FromDiscord | <Yardanico> This usually means that the future already completed and you're still trying to run global dispatcher |
06:23:21 | FromDiscord | <Yardanico> Or run that future |
06:24:29 | * | solitudesf joined #nim |
06:25:15 | FromGitter | <bung87> ok , let me think of it |
06:30:24 | FromGitter | <bung87> no idea, if I dont using `waitFor`, process finish before complete, if I using it error throw. |
06:40:49 | FromGitter | <bung87> using `copyFile` for now,just one line :( |
06:42:13 | Yardanico | anyway you should never call waitFor in async procedures |
06:47:49 | FromGitter | <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:35 | FromDiscord | <Rika> flatmap not in sequtils? |
07:05:38 | FromDiscord | <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:32 | Araq | I 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:35 | Araq | so now the obsolete, unsupported -d:useWinAnsi switch got bugfixes :-) |
07:54:28 | Araq | maybe Windows RT only supports the ansi versions? |
07:56:30 | Zevv | don't unsupport or obsolete, just throw it out already! |
07:57:32 | * | gangstacat quit (Ping timeout: 265 seconds) |
07:59:25 | Araq | well it is useful to the one guy who now maintains it |
07:59:35 | Araq | it is fine |
08:21:37 | * | Vladar joined #nim |
08:23:31 | skrylar[m] | Zevv: no, bad. *hits with newspaper* |
08:23:39 | skrylar[m] | you can only delete stuff after its been deprecated a cycle |
08:25:21 | Araq | skrylar[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:50 | Araq | as 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:32 | Araq | zacharyc1rter: 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:20 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae8a407a24ff01b0fb4676] |
09:09:30 | FromGitter | <bung87> what's wrong with this code? |
09:10:05 | Yardanico | you're discarding a future |
09:10:21 | Yardanico | "discard src.readToStream(destStream)" should be "await src.readToStream(destStream)" |
09:10:32 | FromGitter | <bung87> but await , waitFor also not wrok |
09:10:35 | Yardanico | or if you don't want to wait for completion, asyncCheck |
09:10:42 | Yardanico | @bung87 well discard is wrong here anyway |
09:11:13 | FromGitter | <bung87> `template/generic instantiation of `await` from here` |
09:11:29 | Yardanico | give full error from the compiler itself please |
09:11:51 | FromDiscord | <Recruit_main707> i remember this |
09:11:56 | FromGitter | <bung87> I only have `copyFile ` one solution, I just want figure it out |
09:12:42 | FromGitter | <bung87> `Error: Await only available within .async` |
09:13:13 | FromGitter | <bung87> editor also mark `{.async.}` as error |
09:13:54 | Yardanico | i don't need editor |
09:14:02 | Yardanico | please post full output from the compiler itself when trying to compile this example |
09:15:29 | FromGitter | <bung87> ok let me find some place to paste |
09:16:23 | FromGitter | <bung87> https://pastebin.com/0ddTUxgs |
09:16:44 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eae8bfcadb0ec5c2be04f62] |
09:20:14 | FromGitter | <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:47 | FromGitter | <bung87> oh, I solved it |
09:43:35 | * | audiofile quit (Quit: Going offline, see ya! (www.adiirc.com)) |
10:40:25 | FromGitter | <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:25 | FromGitter | <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:18 | skrylar[m] | alright i forgot there was a clever trick to this. coded it in and now things work okay. |
10:58:20 | Yardanico | i guess that's a good enough documentation :P https://yardanico.github.io/nim-mathexpr/mathexpr.html |
10:58:52 | Yardanico | apparently github pages won't display any files unless you set a default jekyll theme (even if you're not using one) lol |
11:16:47 | Yardanico | wow I didn't know using the VM in custom code was so easy https://forum.nim-lang.org/t/6287 |
11:17:44 | Araq | Yardanico: awaiting your bug report :-) |
11:18:27 | Yardanico | Araq: 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:48 | Yardanico | it still depends on quite a lot of stuff and quite big (~600 loc), and most of all it depends on the network |
11:19:26 | Araq | submit it anyway I'm bored and it's Sunday |
11:19:49 | Yardanico | wait I thought today was monday lol |
11:20:16 | Yardanico | it's https://gist.github.com/Yardanico/0b5fd6a630bb2a99ba2dce320a9a0d05, IDk if you would prefer the original async version or this one |
11:20:38 | Yardanico | this one doesn't use the async macro and only needs asyncdispatch for the dispatcher (and asyncfutures for futures) |
11:21:28 | Yardanico | with 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:38 | Yardanico | *exits |
11:25:05 | Yardanico | well ofc it's due to sink inference as well (it works without it) |
11:27:25 | Araq | well the sinkInference exposed bugs but is usually not the root cause |
11:27:34 | Yardanico | oh |
11:28:20 | Araq | see my tests, I used 'sink T {.nosinks.}' in your other bug report to trigger the same bug |
11:28:40 | Yardanico | ohh |
11:29:07 | Yardanico | I'll try poking random procs with {.nosinks.} :P |
11:29:26 | Araq | awesome, thanks |
11:33:30 | federico3 | leorize: looks pretty alive to me ;) |
11:35:22 | Araq | Yardanico: I get |
11:35:26 | Yardanico | Araq: seems like adding nosinks to wasBuffered solves the issue |
11:35:30 | Araq | [":beckett.freenode.net NOTICE * :*** Looking up your hostname..."] |
11:35:30 | Araq | [":beckett.freenode.net NOTICE * :*** Checking Ident"] |
11:35:30 | Araq | [":beckett.freenode.net NOTICE * :*** Found your hostname"] |
11:35:32 | Araq | [":beckett.freenode.net NOTICE * :*** No Ident response"] |
11:35:42 | Yardanico | yeah after that it hangs and then exits with exit code 0 or crashes |
11:35:53 | Yardanico | with default GC it further connects to the channel #nim-test |
11:35:56 | Araq | ah ok, it took a while but now it crashed |
11:36:23 | Yardanico | yeah I checked, wasBuffered with {.nosinks.} makes it work for some reason |
11:36:34 | Yardanico | ah wait no |
11:36:40 | Yardanico | maybe not it, I have nosinks in a few other places too |
11:37:20 | Yardanico | ah no, after all it really is wasBuffered |
11:40:36 | Araq | same here, seems to work with .nosinks for wasBuffered, how strange |
11:40:44 | Araq | wasBuffered is pretty simple |
11:41:00 | dom96 | cool, thanks for looking at fixing IRC with orc |
11:41:14 | Yardanico | dom96: well it already works with --sinkInference:off :P |
11:41:30 | Araq | we want sink inference though, it's excellent |
11:41:44 | dom96 | Next step, test nimforum? :) |
11:42:02 | Yardanico | Araq: well adding nosinks to "send" (which is just below the wasBuffered) instead of wasBuffered solves it too |
11:42:02 | Araq | and you can always trigger the same bugs with explicit 'sink T' anyway |
11:42:25 | Araq | Yardanico: yeah I see it, send is also getting 'sink' inference otherwise |
11:42:52 | dom96 | what does `sink` mean again? |
11:42:53 | * | abm joined #nim |
11:43:18 | Araq | dom96: "I am stealing this parameter" |
11:44:50 | Yardanico | btw my old social network bot seems to work with orc, although it only uses async httpclient for async stuff |
11:45:08 | Araq | for example, put(h: var Table; key: sink K; value: sink V) # h takes over the (key, value) pair |
11:45:41 | Araq | you don't have to use it, but it can make the code faster |
11:46:07 | dom96 | takes it over in what sense? any docs on this? |
11:46:13 | Yardanico | https://nim-lang.org/docs/destructors.html#sink-parameters |
11:46:28 | Araq | dom96: it was part of my fosdem talk too |
11:46:32 | Yardanico | basically it doesn't make a copy I guess |
11:46:37 | Yardanico | or something like that |
11:47:52 | dom96 | ahh, so it ensures that the calling code does not modify those parameters |
11:47:56 | Araq | it's about moving things into the right place rather than copying them, yes |
11:48:31 | dom96 | so what happens if I write var x = 42; table.put("foo", x); x = 52? |
11:48:39 | Araq | dom96: no, "mutability" doesn't play a role here |
11:48:49 | Yardanico | dom96: 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:05 | Yardanico | because control flow analysis will understand that you still need x afterwards :P (my guess) |
11:49:17 | Araq | dom96: it's then turned into table.put("foo", copyof(x)) |
11:49:45 | dom96 | so `sink` enables this analysis? |
11:49:50 | Yardanico | or automatic sink inference |
11:49:54 | dom96 | i.e. if no `sink` is specified we always get `copyof` |
11:49:54 | Yardanico | which is enabled by default |
11:50:07 | dom96 | (assuming `sink` is not inferred) |
11:50:13 | Araq | dom96: not quite... :-) |
11:50:26 | * | filcuc joined #nim |
11:50:37 | dom96 | explain :) |
11:50:48 | Araq | if you don't have the 'sink', inside the *body* of 'put' the copy has to be made |
11:51:17 | Araq | but if you have the 'sink' the compiler can the copy into a move inside the body of 'put' |
11:51:47 | Yardanico | "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:51 | Yardanico | even for stuff like HttpClient |
11:52:06 | Yardanico | so we don't need to close it explicitly :P |
11:52:14 | Araq | but 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:09 | Araq | in 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:10 | dom96 | so we annotate the types, but what matters is when that parameter is used in the body |
11:53:18 | dom96 | or do we annotate it with `sink` in the body too? |
11:54:13 | Araq | no, 'sink' is only for parameters |
11:54:19 | Yardanico | dom96: there's also "lent" btw |
11:54:40 | Araq | and also, the inference ensures that you don't have to do anything, the compiler does it all for you |
11:58:14 | Araq | Yardanico: we are also getting 'lent' inference :P |
11:58:20 | Yardanico | lol |
11:59:58 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:00:17 | Yardanico | Araq: 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:45 | Araq | yeah but the async event loop leaks memory |
12:00:49 | Yardanico | oh |
12:01:02 | Araq | as it creates a large seq in a thread local variable iirc |
12:01:24 | Araq | dom96 can fix it for us :-) |
12:01:29 | Yardanico | hah |
12:01:46 | dom96 | 90% sure I wasn't the one who added whatever large seq you're talking about :P |
12:01:53 | Araq | I know |
12:01:57 | dom96 | maybe we should ask the person that did to fix it? :D |
12:02:06 | Yardanico | orc with async with threads |
12:02:13 | Yardanico | the ultimate dream is near |
12:02:30 | Araq | doesn't have to be fixed, only needs an API 'nukeSelectors' |
12:02:31 | dom96 | you'll still need a way to await channels/FlowVars afaik |
12:02:57 | dom96 | Araq, but why would this seq leak, it surely doesn't grow forever? |
12:03:20 | Araq | dom96: right but it does make things harder to measure |
12:03:39 | Araq | Yardanico: I'm using |
12:03:42 | Araq | proc wasBuffered(irc: Irc; message: sink string; sendImmediately: bool): bool |
12:03:42 | Araq | proc send(irc: Irc; message: string; sendImmediately = false): Future[void] {.nosinks.} |
12:03:52 | Araq | and it's also stable with that variation |
12:04:24 | Yardanico | yeah works for me too |
12:05:38 | Araq | bbl |
12:05:54 | dom96 | Araq, 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:02 | FromDiscord | <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:15 | Yardanico | that would be really complicated |
12:11:34 | Yardanico | you 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:14 | dom96 | it's a fair question |
12:19:45 | dom96 | AFAIK 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:28 | Yardanico | seems 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:37 | Yardanico | and when it crashes it's easy to restart with a script :P |
12:24:53 | FromDiscord | <Recruit_main707> good job :) |
12:25:12 | Yardanico | well setting intents and fixes in dimscord itself helped that quite a lot |
12:26:00 | Yardanico | last 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:12 | Yardanico | "Error: unhandled exception: Device or resource busy" "Additional info: "No address associated with hostname" [OSError]" |
12:30:20 | leorize[m] | getaddrinfo crashing again lol |
12:30:56 | leorize[m] | ignore the errno, it's not supposed to make sense for that error |
12:31:21 | Yardanico | well 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:12 | zacharycarter | morning |
12:38:30 | Yardanico | why do you have 3 IRC accounts? :D |
12:39:33 | zacharycarter | I have lost tmux sessions I think |
12:39:37 | zacharycarter | and they're probably still connected to irc lol |
12:40:04 | zacharycarter | or I guess one still is at least |
12:40:07 | zacharycarter | but at least I got my nick back! |
12:40:24 | Yardanico | well register it on freenode to not lose it :P |
12:40:26 | zacharycarter | I'm almost ready to show off this fiber based job system |
12:40:30 | zacharycarter | oh I am registered |
12:41:03 | zacharycarter | it's just the account was still connected so it changed my nick to zacharyc1rter or whatever |
12:41:24 | FromDiscord | <Joshua S. Grant> Is discord's offtopic channel and #nim-offtopic bridged? It doesn't seem like it |
12:41:30 | zacharycarter | no they'r enot |
12:41:42 | zacharycarter | I think gitter and Nim are though |
12:41:58 | Yardanico | they are |
12:42:01 | zacharycarter | oh |
12:42:29 | FromGitter | <sheerluck> I'm in gitter |
12:42:43 | Yardanico | I run ircord on my own PC right now which bridges #nim-offtopic with discord |
12:42:52 | Yardanico | for debugging/testing stuff |
12:48:22 | FromDiscord | <KrispPurg> Yardancio, what is your common WS Error. |
12:48:35 | FromDiscord | <KrispPurg> Yardancio, what is your common ws Error? |
12:48:36 | Yardanico | Error while reading websocket data :: socket closed |
12:48:42 | FromDiscord | <KrispPurg> Ah |
12:48:49 | Yardanico | a lot of times there's also "An error occurred while parsing data: ๏ฟฝ" but it doesn't seem to crash with that |
12:49:07 | FromDiscord | <KrispPurg> I am aware of that one. |
12:49:29 | livcd | Yardanico: oh so in theory we can own you through ircord right now! |
12:49:37 | Yardanico | wat? |
12:49:53 | FromDiscord | <KrispPurg> wut |
12:51:49 | FromDiscord | <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:34 | Yardanico | what happens if we compile nim compiler with LTO and PGO? hmm |
12:53:47 | Yardanico | well for PGO we'll use compiler itself to generate profiled data |
12:54:14 | * | badge quit (Remote host closed the connection) |
12:56:55 | Yardanico | linking takes quite a while as expected :P |
13:00:13 | livcd | https://github.com/christianscott/levenshtein-distance-benchmarks |
13:00:19 | livcd | https://www.christianfscott.com/making-rust-as-fast-as-go/ |
13:00:38 | Yardanico | wat |
13:00:51 | Yardanico | "making-rust-as-fast-as-go" did i read that correctly |
13:07:01 | livcd | TLDR: default osx mem allocator that Rust uses is slower than Go's allocator |
13:07:17 | * | PMunch quit (Quit: leaving) |
13:13:42 | leorize | Yardanico: I'd not recommend PGO though |
13:13:59 | * | fredrikhr quit (Read error: Connection reset by peer) |
13:14:11 | leorize | the nim compiler doesn't do that much metaprogramming |
13:14:23 | leorize | for quality profiles compile some of mratsim's projects |
13:14:25 | * | fredrikhr joined #nim |
13:14:39 | Yardanico | oh |
13:14:45 | Yardanico | so I guess the VM will benefit a lot from PGO? |
13:14:51 | Yardanico | well yeah that's understandable |
13:15:10 | Yardanico | that's why most interpreted languages ship binaries with PGO :P |
13:21:33 | disruptek | disbot: you alive? |
13:21:34 | disbot | yep. ๐ |
13:21:53 | Yardanico | #14159 |
13:21:55 | disbot | https://github.com/nim-lang/Nim/issues/14159 -- 5[ARC] Segfault with cyclic references (?) ; snippet at 12https://play.nim-lang.org/#ix=2k4U |
13:21:56 | Yardanico | yay |
13:22:16 | Yardanico | disruptek: you alive? |
13:22:42 | disruptek | the bot crashes with orc and sinkinference off. |
13:22:47 | disruptek | bbiab |
13:23:11 | Yardanico | wow |
13:25:46 | * | filcuc quit (Ping timeout: 272 seconds) |
13:55:46 | * | tane joined #nim |
13:57:19 | disruptek | Araq: 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:12 | Zevv | I could use some direction in my life, in genal |
14:02:14 | Zevv | general |
14:02:23 | disruptek | zevv, you're back |
14:02:52 | Zevv | I was never away |
14:03:46 | disruptek | how are you holdin' up in the midst of this pandemic? |
14:04:14 | disruptek | it must really chaffe your ass that you cannot mingle with the throngs at the shops. |
14:04:45 | Zevv | oh 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:55 | Zevv | I do miss concerts and making music the most I think |
14:05:06 | FromGitter | <Bennyelg> Hi @dom96 Can I how can I wrap the resp object in jester ? |
14:05:12 | Zevv | although I do the latter online these days |
14:05:34 | Yardanico | wdym by that @Bennyelg |
14:07:27 | disruptek | lemme hear your music. |
14:09:01 | Zevv | it's volatile |
14:09:07 | Zevv | it plays and then its gone |
14:09:16 | disruptek | i'm okay with that. |
14:09:59 | zacharycarter | I 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:17 | zacharycarter | when I compile though, I get an error about the c type being unknown from stdlib_system.nim.c |
14:10:25 | zacharycarter | dafuq? why is a reference to that type in that file? |
14:10:28 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:10:44 | Yardanico | zacharycarter: maybe you pass your object to some template or something like that from system |
14:10:50 | zacharycarter | hmmm |
14:10:52 | * | fredrikhr joined #nim |
14:10:59 | leorize | maybe don't use emit? :P |
14:11:25 | zacharycarter | add a way to add volatile qualifiers to types and I will :P |
14:11:39 | zacharycarter | can we just make codegenDecl work with types too? |
14:11:43 | zacharycarter | that would solve all my problems |
14:13:15 | dom96 | Bennyelg: not sure what you mean by "wrap" |
14:15:08 | leorize | zacharycarter: what are you using volatile for? |
14:15:08 | disruptek | zacharycarter: make an issue, it might be something in my neck of the woods. |
14:16:02 | disruptek | i would need a test, though. |
14:16:41 | zacharycarter | leorize - 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:56 | zacharycarter | it'd also be nice for adding attributes to typedefs like alignment attributes |
14:17:24 | zacharycarter | to declare minimum alignment for types |
14:17:38 | zacharycarter | disruptek: it probably needs to go through an RFC first right? |
14:17:52 | zacharycarter | maybe Araqq would have reservations |
14:17:56 | disruptek | ideally. maybe someone has a workaround. |
14:18:00 | leorize | {.align.} is already a thing? |
14:18:04 | disruptek | i'm thinking it's a pragma. |
14:18:07 | zacharycarter | but it doesn't work for types |
14:18:15 | zacharycarter | only procs and member variables - which is fine |
14:18:26 | zacharycarter | err sorry member properties and variables |
14:18:35 | * | filcuc joined #nim |
14:19:04 | zacharycarter | I'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:26 | leorize | well RFC then :P |
14:19:31 | zacharycarter | okay :) |
14:21:47 | leorize | though I'm not sure if volatile is the solution to your problem |
14:22:49 | leorize | actually I'm not even sure what's the problem :P |
14:25:29 | zacharycarter | Well my original complaint was that my emitted code is being referenced in a system source file. |
14:25:52 | zacharycarter | I'm marking an int32 alaias as volatile because I'm using it in atomic builtins |
14:25:59 | * | PMunch joined #nim |
14:26:32 | FromGitter | <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:43 | Yardanico | ? |
14:26:49 | Yardanico | how would you like it instead? |
14:26:53 | leorize | zacharycarter: shouldn't you be able to use atomic without volatile? |
14:26:53 | zacharycarter | like - `__sync_lock_test_and_set` |
14:26:59 | FromGitter | <Bennyelg> I'll explain the problem: |
14:27:34 | zacharycarter | two threads might share the volatile int though |
14:27:43 | FromGitter | <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:01 | zacharycarter | but sure I guess I can |
14:28:15 | zacharycarter | I don't think anything will blow up if I dont' mark the type alias as being volatile |
14:28:19 | FromGitter | <Bennyelg> you get error since functions are not there (but they are - its probably an import errors) |
14:28:21 | leorize | zacharycarter: the edits inside same program doesn't need volatile afaict |
14:28:25 | disruptek | don't actually make a pr to rfcs; just create an issue. |
14:28:43 | leorize | you need volatile when nothing even try to touch that variable and it can still change :) |
14:29:08 | leorize | I might be wrong though :P |
14:29:16 | zacharycarter | hmm yeah I'm not 100% sure either |
14:29:22 | FromGitter | <Bennyelg> you get something like: โ /Users/benny/DLM/backend/src/routes/model1.nim(10, 33) Error: undeclared identifier: 'getModel1' |
14:29:29 | zacharycarter | I'll do more research - in a lot of example code i read online though they're using volatile |
14:29:32 | zacharycarter | but a lot of example code is wrong too |
14:29:33 | FromGitter | <Bennyelg> but if you compile the file directly - all passes |
14:30:20 | leorize | though this is the kind of thing you'd use memory barriers on |
14:30:40 | leorize | volatile is a bit too broad and will prevent certain optimizations |
14:32:26 | * | silvernode joined #nim |
14:32:28 | zacharycarter | okay yeah that makes sense could be more precise with types of barriers |
14:32:37 | zacharycarter | need to take the doggos out for a walk, bbl |
14:33:25 | dom96 | Nim in Action is 50% off today in case anyone wants to grab a copy: https://book.picheta.me |
14:34:28 | Yardanico | i will :P (yes I still haven't bought it) |
14:34:49 | Yardanico | want a printed book about nim |
14:34:52 | * | xcm quit (Remote host closed the connection) |
14:35:01 | dom96 | awesome |
14:35:02 | FromDiscord | <Recruit_main707> 25 bucks is something i might be able to afford |
14:36:19 | * | krux02 joined #nim |
14:36:19 | dom96 | also, 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:20 | FromGitter | <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:30 | Yardanico | although shipping to Russia costs quite a bit with manning, but it's ok I guess :P |
14:37:54 | Yardanico | $35 total ($10 shipping to Russia lol :P) |
14:38:11 | leorize | one day I'll have the money to buy it :P |
14:38:16 | * | Vladar joined #nim |
14:38:30 | dom96 | Yardanico, is amazon operating in Russia? |
14:38:37 | Yardanico | dom96: kinda yes |
14:38:50 | Yardanico | I mean there's no russian amazon |
14:38:59 | Yardanico | but you can order from other countries' amazon websites to ship to russia |
14:39:09 | dom96 | might be worth checking if it's cheaper that way |
14:39:17 | dom96 | I've seen it much cheaper in UK amazon for example |
14:39:21 | * | thomasross joined #nim |
14:39:27 | Yardanico | can't ship to russia from UK amazon for some reason :P |
14:39:45 | supakeen | Pfft Russians are much more inventive. |
14:39:51 | Yardanico | and anyway I already paid for it, now comes the wait :D |
14:40:10 | supakeen | I often get the option 'we can ship from $nearest-eu country for 5 dollars more'. |
14:40:10 | Yardanico | well I mean I can access the ebook right away |
14:40:19 | supakeen | And then I guess they drive over the border and ship it from there. |
14:40:54 | supakeen | It's much faster than goign through customs. |
14:41:39 | supakeen | Things shipping from Ukraine or Russia always take forever otherwise :( |
14:42:33 | Yardanico | my biggest international order was my PC (3700X with wraith prism + mobo + 16gb ram) from Germany (computeruniverse) |
14:42:48 | Yardanico | it's cheaper because I didn't have to pay for 20% russian VAT lol |
14:43:01 | supakeen | Hehe. |
14:43:11 | supakeen | I order a lot of ex-Soviet electronics on ebay. |
14:43:18 | leorize[m] | the german didn't tax you or do they tax less? :p |
14:43:24 | Yardanico | they didn't tax me |
14:43:28 | Yardanico | since i'm not from EU |
14:43:43 | Yardanico | although some european stores already add russian VAT (and it's kinda required, idk why CU doesn't do that) |
14:43:50 | Yardanico | for example hetzner already does 20% russian VAT automatically |
14:44:12 | supakeen | probably depends if they have a russian entity as well? |
14:44:13 | leorize[m] | you get to abuse it while you still can :p |
14:44:27 | supakeen | (or did enough business with russians to figure it out) |
14:44:56 | leorize[m] | probably because too many used the loophole |
14:45:18 | Yardanico | well that "loophole" if you call it that was around for at least 6 years |
14:45:53 | leorize[m] | where I'm from they just close the loophole with a huge import tax :) |
14:46:43 | supakeen | yea over here if i send stuff to outside-the-EU i only need to register it as export |
14:46:49 | supakeen | the rest of it is up to the receiving country |
14:46:59 | supakeen | if they don't check incoming packages/do other stuff hey no taxes |
14:47:03 | Yardanico | well yeah we have import tax in russia too |
14:48:18 | Yardanico | and before 1st january 2020 it was 30% if you order something over 500 euro |
14:48:24 | supakeen | that's steep |
14:48:45 | Yardanico | now it's 15% if you order over 200 euro |
14:49:02 | supakeen | we 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:22 | supakeen | and this only applies to things coming from outside the EU |
14:49:31 | supakeen | because those are all exempt from everything :p |
14:49:44 | Yardanico | well before 1st january it was 500 euro limit _monthly_ for all your orders |
14:49:55 | Yardanico | now it's individual so you can order as many 199 euro deliveries as you want |
14:50:14 | Araq | so ... 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:28 | supakeen | i see a new business here, drop shipping for russia by splitting shipments to fall below the limit |
14:51:43 | leorize[m] | Araq: lol |
14:54:30 | Yardanico | Araq: what about Nim? :P |
14:54:47 | Yardanico | well i guess there's no need to question that since we already have a compile-time VM :P |
14:54:58 | Yardanico | but I just wonder about generics/static |
14:55:06 | leorize[m] | it's turing complete until you hit a generics bug |
14:55:06 | FromGitter | <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:07 | Araq | it's probably both undecidable and unsound, just like Java. |
14:55:48 | leorize[m] | @Bennyelg: put everything in a template, then call that template in the router |
14:56:05 | leorize[m] | we should probably implement that in jester too |
14:56:17 | Araq | https://docs.microsoft.com/en-us/archive/blogs/ericlippert/lambda-expressions-vs-anonymous-methods-part-five |
14:58:45 | * | Vladar quit (Quit: Leaving) |
14:59:05 | disruptek | Araq: mumble? |
14:59:31 | Araq | disruptek: I'm on the wrong computer fro mumble, what's up? |
15:00:15 | disruptek | so the sealing is done, i guess. now i need to figure out how the backend works. |
15:00:30 | disruptek | we just let it mutate locations? or move those into a new backend ast? |
15:00:57 | disruptek | not sure how ambitious you want the next step to be. |
15:01:35 | disruptek | the caching is a state machine now, which feels much more workable. |
15:05:56 | Araq | don't touch the backend, the backend should read the database and keep doing what it always did |
15:06:15 | FromGitter | <Bennyelg> not exactly followed, can you show me a quick example ? |
15:06:17 | disruptek | the problem is in the backend, though, afaik. |
15:06:36 | disruptek | just let it do whatever? |
15:06:42 | Araq | yeah |
15:06:47 | disruptek | okay |
15:06:50 | Araq | don't cache snippets or anything like that |
15:06:56 | * | liblq-dev joined #nim |
15:06:56 | disruptek | lemme get this working, then. |
15:07:08 | disruptek | i wanna gut loc so bad. |
15:07:28 | Araq | it's only the backend, we all know it sucks |
15:07:44 | Araq | if you want to, give it a decent IR |
15:08:09 | leorize | question: should I create multiple API for different kinds of process execution? |
15:08:12 | disruptek | yeah, lemme make it work then i'll make it correct. |
15:08:35 | leorize | currently I'm having an `exec()` API that takes the process configuration DSL and execute the process accordingly |
15:08:54 | leorize | but then there are use cases like only caring about the output, exitcode, etc. |
15:09:42 | leorize | should I make more API or should I add something like: `capture(output)` to the DSL? |
15:10:01 | FromDiscord | <treeform> When did nim's error messages get this good? `Error: the syntax for tuple types is 'tuple[...]', not 'tuple(...)' |
15:10:39 | FromGitter | <Bennyelg> I triied this: |
15:10:46 | FromGitter | <Bennyelg> `````` |
15:10:47 | FromGitter | <Bennyelg> `````` |
15:10:49 | FromGitter | <Bennyelg> import jester โ import ../utils/util โ โ template tp*(body: untyped): untyped = โ ... [https://gitter.im/nim-lang/Nim?at=5eaedef87a24ff01b0fbf438] |
15:10:56 | FromGitter | <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:35 | leorize | Bennyelg: looks like the indentation is all broken |
15:14:01 | Araq | treeform: 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:46 | FromDiscord | <treeform> Survey did good |
15:26:38 | * | zacharyc1rter joined #nim |
15:26:38 | * | zacharycarter joined #nim |
15:26:38 | * | zacharyc2rter joined #nim |
15:34:48 | Araq | leorize: make the API complete with streams etc and then add a simple DSL on top of the API |
15:34:56 | Araq | don't do things that only the DSL allows |
15:35:15 | leorize | yea I have that planned |
15:35:22 | leorize | too bad we don't have an async version of streams |
15:35:35 | leorize | and the name asyncstreams has been taken for something completely unrelated |
15:39:36 | Araq | when we wrote it, we thought these are async streams :P |
15:39:57 | disruptek | lol |
15:42:12 | dom96 | "Its api is still experimental and so is subject to change" |
15:42:30 | dom96 | and "Unstable api" in the docs |
15:42:40 | dom96 | means backwards compat rules don't apply |
15:42:54 | dom96 | (Don't really see much of a reason why what exists can't be kept for backwards compat though) |
15:43:07 | Yardanico | well same goes for "endians" but if you suddenly change its api some packages will break :P |
15:43:16 | Yardanico | wonder why endians is "unstable api" though |
15:43:25 | leorize | can we import chronos's asyncbuffers and friends? :P |
15:44:06 | Araq | leorize: 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:22 | Yardanico | https://github.com/loloicci/nimly was really surprised to find out it's GPLv3 :P |
16:09:18 | Yardanico | btw, 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:20 | Yardanico | in nim |
16:10:39 | * | PMunch quit (Quit: leaving) |
16:10:57 | FromDiscord | <mratsim> I suppose you can refer to GCC which is GPLv3 and can generate assembly from MIT code. |
16:12:55 | Araq | Yardanico: ask nimly's author but usually code generators have no influence on the license |
16:13:14 | Yardanico | well seems like nimly was initially under MIT but then the author made it GPLv3 :P |
16:13:18 | Yardanico | not that i need to use it though |
16:13:28 | Araq | it can only be different for code you need to compile/link with your code |
16:13:33 | Yardanico | ah ok |
16:14:05 | Araq | if your code A is in MIT and you run it through an obfuscator/macro/compiler it's still MIT afterwards |
16:14:13 | Araq | I think... |
16:14:45 | leorize[m] | gcc license permits it to be used without changing whatever it consumes into GPL |
16:14:53 | leorize[m] | however the AST from gcc is GPL :) |
16:15:50 | leorize[m] | https://www.gnu.org/licenses/gpl-faq.html#OOPLang |
16:15:53 | Yardanico | lol |
16:15:54 | leorize[m] | ^ might be related |
16:17:49 | Yardanico | it'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:41 | FromGitter | <Bennyelg> :/ |
16:21:52 | disruptek | i'm streaming, btw |
16:21:54 | disruptek | ~stream |
16:21:54 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
16:22:27 | Yardanico | your titles are getting increasingly creative |
16:29:59 | * | abm quit (Read error: Connection reset by peer) |
16:33:34 | FromGitter | <Bennyelg> I modify jester code, how do i re-compile and make my in version to run with it ? |
16:33:58 | Yardanico | "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:49 | dom96 | I created a gamedev channel on Discord in case anyone is interested in joining :) |
17:12:15 | Yardanico | I can try to bridge it to the same #nim irc |
17:12:18 | Yardanico | or no? |
17:12:34 | Yardanico | or maybe bridge to #nim-offtopic instead |
17:13:30 | FromDiscord | <Recruit_main707> or just use discord and accept that irc is dying :P |
17:13:41 | Yardanico | not gonna happen anytime soon |
17:14:01 | dom96 | nooo |
17:14:08 | dom96 | don't bridge |
17:14:13 | dom96 | this one is Discord-only |
17:14:16 | Yardanico | lol ok |
17:14:23 | Yardanico | I see what you're trying to do dom96 :P |
17:14:28 | FromDiscord | <Recruit_main707> its free premium |
17:15:18 | leorize[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:31 | Araq | dom96: discord? why not telegram? |
17:27:52 | * | vqrs quit (Ping timeout: 260 seconds) |
17:28:53 | FromDiscord | <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:44 | FromDiscord | <Recruit_main707> -d:release and gc:arc? |
17:29:44 | Yardanico | show the code |
17:29:48 | Yardanico | -d:danger * |
17:30:11 | FromDiscord | <Chiqqum_Ngbata> Yeah, I added all the fixin's |
17:30:35 | Yardanico | well show the code :P |
17:30:48 | Yardanico | as a paste |
17:31:33 | FromGitter | <Willyboar> It would be nice to have specific channel for game, desktop, web etc |
17:32:27 | FromDiscord | <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:09 | Yardanico | and did you see https://nim-lang.org/docs/editdistance.html |
17:35:27 | leorize[m] | gimme code and it will be as fast if not faster that the fastest :p |
17:35:31 | FromDiscord | <Chiqqum_Ngbata> https://play.nim-lang.org/#ix=2kE3 |
17:38:18 | FromDiscord | <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:03 | FromDiscord | <Varriount> @Chiqqum_Ngbata If I had to guess, it's doing lots of string slicing and assignment |
17:44:23 | FromDiscord | <Chiqqum_Ngbata> Yeah, editdistance makes it faster than the rest by a healthy margin |
17:45:13 | leorize | why does it have to be run via node... |
17:45:15 | leorize | I don't have node |
17:45:31 | leorize | fine I'll just optimize the nim version :P |
17:45:37 | leorize | then I'll leave the benchmarking to you |
17:45:44 | FromDiscord | <Chiqqum_Ngbata> Will do |
17:49:26 | * | silvernode quit (Ping timeout: 265 seconds) |
17:50:05 | * | silvernode joined #nim |
17:54:50 | Araq | Yardanico: 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:18 | leorize | Yardanico, Chiqqum_Ngbata: wanna guess the bottleneck? :) |
17:57:52 | Araq | console output? |
17:58:03 | leorize | toRunes() |
17:58:12 | Araq | lol |
17:58:12 | Yardanico | right there's an iterator |
17:58:15 | leorize | 3.9 seconds was spent converting the string to runes |
17:58:22 | * | Vladar quit (Quit: Leaving) |
17:58:27 | leorize | that's 90% of the runtime |
17:58:36 | Yardanico | so you changed it to utf8 iterator? |
17:59:33 | Yardanico | Araq: 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:59 | leorize | Yardanico: if I wanna win against Go fair and square, I got to keep the algo |
18:01:23 | Araq | on a related note I did improve my best time by 30s today |
18:01:32 | Yardanico | best time of what? :P |
18:01:36 | Yardanico | benchmarks? |
18:01:46 | Yardanico | or running? |
18:01:49 | Araq | my 10km run |
18:02:51 | Araq | but I think it's pretty bad, practisising for 6 weeks only to become 30s faster :D |
18:03:17 | leorize | Araq: what is this Marker_ proc? |
18:03:26 | Araq | leorize: the GC |
18:04:27 | leorize | arc saved the day :p |
18:04:47 | Araq | but in my defense I swallowed a big beetle and had to recover from that during my run |
18:05:07 | Yardanico | Araq: 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:24 | Yardanico | I 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:56 | Yardanico | maybe it's due to wasBuffered adding stuff to messageBuffer and then something happens with that one |
18:08:28 | dom96 | Since my book is 50% off today I'm going to post an AMA on reddit for it |
18:09:00 | Araq | dom96: I can register under a new account and ask questions (just kidding) |
18:09:03 | leorize | Chiqqum_Ngbata: do you happen to know that's Go's string semantics? |
18:09:06 | Yardanico | Araq: lol |
18:09:27 | leorize | what's* |
18:09:30 | Yardanico | i wonder how long will I wait till pBook comes to me to Russia :P |
18:09:30 | Araq | leorize: immutable with O(1) slicing |
18:09:47 | leorize | no wonder why this style of loop favors them |
18:10:19 | Araq | yeah it's optimized for the moron's version, well it's Go... |
18:11:30 | leorize | is lent T a thing? |
18:11:34 | FromDiscord | <clyybber> yeah |
18:11:44 | leorize | I mean as value type |
18:11:59 | leorize | nope it's not |
18:12:20 | Araq | leorize: you can always use 'ptr', it exists |
18:12:37 | FromDiscord | <dom96> https://www.reddit.com/r/nim/comments/gcv88z/dominik_picheta_here_writer_of_nim_in_action_and/ |
18:12:55 | Yardanico | should've made it in r/programming :P |
18:13:04 | Yardanico | or cross-post, idk |
18:13:26 | dom96 | Yardanico, good idea, wanna cross post it yourself? :) |
18:13:33 | Yardanico | sure |
18:13:42 | FromDiscord | <clyybber> dom96: Why not bridge the gamedev channel? |
18:13:50 | Yardanico | dom96: ah "This community does not allow for crossposting of text posts" |
18:13:52 | Yardanico | for r/programming |
18:14:37 | dom96 | Yardanico, 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:38 | dom96 | or something |
18:14:45 | dom96 | clyybber: I don't really care that much tbh |
18:15:13 | dom96 | but having all these messages from IRC breaks the inclusiveness IMO |
18:15:33 | FromDiscord | <clyybber> huh? But its not exactly inclusive to exclude IRC users either :p |
18:15:43 | Yardanico | dom96: ok I'll post :P |
18:16:15 | Yardanico | i 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:08 | leorize | ahh, rust cheat with a slightly different algo |
18:22:13 | leorize | might as well borrow that :) |
18:23:47 | Araq | leorize: you can also implement COW O(1) slicing strings for arc/orc |
18:24:02 | leorize | that's overkill for a microbench |
18:24:04 | Araq | it's rather simple since the new implementation is cleaner |
18:24:10 | leorize | and I'm not sure if O(1) is a good idea |
18:24:15 | leorize | sorry, COW |
18:24:25 | Araq | it's not overkill for Nim |
18:24:35 | Araq | it's the future, should write an RFC though |
18:24:59 | leorize | the 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:06 | FromDiscord | <clyybber> Araq: One could consider it part of the lent RFC |
18:25:12 | FromDiscord | <clyybber> or the view one |
18:25:45 | Araq | leorize: they do atomic RC though, we don't |
18:27:26 | Araq | leorize: also do you have a link to the discussion? |
18:28:04 | leorize | no, 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:40 | leorize[m] | Araq: https://play.nim-lang.org/#ix=2kEp <- is that a bug? |
18:33:34 | Araq | you cannot pass inline iterators around |
18:33:55 | leorize[m] | so basically I'd need to write a macro for this |
18:33:59 | Araq | for enumerate use the for loop macro |
18:34:00 | * | letto_ joined #nim |
18:34:13 | Araq | why 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:19 | FromGitter | <Willyboar> @dom96 better start answering.... :P |
18:49:40 | * | abm joined #nim |
18:50:13 | livcd | Where is this AMA? |
18:50:16 | livcd | ah reddit |
18:50:28 | FromDiscord | <Recruit_main707> AMA? |
18:50:57 | livcd | American Muscle Asses |
18:51:08 | FromDiscord | <Recruit_main707> ah |
18:54:12 | Yardanico | "What would be the best resource to learn more about mom and it's many garbage collection models?" |
18:54:18 | Yardanico | lmao |
18:54:25 | Yardanico | i know its autocorrection but still |
18:55:02 | FromDiscord | <KingDarBoja> lool |
18:55:28 | * | xcm quit (Remote host closed the connection) |
18:55:37 | FromDiscord | <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:59 | leorize[m] | Yardanico, @Chiqqum_Ngbata: https://play.nim-lang.org/#ix=2kEC |
18:56:14 | leorize[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:32 | FromDiscord | <KingDarBoja> I don't think lead devs bother about making videos ๐ข |
18:56:34 | leorize[m] | without both then should be as fast as rust |
18:57:25 | * | Trustable joined #nim |
18:57:26 | livcd | Well Araq streams. Just not the type of stuff beginners are interested in |
18:57:42 | * | xcm joined #nim |
18:58:14 | FromDiscord | <KingDarBoja> I could watch the stream if I weren't working as my time zone is always 7 hours behind Germany |
18:58:28 | Araq | can't stream anymore, Corona |
18:58:34 | Yardanico | lol |
18:58:38 | Araq | my kids are around all day long |
18:58:41 | disruptek | wut |
18:58:45 | Yardanico | ahh |
18:58:59 | disruptek | ~stream |
18:58:59 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
18:59:06 | disruptek | king: you can ask me whatever you want, buddy. |
18:59:47 | Araq | Yardanico: I wrote a sendSafe proc that is .nosinks |
18:59:50 | FromDiscord | <KingDarBoja> Sure bro! |
18:59:59 | Araq | and used it inside 'connect' and then the crash is gone |
19:00:18 | FromDiscord | <KingDarBoja> I have switched to Object variants as you previously stated ๐ |
19:00:19 | Araq | so we fail to pass '&' expressions to 'sink' inside 'connect', so weird |
19:02:07 | leorize[m] | lol the rust ver uses `include_str!` |
19:02:15 | leorize[m] | they cheated a hell lo |
19:02:23 | leorize[m] | lot* |
19:02:30 | Yardanico | wait what |
19:02:32 | Yardanico | "The file is located relative to the current file. (similarly to how modules are found)" |
19:02:38 | Yardanico | compile-time string include lol? |
19:03:25 | leorize[m] | yes :) |
19:05:05 | leorize[m] | go is the king in this benchmark |
19:05:53 | leorize[m] | immutable strings let them win points in the main loop |
19:06:08 | leorize[m] | and their string to rune implementation seems to be really fast |
19:06:32 | FromDiscord | <KingDarBoja> Hey 4raq, just curious, has been any progress regarding this -> https://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871 |
19:06:33 | disbot | โฅ Allow usage of the same attribute name in different branches within variant types |
19:06:42 | leorize[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:51 | leorize[m] | if* |
19:12:24 | FromDiscord | <KingDarBoja> I installed gary nim extension but I really miss some colors on the syntax highlight lol |
19:15:02 | FromDiscord | <Recruit_main707> you can add them with an small change in your settings.json |
19:15:54 | FromDiscord | <Recruit_main707> ill dm it to you |
19:17:36 | FromDiscord | <KingDarBoja> Thanks ๐ |
19:17:46 | FromDiscord | <Recruit_main707> np |
19:18:12 | FromDiscord | <KingDarBoja> So now all basic types are red, clever |
19:18:27 | FromDiscord | <Recruit_main707> you can change the color |
19:18:34 | FromDiscord | <Recruit_main707> i have it to fit my color theme |
19:18:36 | FromDiscord | <KingDarBoja> I know, but I like the red ๐ |
19:21:25 | Araq | KingDarBoja: 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:13 | FromDiscord | <KingDarBoja> Okie Dokie ๐ |
19:42:33 | FromDiscord | <KingDarBoja> Does autocompletion for OV works in VSCode? seems like not :/ |
19:43:15 | Yardanico | it does |
19:43:27 | FromDiscord | <Recruit_main707> its just the original extension with the syntax color problems fixed |
19:44:00 | FromDiscord | <KingDarBoja> Yardanico: did you saw the link on offtopic channel? |
19:44:05 | Yardanico | yes |
19:44:11 | Yardanico | but it works for me |
19:44:20 | FromDiscord | <KingDarBoja> ๐ค |
19:44:38 | FromDiscord | <KingDarBoja> I am screwed |
19:46:02 | FromDiscord | <KingDarBoja> I see it will start showing possible fields after typing `.someCharacter` |
19:46:12 | FromDiscord | <KingDarBoja> But hard to guess which kind I do have ๐ค |
19:46:28 | FromDiscord | <KingDarBoja> Unless I am misunderstanding how OV works |
19:46:39 | Yardanico | object variants work at runtime |
19:46:54 | Yardanico | compiler can't know which kinds will be for which fields without a lot of analysis |
19:47:24 | FromDiscord | <KingDarBoja> Ahhh that why... |
19:47:49 | FromDiscord | <KingDarBoja> So I have to guess which kind it is and use the proper fields |
19:53:48 | FromDiscord | <KingDarBoja> Thank you Yard ๐ |
20:01:15 | FromDiscord | <KingDarBoja> This is a whack-a-mole now x.x |
20:04:08 | * | letto_ quit (Ping timeout: 272 seconds) |
20:07:47 | dom96 | yay lots of questions |
20:09:12 | dom96 | damn, these are good questions |
20:10:44 | FromDiscord | <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:41 | FromDiscord | <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:20 | disruptek | see the os module. |
20:42:02 | FromDiscord | <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:04 | disruptek | getAppDir, getAppFilename? |
20:43:09 | disruptek | which manual are you reading? |
20:44:56 | FromDiscord | <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:14 | disruptek | it'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:33 | FromDiscord | <KingDarBoja> Okay I pushed the OV thing into another branch so I don't mess up master on my repo |
21:04:45 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/commit/ac6f2a47e1b318642bdf7eb4b7d0ff4ca5ccbc8e still not happy about having to guess the field names :/ |
21:05:22 | covidian | kewl |
21:05:32 | covidian | nim roxx! |
21:05:37 | * | lritter quit (Quit: Leaving) |
21:05:48 | FromDiscord | <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:52 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/commit/2242dfbefb35b26b8cf0ae272e6a0d6624666b6e |
21:06:07 | FromDiscord | <KingDarBoja> what do you think disruptek? |
21:08:39 | Araq | looks ok |
21:08:43 | Araq | covidian: thanks |
21:11:40 | Prestige | dom96: Just purchased your book, thanks for the discount code :) |
21:12:35 | covidian | kewl... which book is it ? (newbie here) |
21:12:57 | covidian | though I dabbled in nim already |
21:13:11 | dom96 | Prestige, yay, thanks for picking it up! |
21:13:22 | dom96 | covidian, https://book.picheta.me |
21:13:25 | covidian | OK |
21:14:09 | covidian | nice website dude |
21:14:24 | dom96 | thanks :) |
21:15:31 | covidian | I always thought nim is kinda nice. now we need to bring the GuixSD people onboard ;-) |
21:16:03 | covidian | they have a bรถner for guile / LISP |
21:16:32 | * | PMunch joined #nim |
21:16:53 | covidian | for whatever reason... |
21:18:59 | * | PMunch quit (Client Quit) |
21:21:12 | FromDiscord | <Yardanico> Well you know it's kinda expected considering Guix is in Guile |
21:24:17 | covidian | but can't they see? ;-) |
21:25:11 | covidian | maybe we have to put up with guile/LISP for packaging. it is truely amazing what they do. |
21:25:24 | FromDiscord | <Yardanico> NixOS uses Nix |
21:25:33 | dom96 | TIL an AMA is hard work |
21:25:45 | FromDiscord | <Yardanico> It's a functional DSL, not lisp family |
21:25:48 | covidian | yes they are kinda linked guix + nixos |
21:25:57 | FromDiscord | <Yardanico> GuixSD was initially based on NixOS |
21:26:03 | covidian | OK |
21:27:15 | covidian | I would really like an AMA against those pro-covid doctors |
21:27:50 | FromDiscord | <Never Listen To Beef> A pro covid doctor is called a mortician |
21:28:08 | covidian | lawl or a former unemployed or sth. |
21:28:24 | FromDiscord | <Never Listen To Beef> A pro covid doctor is like a pro bullet soldier |
21:28:34 | * | abm quit (Quit: Leaving) |
21:28:57 | covidian | dude u drank the Kool Aid... |
21:29:04 | FromDiscord | <Never Listen To Beef> What? |
21:29:30 | covidian | were you joking? I think there is a mega hysteria ongoing. |
21:29:36 | FromDiscord | <bedwardly-down> Ummmm... I might be hopping on at the wrong time. ๐ฎ |
21:30:15 | FromDiscord | <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:38 | covidian | in fact, those covid numbers are less reliable than the estimates on POTUS IQ. |
21:31:48 | FromDiscord | <Never Listen To Beef> I dont even get what you're saying |
21:31:51 | covidian | well take Prof Drosten, the covid pope from Germany. in an AMA I would ask him how many million โฌโฌ his portfolio grew recently. |
21:32:34 | covidian | in stock options of Big Pharma |
21:32:54 | covidian | POTUS = president o0f the united states |
21:33:10 | FromDiscord | <Never Listen To Beef> Are you explaining that for yourself? |
21:33:38 | covidian | so what do u not get? |
21:33:54 | FromDiscord | <Never Listen To Beef> The entirety of what you've said |
21:34:06 | FromDiscord | <Never Listen To Beef> "Pro covid doctor" is one im really stuck on |
21:34:58 | covidian | Mr. Drosten PhD is a doctor and makes his money with covid. he is a pro-covid doctor in a manner of speaking. |
21:35:28 | solitudesf | cool. there is offtopic channel for that. |
21:35:51 | FromDiscord | <Never Listen To Beef> Yea i was going to say, but felt that'd be silly to say after enticing them |
21:35:59 | FromDiscord | <Never Listen To Beef> Anywho, uhh nim eh? |
21:37:04 | covidian | you mean my nickname "covidian" sounds like I myself drank the KOOL AID ? lol |
21:38:05 | covidian | nim roxx, let me tell u |
21:38:45 | * | drewr quit (Ping timeout: 240 seconds) |
21:39:06 | covidian | will the covid19 hoax ever end? |
21:39:52 | * | audiophile joined #nim |
21:40:14 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:40:39 | FromDiscord | <Never Listen To Beef> Offtopic, but "hoax" the virus doesnt exist? |
21:41:08 | FromDiscord | <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:23 | FromGitter | <jorjun_twitter> Bit of JS backend help pls pls |
21:46:23 | FromGitter | <jorjun_twitter> https://pastebin.com/98HsMbM6 |
21:52:28 | FromGitter | <jorjun_twitter> couldnโt see how to refer to the proc for requestAnimationFrame.. almost got my first three.js demo working. |
21:54:04 | dom96 | jorjun_twitter: pretty sure dom defines a `window` |
21:54:28 | dom96 | also 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:06 | FromGitter | <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:18 | FromGitter | <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:24 | dom96 | hm, 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:27 | dom96 | good night |
22:02:42 | covidian | gn |
22:03:06 | FromGitter | <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:08 | Araq | Yardanico: 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:11 | Araq | Yardanico: https://github.com/nim-lang/Nim/issues/14207 your bug |
22:19:30 | FromDiscord | <Technisha Circuit> Is there an easy way to call NodeJS and Python in Nim? |
22:19:39 | FromDiscord | <Technisha Circuit> For Python i can use Nimpy |
22:19:45 | FromDiscord | <Technisha Circuit> But how about NodeJS? |
22:20:19 | Araq | you can compile to JS and import libraries from NodeJS |
22:20:43 | FromDiscord | <Technisha Circuit> But then i wouldn't be able to call Python, would i? |
22:20:52 | FromDiscord | <codic> not in the same file, no |
22:21:04 | FromDiscord | <Technisha Circuit> :/ |
22:22:09 | FromDiscord | <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:25 | FromDiscord | <Technisha Circuit> I could use websockets but i don't want to mess with websockets rn |
22:22:54 | FromDiscord | <Rika> isnt websockets for uh |
22:22:56 | FromDiscord | <Rika> the web |
22:22:58 | leorize | technically you can make it work, it just that you wouldn't want to |
22:23:28 | FromDiscord | <Technisha Circuit> > isnt websockets for uh |
22:23:28 | FromDiscord | <Technisha Circuit> You can get websockets to work with other stuff |
22:23:33 | FromDiscord | <codic> websockets can be used for sharing data between programs |
22:23:35 | FromDiscord | <Rika> also i realized you changed your name from technicae to technisha |
22:23:39 | FromDiscord | <Rika> i mean yeah |
22:23:39 | FromDiscord | <Technisha Circuit> Hahaha |
22:23:44 | FromDiscord | <Rika> but is that a good idea |
22:23:46 | FromDiscord | <codic> although, for the case of *Linux* specifically, dbus is a much better way |
22:23:58 | FromDiscord | <Technisha Circuit> What's dbus? ๐
|
22:24:00 | FromDiscord | <codic> and windows and mac probs have similar things |
22:24:01 | FromDiscord | <codic> Data-Bus |
22:24:09 | FromDiscord | <Rika> raw sockets ๐ |
22:24:10 | FromDiscord | <codic> it allows programs to interface with each other by sharing data |
22:24:11 | FromDiscord | <Technisha Circuit> > but is that a good idea |
22:24:12 | FromDiscord | <Technisha Circuit> No, but I'm stupid so :P |
22:24:28 | FromDiscord | <Technisha Circuit> Oh? So how would i do it for NodeJS, Nim and Python? |
22:24:36 | FromDiscord | <codic> Yup, windows has an IPC mechanism called COM |
22:24:41 | leorize | dbus is a "simple" specification for an ipc system :p |
22:24:52 | FromDiscord | <codic> and macos has distributed notification |
22:24:55 | FromDiscord | <codic> yeah haha |
22:25:04 | FromDiscord | <Rika> is dbus easy to use |
22:25:12 | FromDiscord | <codic> don't know, never used it |
22:25:12 | FromDiscord | <KingDarBoja> sigh |
22:25:18 | FromDiscord | <Rika> i might just use that for a plugin system lol |
22:25:18 | FromDiscord | <codic> @KingDarBoja what? |
22:25:24 | FromDiscord | <Technisha Circuit> Hm |
22:25:25 | FromDiscord | <codic> It's linux only though |
22:25:25 | leorize | dbus is so easy to use it's author put a warning that you should never use it in the C api :) |
22:25:38 | FromDiscord | <Rika> oh lord |
22:25:38 | leorize | dbus is cross platform actually |
22:25:42 | FromDiscord | <codic> anyways https://github.com/zielmicha/nim-dbus |
22:25:45 | FromDiscord | <codic> Yeah but it requires ports |
22:25:49 | FromDiscord | <Technisha Circuit> Oh? Why should you not use it in the C API? |
22:25:55 | FromDiscord | <codic> it's not natively available on every windows and mac system |
22:25:56 | covidian | bash likes dbus LOL |
22:26:08 | FromDiscord | <codic> XD |
22:26:35 | FromDiscord | <Technisha Circuit> I wonder why i am so stupid ๐คฆ |
22:26:50 | FromDiscord | <codic> hmmm.... |
22:26:55 | FromDiscord | <Technisha Circuit> So what would be the best way for me to share data between the three langs? |
22:26:55 | FromDiscord | <codic> Hold on |
22:27:07 | leorize | Technisha Circuit: it's not about three langs |
22:27:10 | FromDiscord | <codic> |
22:27:10 | FromDiscord | <codic> https://cdn.discordapp.com/attachments/371759389889003532/706632972748587159/unknown.png |
22:27:14 | leorize | it's about how you have three runtimes :) |
22:27:25 | FromDiscord | <Technisha Circuit> Wdym? |
22:28:13 | leorize | nim <-> python is easy, because python has a C interface that we can hook into |
22:28:17 | FromDiscord | <Rika> what RPC protocol do yall recommend then, if not dbus? |
22:28:19 | leorize | find one for js and you're set |
22:28:30 | leorize | Rika: depends on what you're doing |
22:28:52 | covidian | eschew JS! |
22:28:53 | FromDiscord | <Rika> i dont know what it depends on |
22:29:05 | covidian | espouse nim! |
22:29:36 | leorize | well, why do you need an ipc system? |
22:29:46 | FromDiscord | <codic> websockets |
22:29:50 | FromDiscord | <codic> ๐ ๐ ๐ |
22:29:52 | FromDiscord | <codic> best ipc system |
22:29:55 | leorize | and what can access this system? |
22:30:13 | * | Trustable quit (Remote host closed the connection) |
22:30:15 | FromDiscord | <codic> if you're asking me, any language supporting websockes |
22:30:25 | leorize | I'm asking Rika :P |
22:30:28 | FromDiscord | <codic> ah |
22:30:32 | FromDiscord | <Rika> well i can always use the `plugin` package, but i dont have confidence in it |
22:30:48 | leorize | use the plugin package |
22:31:08 | FromDiscord | <Rika> i want to be able to withstand someone suddenly removing the plugin's dll |
22:31:15 | FromDiscord | <Rika> and not crash in that case |
22:31:24 | leorize | doesn't the plugin package support that? |
22:31:33 | leorize | I mean, that's the whole point of a plugin system? |
22:31:47 | FromDiscord | <Rika> im not sure |
22:32:21 | leorize | if 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:23 | Araq | don't write plugin systems before you have something to plug into |
22:33:25 | FromDiscord | <Technisha Circuit> NodeJS has a C api |
22:33:40 | FromDiscord | <Technisha Circuit> But I can't find a lib to let me interact with it |
22:33:58 | FromDiscord | <Rika> araq, what do you mean? |
22:35:00 | Araq | don't write plugin systems if you can avoid it. by construction they make code impossible to follow |
22:35:19 | FromDiscord | <Rika> okay |
22:36:33 | Araq | but 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:09 | Araq | and keep in mind that most of us don't enjoy hunting for adblockers as plugins |
22:37:17 | FromDiscord | <KingDarBoja> Can I use a OV kind as type? |
22:37:30 | Araq | we're happier when the browser simply ships with a good one by default... |
22:38:43 | Araq | same 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:56 | FromDiscord | <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:19 | FromDiscord | <Rika> aka i want to make sure i dont lose all service because i was swapping out one of the services |
22:39:48 | Araq | so use a load balancer |
22:42:01 | FromDiscord | <Rika> ill think about that |
22:47:42 | Araq | โAs always: depends on the use case. |
22:47:42 | Araq | We'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:42 | Araq | For 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:59 | Araq | er ... 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:23 | FromGitter | <jorjun_twitter> So all this stuff in the jsffi module should be generic typed, then. Think it is holding me back. |
23:00:24 | FromGitter | <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:30 | FromGitter | <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:41 | FromDiscord | <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:14 | Araq | because json.`$` returns the JSON stuff in its ascii representation |
23:31:30 | Araq | and 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:00 | FromDiscord | <codic> ah, so how can I not have the quotes? |
23:33:14 | FromDiscord | <codic> modify echo? |
23:33:37 | Prestige | Is 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:21 | FromDiscord | <codic> or should I make a different function `jsonecho` haha |
23:36:43 | FromDiscord | <dayl1ght> I'm debugging nim code using lldb. Is it possible to run nim expressions in lldb? |
23:39:44 | Araq | Prestige: use the Option[T] type |
23:39:55 | Prestige | Thanks! |
23:40:03 | Araq | codic: you should understand the json api |
23:40:24 | leorize | dayl1ght: we don't have lldb support yet |
23:40:29 | Araq | dal1ght: no, you need to use C syntax, unfortunately |
23:40:53 | FromDiscord | <dayl1ght> ah ๐ is there any trick to print nim arrays? |
23:41:22 | Araq | nim arrays are just C arrays |
23:41:30 | FromDiscord | <dayl1ght> oops I mean seq |
23:42:11 | FromDiscord | <codic> araq: ah, where can i find the docs? Just the nim ones? |
23:42:25 | FromDiscord | <codic> so https://nim-lang.org/docs/json.html |
23:42:50 | Araq | yeah |
23:42:57 | FromDiscord | <Rika> look for how strings are stored in JsonNodes |
23:43:09 | Araq | you're looking for .getStr |
23:43:30 | FromDiscord | <codic> Oh great there's also getInt getBiggestInt GetFloat getBool etc |
23:43:33 | FromDiscord | <codic> *getFloat |
23:44:04 | FromDiscord | <Rika> look at the type def not the procs |
23:44:12 | FromDiscord | <Rika> (though the procs are recommended) |
23:45:03 | FromDiscord | <Rika> @codic why not just use getStr |
23:45:15 | FromDiscord | <Rika> also why is it called getStr and not getString? |
23:45:23 | FromDiscord | <codic> I am gonna use getStr |
23:45:31 | FromDiscord | <codic> I was looking at the others in case I wanted the other types |
23:45:39 | FromDiscord | <Rika> i see |
23:45:53 | FromDiscord | <codic> Aw `echo %*["O"][0].getStr` fails |
23:45:57 | FromDiscord | <codic> type mismatch |
23:46:32 | leorize | !eval import json; echo `%`(["0"][0].getStr) |
23:46:35 | NimBot | Compile failed: /usercode/in.nim(1, 31) Error: type mismatch: got <string> |
23:46:43 | leorize | !eval import json; echo `%`(["0"][0]).getStr |
23:46:46 | NimBot | 0 |
23:46:50 | leorize | it's due to operator precedence |
23:47:06 | FromDiscord | <codic> ahhhh |
23:47:08 | FromDiscord | <codic> okay, thanks! |
23:55:31 | * | krux02_ joined #nim |
23:55:59 | shashlick | Oh - some interest in the plugin system |
23:57:59 | * | ftsf joined #nim |
23:59:17 | * | krux02 quit (Ping timeout: 260 seconds) |