<< 07-04-2021 >>

00:27:48FromDiscord<Technisha> Le done UvU
00:27:50FromDiscord<Technisha> https://forum.nim-lang.org/t/7757
00:29:45FromDiscord<Technisha> Oof-
00:36:33FromDiscord<Technisha> I'll just post it here too until that gets approved :p
00:36:48leorizeYardanico: ^
00:37:05FromDiscord<Technisha> :p
00:37:07FromDiscord<Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vgt
00:37:08leorizewe can just get a mod to approve it for you :p
00:37:13FromDiscord<Yardanico> i did approve
00:37:32FromDiscord<Technisha> Oh
00:37:38FromDiscord<Yardanico> @Technisha deleting is quite useless - we have IRC logs
00:37:41FromDiscord<Technisha> It didn't show until i refreshed lmao
00:37:45ForumUpdaterBotNew thread by Technisha: Error while trying to use JNim, see https://forum.nim-lang.org/t/7757
00:37:54FromDiscord<Technisha> Oh yeah, i forgot about IRC-
00:38:06FromDiscord<Technisha> I just deleted it because i thought there was no point keeping it lmao
00:59:39*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:59:58*njoseph joined #nim
01:09:19*vicfred joined #nim
01:11:07FromDiscord<Technisha> I found both of these: https://github.com/DemonWav/wat↵https://github.com/jarcode-foss/NativeBukkit
01:11:21FromDiscord<Technisha> Maybe i can port them to Nim into a better version of it :p
01:23:58*krux02 quit (Remote host closed the connection)
01:33:47*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
01:34:23*Gustavo6046 joined #nim
01:42:56FromDiscord<Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2Vgz
01:46:29leorizeit doesn't mean anything by now
01:46:43leorizebut it used to be an operator for `owned` to provide compatibility for older versions of Nim
01:47:05FromDiscord<Mustache Man> ah thank you
03:06:54*rockcavera quit (Remote host closed the connection)
03:13:46FromDiscord<Mustache Man> In reply to @ElegantBeef "Or make a linked": doubly linked list worked great! improved performance by 15x
03:13:53FromDiscord<ElegantBeef> Nice
03:14:24FromDiscord<Mustache Man> there's a bit of a rough spot using it, which is determining whether there's a head or not
03:14:44FromDiscord<Mustache Man> so i used an iterator and break.
03:14:53FromDiscord<Mustache Man> (edit) "an iterator" => "a for loop"
03:26:43*cgfuh quit (Quit: WeeChat 3.0)
03:31:58*spiderstew_ joined #nim
03:33:21*spiderstew quit (Ping timeout: 250 seconds)
03:40:00*DannyHpy[m] joined #nim
03:56:23FromDiscord<ajusa> does anyone know how to pass JSON using the JS backend into a function? Tried something like `proc Chart(n: Element, opts: JsonNode) {.importc.}` but when I log `opts` I get the whole JSONNode thing as an object (like it has the kind field)
03:57:59*vegai left #nim (#nim)
04:03:53FromDiscord<Yardanico> In reply to @ajusa "does anyone know how": JsonNode is already a parsed Nim object, the "easiest" solution I see is doing $ on the JsonNode and then JSON.parse
04:04:19FromDiscord<Yardanico> of course it's not the most efficient one, I guess otherwise you might want to write some simple code to walk over the JsonNode and create a native JS object out of it
04:04:44FromDiscord<ajusa> yeah, I'm also looking at https://forum.nim-lang.org/t/6282, didn't know jsffi was a thing
04:06:02FromDiscord<ajusa> I just want to be able to create a javascript object directly the same way I do in JS though, without type defintiions
04:06:07FromDiscord<ajusa> (edit) "defintiions" => "definitions"
04:11:08leorizethen `import jsffi; js{field: "data"}`
04:11:48FromDiscord<Yardanico> yep
04:11:50FromDiscord<Yardanico> docs https://nim-lang.org/docs/jsffi.html#%7B%7D.m%2Ctypedesc%2Cvarargs%5Buntyped%5D
04:11:59leorizethere is `JsObject` for any JS objects
04:12:54FromDiscord<ajusa> ah, that's what I was missing. There is a `js` type that I can use with that macro
04:12:59FromDiscord<ajusa> thank you so much!
04:13:53FromDiscord<Yardanico> In reply to @leorize "there is `JsObject` for": i guess we should document this usage for {} :P
04:16:21FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2VgU
04:16:43FromDiscord<ajusa> do I need to do data: js{} as well?
04:17:15FromDiscord<ajusa> I really do need to do that huh, a bit of a pain for nested objects
04:23:02*waleee-cl quit (Quit: Connection closed for inactivity)
04:24:16FromDiscord<ajusa> sent a code paste, see https://paste.rs/dSM
04:24:42FromDiscord<ajusa> (edit) "https://play.nim-lang.org/#ix=2VgX" => "https://play.nim-lang.org/#ix=2VgW"
04:27:39FromDiscord<Yardanico> you can make a macro that'll do both of these for you :)
04:29:29FromDiscord<ajusa> can I? wouldn't I need to rewrite the `{}` macro then?
04:29:44FromDiscord<Yardanico> same as json's % does it
04:30:58FromDiscord<Rika> {} isn’t a macro
04:31:10FromDiscord<Rika> At least in this case
04:31:28FromDiscord<Yardanico> it is a macro
04:31:35FromDiscord<ajusa> `macro `{}`(typ: typedesc; xs: varargs[untyped]): auto` looks an awful lot like a macro to me
04:31:46FromDiscord<Yardanico> @Rika https://nim-lang.org/docs/jsffi.html#%7B%7D.m%2Ctypedesc%2Cvarargs%5Buntyped%5D
04:32:42FromDiscord<Rika> What is js then?
04:32:46FromDiscord<Yardanico> an object type
04:32:53FromDiscord<Yardanico> https://nim-lang.org/docs/jsffi.html#js
04:36:38FromDiscord<JSONBash> If i wanted to copy every object passed to a function and return that copy how would i do that? (copy here means not a reference, in the functional sense)
04:45:13FromDiscord<ElegantBeef> @JSONBash got a code example of what you're after?
04:47:21FromDiscord<JSONBash> https://play.nim-lang.org/#ix=2VgZ
04:47:27FromDiscord<JSONBash> but not sure deepCopy is what I want
04:48:03FromDiscord<Yardanico> @JSONBash beef asked the reason for why do you want to copy something
04:48:08FromDiscord<Yardanico> you know, the x y problem ;)
04:48:46FromDiscord<ElegantBeef> It's hard to make a suggestion in things like this without code to guide it
04:48:48FromDiscord<Yardanico> but yes, deepCopy is what you want if you _really_ have to copy all arguments but there's rarely a need for it
04:48:56FromDiscord<Yardanico> that's why we're asking for more context
04:49:10FromDiscord<JSONBash> ah i see my bad for clarity
04:49:59FromDiscord<JSONBash> I want to write some functional programming functions and I want to make a clone of the data coming in so there is no mutabiility
04:50:26FromDiscord<JSONBash> and even if i get a ref obj i want to create a new one and send it back
04:50:30FromDiscord<Yardanico> but there would be no mutability already if you use `func` with strictFuncs and don't use any `var` arguments
04:50:49FromDiscord<Yardanico> but yes, if you really really really want to, deepCopy will work
04:51:00FromDiscord<Yardanico> but I doubt that it'll be good for performance :P
04:51:28FromDiscord<JSONBash> yeah I know it is not ideal and will be a performance hit
04:51:35FromDiscord<JSONBash> maybe its not what i want to do?
04:51:55FromDiscord<JSONBash> i am just trying to make sure that a data object i get passed is never mutated
04:52:00FromDiscord<JSONBash> ,maybe there is a better way?
04:52:29FromDiscord<ElegantBeef> Use `{.experimental: "strictFuncs".}`
04:52:38FromDiscord<Yardanico> In reply to @JSONBash "i am just trying": as I said above, you can use strictFuncs + `func` + no `var` arguments
04:52:46FromDiscord<Yardanico> https://nim-lang.org/docs/manual_experimental.html#strict-funcs
04:52:55FromDiscord<ElegantBeef> With strict funcs you can only mutate `var`s
04:53:12FromDiscord<Yardanico> vars that are specified in the argument list
04:53:39FromDiscord<ElegantBeef> And that means you cannot mutate even reference objects
04:53:58FromDiscord<ElegantBeef> They're "how funcs" should've behaved 😄
04:54:00FromDiscord<Yardanico> yes, with strictFuncs you get deep immutability for ref objects
04:54:04FromDiscord<Yardanico> inside of ref objects etc
04:54:12FromDiscord<ElegantBeef> (edit) "funcs"" => "funcs" | "behaved" => "behaved""
04:54:14FromDiscord<Yardanico> normal objects are already immutable unless you specify "var" in the argument list explicitly
04:54:28FromDiscord<JSONBash> that seems to be better! If i were to do the following would this work?↵func [T](data: T): T=↵ let a = b↵ return b
04:54:38FromDiscord<JSONBash> sorry for not formatting the code
04:54:47FromDiscord<JSONBash> `func [T](data: T): T=↵ let a = b↵ return b`
04:54:54FromDiscord<Yardanico> not sure what this function should do, and there's also no name?
04:55:01FromDiscord<ElegantBeef> Also there is no `a` and `b`
04:55:11FromDiscord<JSONBash> lol im sorry
04:55:56FromDiscord<Yardanico> In reply to @JSONBash "that seems to be": it will work, but it might not create copy when it deems that it's not neccesary (which is okay for you since you will use strictFuncs in your code anyway)
04:56:18FromDiscord<JSONBash> sent a code paste, see https://play.nim-lang.org/#ix=2Vh0
04:56:28FromDiscord<Yardanico> but this does mutation
04:56:41FromDiscord<ElegantBeef> also `map[T]` 😄
04:57:01FromDiscord<JSONBash> thats embarassing haha
04:57:14FromDiscord<Yardanico> for map we already have https://nim-lang.org/docs/sequtils.html#mapIt.t%2Ctyped%2Cuntyped
04:57:40FromDiscord<ElegantBeef> also the more ergonomic `mapit` (atleast in my view)
04:57:51FromDiscord<Yardanico> https://github.com/zero-functional/zero-functional can also be of your interest
04:58:32FromDiscord<JSONBash> yeah I am a little hard pressed to come up with a good usage example
04:58:58FromDiscord<ElegantBeef> Oh you linked mapit cmon yard making me look dumb(not that it's diffcult)
04:59:12FromDiscord<Yardanico> In reply to @ElegantBeef "Oh you linked mapit": I linked it before you sent your message :)
04:59:47FromDiscord<Yardanico> whole 20 seconds later
04:59:49FromDiscord<ElegantBeef> well the message said "for map" then you linked mapit
04:59:54FromDiscord<ElegantBeef> Then i read the url
05:00:05FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/829218946866741288/unknown.png
05:00:07FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/829218956917080065/unknown.png
05:00:09FromDiscord<Yardanico> 🥴
05:00:50FromDiscord<ElegantBeef> I'm joking around and you pull out proof of my slowness, rude
05:01:26FromDiscord<JSONBash> i think I can be smarter about this with strictFuncs and func with no vars. I appreciate all the help @ElegantBeef and @Yardanico
05:05:18*letto quit (Ping timeout: 240 seconds)
05:06:24*letto joined #nim
05:43:37*narimiran joined #nim
05:50:40ForumUpdaterBotNew Nimble package! holst - A parser for Jupyter notebooks., see https://github.com/ruivieira/nim-holst
06:29:58saem@Technisha decompiler in the Java ecosystem are incredibly good. Unless the jar is heavily obfuscated you shouldn't have any issues reproducing very readable code.
06:50:41FromDiscord<mattrb> Is this telling me that most of my time is spent in system.nim? https://gist.github.com/mattrberry/13f3e536bdac9d6102fc681f7f314c18
06:51:01FromDiscord<Rika> No it means you’re calling stuff a lot
06:51:12FromDiscord<Rika> It doesn’t tell you what takes long it tells you what is called often
06:52:14FromDiscord<Rika> Use u prof (and) or v tune (intel)
06:53:09FromDiscord<ElegantBeef> or callgrind 😛
06:53:20FromDiscord<Rika> Ah gba code
06:53:24FromDiscord<ElegantBeef> But yea use a proper profiler and compile with `--debugger:native`
06:53:25FromDiscord<Rika> Don’t know how to profile that
06:53:28FromDiscord<ElegantBeef> It's for an emulator
06:53:38FromDiscord<ElegantBeef> Atleast iirc
06:53:40FromDiscord<Rika> Oh so not for running on the gba okay
06:53:45FromDiscord<mattrb> Thanks for the flag
06:53:54FromDiscord<mattrb> Yeah this is for an emulator not a gba game
06:53:58FromDiscord<Rika> Useful for gdb too if you use that
06:54:27FromDiscord<ElegantBeef> It'll be slightly unreadable symbols but you should be able to reason about what they are
06:55:18FromDiscord<Rika> If you use u prof it’s not unreadable (from my experience)
06:55:27FromDiscord<ElegantBeef> Wel it's `name_gensym`
06:55:28FromDiscord<Rika> It tells you directly what lines are hotspots so
06:55:43FromDiscord<ElegantBeef> But the linedir is there so you can go to them
06:55:44FromDiscord<Rika> Well no it doesn’t work on the code symbols directly
06:55:55FromDiscord<Rika> It’s based on line dir yes
06:56:01*PMunch joined #nim
06:57:01*fredsted quit (Ping timeout: 245 seconds)
07:01:42*fredsted joined #nim
07:12:22*haxscramper joined #nim
07:23:29FromDiscord<ElegantBeef> @sealmove so turns out it's in the stdlib we just missed it https://nim-lang.org/docs/strutils.html#allCharsInSet%2Cstring%2Cset%5Bchar%5D
07:24:04FromDiscord<ElegantBeef> I was just about to implement it and the the very bottom procedure in strutils calls that one
07:24:42FromDiscord<sealmove> hmm weird that we missed it
07:25:42FromDiscord<ElegantBeef> Could just be the name is a weird, i'd argue `onlyContains` makes more sense 😄
07:29:36FromDiscord<sealmove> agree the name is weird, but `onlyContains` hardly makes more sense :p
07:30:07FromDiscord<sealmove> `noCharOtherThan`? xD
07:30:44FromDiscord<sealmove> (edit) "`noCharOtherThan`? xD" => "~~`noCharOtherThan`? xD~~"
07:32:07FromDiscord<ElegantBeef> Idk `yourString.onlyContains({'0'..'9', 'a' .. 'f'})` seems fine to me
07:33:09FromDiscord<sealmove> hmm ok it's a better name than `allCharsInSet`
07:35:06FromDiscord<sealmove> I would swear `string.h` has a function that does this, but can't find it now.
07:35:29FromDiscord<ElegantBeef> Aside from that i can only think of `isOnly`
07:35:35FromDiscord<sealmove> `strspn()`?
07:36:32liblq-devstring spoon
07:37:50FromDiscord<sealmove> Well `strspn()` does almost the same thing.It's a bit more generic. You can compare the returned value with the string's length and if they are same then it means that `s1` consists only of characters from `s2`.
07:38:53FromDiscord<sealmove> I think spn stands for span 😅 but C name conventions are crazy, it could be spoon.
07:44:19FromDiscord<ElegantBeef> Clearly we're doing it backwards and it should be `set.makesUp(string)` 😛
07:57:48PMunchA string spoon sounds like a horribly inefficient spoon..
07:58:22PMunchstring.madeUpOf(set)
08:01:35FromDiscord<hamidb80> hey
08:01:54PrestigeHello
08:02:29FromDiscord<ElegantBeef> Hello
08:03:26FromDiscord<hamidb80> how can I convert nim file into cpp without create executable binary↵for example: `fib.nim` -> `fib.cpp`
08:03:35FromDiscord<hamidb80> (edit) "create" => "createing"
08:03:44FromDiscord<ElegantBeef> `nim c -c --nimcache:directory`
08:06:33*Vladar joined #nim
08:06:37FromDiscord<ElegantBeef> I guess that assumes you've made C++ your default backend so it's actually `nim cpp` 😄
08:09:30Clonkk[m]What are the "template/generic instantiation from here" warning I have everywhere ? Is there a way to disable it on nimsuggest so it doesn't show ?
08:17:30FromDiscord<ElegantBeef> Does the program compile fine and it's just phantom errors in your editor?
08:17:36Clonkk[m]Compiles fine
08:17:37Clonkk[m]Works fine
08:17:53Clonkk[m]Yeah it's just the LSP client giving the errors
08:18:22FromDiscord<ElegantBeef> Yea i think it's an occasional issue that pops up and i have 0 idea how to resolve it
08:21:23FromDiscord<hamidb80> In reply to @Clonkk "Yeah it's just the": what version do you use?
08:21:32FromDiscord<hamidb80> (edit) "In reply to @Clonkk "Yeah it's just the": what version ... do" added "of nim"
08:21:38PMunchIt's really annoying..
08:21:40*motersen joined #nim
08:21:43Clonkk[m]Version of what ?
08:22:11PMunchI've had those issues myself, and I'm not sure what triggers them or what can be done to stop them
08:22:19PMunchGranted I haven't looked into it much
08:22:50Clonkk[m]Well I also have another bug that makes Neovim takes 100% CPU and block
08:23:20Clonkk[m]Don't know why everything is broken this morning 😂
08:29:12Prestigeusing nimlsp Clonkk[m] ?
08:29:33Clonkk[m]Yes
08:30:54PrestigeI'm pretty sure I know why
08:31:18PrestigePMunch: remember the change I added to https://github.com/PMunch/nimlsp/blob/master/src/nimlsp.nim#L493 that we talked about? It's running chk on all open files when a file changes
08:31:26Prestigewe should probably not do that lol
08:32:07PMunchOoh, on a didChange, no that's probably a bad idea :P
08:32:23PMunchThere's a reason why it normally only runs it on didSave
08:32:30PrestigeYeah that will swallow Clonkk[m]'s computer whole
08:33:00PMunchBut not mine apparently
08:33:16PMunchHaven't noticed it slowing down much, if at all, after that change
08:33:18Prestigeyeah mine handles it alright but not good for all computers
08:33:28Clonkk[m]<Prestige "Yeah that will swallow Clonkk[m]"> Right now i have to pkill neovim :D
08:33:35PrestigeI'm sorry
08:33:39Prestige:P
08:33:40Clonkk[m]No worries haha
08:39:18Clonkk[m]The last line of the log is Wed 07 Apr 2021 10:38:45 AM CEST:["s:on_text_document_did_open()", 1, "", "/home/rcaillaud/Workspace/localws/ForkedProjects/flambeau", "file:///tmp/vim-lsp.log"]
08:39:23Clonkk[m]In case helps
08:40:22Prestigehttps://github.com/PMunch/nimlsp/blob/master/src/nimlsp.nim#L472 not sure why didOpen would cause a freeze
08:40:56Prestigedoesn't do much afaict
08:43:22Clonkk[m]No idea
08:43:30Clonkk[m]But I can reproducde the crash on demand
08:44:47PMunch@Clonkk[m], maybe try to turn on debug logging and see if that gives you another error message?
08:45:15Clonkk[m]How do you enable debug logging ?
08:45:36PMunch-d:debugLogging
08:46:43Clonkk[m]Give me a minute to clone & recompile
08:48:50*lritter joined #nim
08:50:59*phatnael[m] quit (Ping timeout: 248 seconds)
08:50:59*k0mpjut0r quit (Ping timeout: 248 seconds)
08:51:19Clonkk[m]What is the log file when debug is active ?
08:51:31*MTRNord quit (Ping timeout: 248 seconds)
08:51:32*Northstrider[m] quit (Ping timeout: 248 seconds)
08:51:56*Northstrider[m] joined #nim
08:52:04*watzon quit (Ping timeout: 248 seconds)
09:00:03*i_use_arch_btw[m quit (Quit: Idle for 30+ days)
09:06:23*phatnael[m] joined #nim
09:07:14*k0mpjut0r joined #nim
09:11:57*leorize quit (Ping timeout: 240 seconds)
09:14:32*leorize joined #nim
09:20:07*MTRNord joined #nim
09:26:17*vicfred quit (Quit: Leaving)
09:31:02*watzon joined #nim
09:31:54PMunch@Clonkk[m], getTempDir() / "nimlsp" / "nimlsp.log"
09:33:42Clonkk[m]hmm
09:34:05Clonkk[m]It's empty 😛
09:34:12Clonkk[m]I must not use the correct executable
09:35:30Clonkk[m]Ah okay it just take a while to open
09:38:32Clonkk[m]Let's continue this discussion on this issue https://github.com/PMunch/nimlsp/issues/77
10:05:48*ForumUpdaterBot quit (Remote host closed the connection)
10:06:32*ForumUpdaterBot joined #nim
10:20:10*krux02 joined #nim
10:58:32FromDiscord<madman> sent a long message, see http://ix.io/2Vi4
10:59:57FromDiscord<haxscramper> `value: proc() {.cdecl.}` if you are interfacing with C code
11:01:03FromDiscord<madman> yes i am
11:01:13FromDiscord<madman> i also have importc and dynlib
11:01:32FromDiscord<madman> for some reason it sigsegv
11:06:07PMunchAlmost impossible to know why without at least looking at more code
11:06:25FromDiscord<madman> i need to declare it as a type right?
11:06:37PMunchBut yeah, that `proc` callback type needs to be defined with {.cdecl.}
11:06:53FromDiscord<madman> yeah i was passing it just a proc
11:07:05FromDiscord<madman> it should be type
11:07:14PMunchI don't think it has to be a type
11:08:00FromDiscord<madman> 1 sec
11:10:02FromDiscord<madman> https://play.nim-lang.org/#ix=2Vid
11:15:39PMunchTry this: https://play.nim-lang.org/#ix=2Vii
11:17:17FromDiscord<madman> print "thanks" 999
11:24:51PMunchNo problem :)
11:34:08FromDiscord<KnorrFG> if i want to have a list of all fields of a type in a typed macro, and I mean all fields, including inherited ones, is there a fu nction that does that, or do I have to write one that recurses throuhg all parent types?
11:35:04PMunchI think you have to recurse
11:35:32FromDiscord<KnorrFG> damn 😅 thanks
11:35:59PMunchThere might be someone who has written code for it and hidden it in a library somewhere though :P
11:36:23FromDiscord<KnorrFG> im probably faster writing it myself than looking for that
11:36:34FromDiscord<haxscramper> https://haxscramper.github.io/hnimast/src/hnimast/obj_field_macros.html#parseObject%2CNNode%2CParseCb%5BNNode%2CA%5D
11:36:54FromDiscord<haxscramper> But I'm not sure if it works for base base types, I think it doesn't
11:37:32FromDiscord<KnorrFG> ill check it out, ty
11:38:15FromDiscord<haxscramper> It was mostly a response for "someone who has written code for it and hidden it in a library somewhere",
11:38:56FromDiscord<haxscramper> So you can probably look at the code for unparsing objects, but given you have to find parent types it would be easier to write it yourself
11:39:34FromDiscord<haxscramper> Though I would say this library is heavily torture-tested on parsing tons for real code, so it does handle a lot of subtle edge cases
11:39:55FromDiscord<KnorrFG> yeah, in general it looks like something i could need
11:40:04FromDiscord<haxscramper> Like `case of` suddenly having two layers of `RecList` if you try to switch over `void` type and so on
11:41:31FromDiscord<haxscramper> But in general it all comes down to `parseObject(obj, parseNimPragma)` and then you are free to do anything
11:47:39FromDiscord<KnorrFG> `func getFuckingTypeImpl(node: NimNode): NimNode {...}` 🤣
11:52:55FromDiscord<no name fits> Is there an arithmetic formula to check for Armstrong numbers / narcissistic numbers or do I need to check each digit individually? It's in base 10
12:06:04*rockcavera joined #nim
12:47:39*arecaceae quit (Remote host closed the connection)
12:48:01*arecaceae joined #nim
13:28:43*waleee-cl joined #nim
13:55:11FromDiscord<hamidb80> is there some function for someNumber -> binary in stdlib?
13:55:28FromDiscord<hamidb80> (edit) "someNumber" => "`someNumber`" | "binary" => "`binary`"
13:56:51*sz0 joined #nim
14:06:55*wasted_youth2 quit (Quit: Leaving)
14:12:27*krux02 quit (Remote host closed the connection)
14:23:53m33[m]<FromDiscord "<hamidb80> (edit) "someNumber" ="> something like https://nim-lang.org/docs/strutils.html#toBin%2CBiggestInt%2CPositive you mean ?
14:28:00ForumUpdaterBotNew thread by Nyggus: Performance against Python: find substring in string, see https://forum.nim-lang.org/t/7758
14:46:07*tiorock joined #nim
14:46:07*tiorock quit (Changing host)
14:46:07*tiorock joined #nim
14:46:07*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
14:46:07*tiorock is now known as rockcavera
14:54:32*filcuc_ joined #nim
15:12:29*filcuc_ quit (Quit: Konversation terminated!)
15:12:43*filcuc_ joined #nim
15:17:07*Vladar quit (Read error: Connection reset by peer)
15:18:29*wasted_youth2 joined #nim
15:21:18*kwilczynski quit (Read error: Connection reset by peer)
15:21:58*sz0 quit (Ping timeout: 258 seconds)
15:22:03*fowl quit (Ping timeout: 260 seconds)
15:24:12*kwilczynski joined #nim
15:24:34*kwilczynski quit (Max SendQ exceeded)
15:24:51*robertmeta quit (Ping timeout: 260 seconds)
15:24:56*fowl joined #nim
15:25:21*kwilczynski joined #nim
15:25:34*sz0 joined #nim
15:25:51*robertmeta joined #nim
15:28:11*Tanger quit (Remote host closed the connection)
15:29:04*Tanger joined #nim
15:31:35*Tlangir joined #nim
15:34:17*Tanger quit (Ping timeout: 265 seconds)
15:41:38reversem3dom96 you around ?
15:47:58*Tlangir quit (Remote host closed the connection)
15:54:50*tiorock joined #nim
15:54:50*rockcavera is now known as Guest72393
15:54:50*Guest72393 quit (Killed (sinisalo.freenode.net (Nickname regained by services)))
15:54:50*tiorock is now known as rockcavera
15:57:39*filcuc_ quit (Ping timeout: 248 seconds)
16:18:29FromDiscord<zetashift> If any Nim style pro's are out here can you comment on my PR: https://github.com/josevalim/nested-data-structure-traversal/pull/16
16:18:35FromDiscord<Technisha> What are some good HTML preprocessors made in Nim, or a templating engine in Nim?
16:18:45FromDiscord<zetashift> Made by the dude who make Elixir so might be some nice exposure
16:29:32FromDiscord<exelotl> In reply to @Technisha|💻⭐ "What are some good": best options are stdtmpl: https://nim-lang.org/docs/filters.html#available-filters-stdtmpl-filter↵and karax: https://planety.github.io/prologue/views
16:30:03FromDiscord<Technisha> Thanks!
16:31:23FromDiscord<exelotl> np :) If you choose karax you can use this to help: https://github.com/nim-lang-cn/html2karax
16:31:45FromDiscord<Technisha> Oo neat!
16:32:02FromDiscord<Technisha> Would it also be possible to use less.js too? :P
16:32:19FromDiscord<Technisha> It's pretty neat imo since it's a nice css preprocessor :p
16:32:37PMunch@zetashift, I'd to %sectionCounter instead of sectionCounter.newJInt
16:32:47PMunchSame for lesson counter
16:33:04PMunchAnd I prefer `inc lessonCounter` over `lessonCounter.inc()`, but maybe that's just me
16:33:16FromDiscord<exelotl> In reply to @Technisha|💻⭐ "Would it also be": yeah, for CSS you're probably fine with any existing tool like less or sass
16:33:44*def- quit (Quit: -)
16:34:05*def- joined #nim
16:34:33FromDiscord<Technisha> Nice!
16:35:32PMunch@zetashift, and you don't need the getElems bit: http://ix.io/2VjM
16:35:53FromGitter<HJarausch_gitlab> How to monitor a website for changes? The problem is that - using a browser - one has to visit a given site which seems to store some cookies and ⏎ only then one can visit the desired site (otherwise one gets an error message about deleted cookies). ⏎ How can I do this with *nim* (httpclient)? ⏎ Many thanks for a hint, ⏎ Helmut. [https://gitter.im/nim-lang/Nim?at=606ddf697d3bb363218f2331]
16:36:03FromDiscord<zetashift> In reply to @PMunch "<@77574388035100672>, and you don't": thanks!
16:37:20FromDiscord<zetashift> Not the biggest fan of `%` though
16:39:23FromDiscord<zetashift> It got merged 😄
16:43:54PMunchWhy not?
16:46:07FromDiscord<zetashift> Probably unfamiliarity, not used to using `%` for constructing a new JSON type
16:46:55FromDiscord<zetashift> So that makes `foo.newJInt` more readable to me, but that's more of a case of getting used to new syntax ofcourse
16:48:57PMunchFair enough
16:56:41ForumUpdaterBotNew thread by HJarausch: Nim (devel) compilation takes a very long time with option --gc:orc, see https://forum.nim-lang.org/t/7759
16:57:18federico3https://media.ccc.de/v/rc3-525180-what_have_we_lost enjoy
17:04:36*vicfred joined #nim
17:11:28PMunchOoh fun
17:15:59Oddmongerwhy OS/400 is here (link above) ? It's still widely used
17:17:11*m4r35n357 quit (Quit: Ex-Chat)
17:17:37*m4r35n357 joined #nim
17:19:38federico3widely?
17:20:03*Vladar joined #nim
17:21:30Oddmongeryes it's still common in big companies
17:21:51*letto quit (Quit: Konversation terminated!)
17:22:22*sz0 quit (Quit: Connection closed for inactivity)
17:22:24Oddmongernow you will seldom see directly the 5250 terminal screen, it's now most used as a DB with java backend
17:23:51*letto joined #nim
18:03:35*letto quit (Ping timeout: 252 seconds)
18:06:57ForumUpdaterBotNew thread by Miran: 3rd Nim online meetup, see https://forum.nim-lang.org/t/7760
18:14:06FromDiscord<mlokis> In reply to @federico3 "https://media.ccc.de/v/rc3-525180-what_have_we_lost": you can also use south Korea OS, every your file gets unique id that is easily trackable
18:16:56FromDiscord<Technisha> Don't you mean North Korea? :P
18:26:26FromDiscord<Conifer> pretty sure they mean north korean indeed.
18:27:39FromDiscord<IDF(ardek66)> and that one is a linux distro too
18:29:03FromDiscord<Technisha> Isn't it Star OS or some shit?
18:29:46federico3@mlokis it uses watermarking and not on all files
18:32:27FromDiscord<mlokis> did i really swapped the poles lol
18:35:05ForumUpdaterBotNew thread by Japplegame: It is a bug?, see https://forum.nim-lang.org/t/7761
18:35:58reversem3<FromDiscord "<mlokis> In reply to @federico3 "> This is very cool , I remember a lot of these systems when I was looking for alternative OS's back in the day. One that really stands out is plan9 fork called 9 front which still uses acme editor http://fqa.9front.org/fqa1.html
18:37:42FromDiscord<mlokis> why are these bots everiwhare
18:39:28*letto joined #nim
18:42:04FromDiscord<IDF(ardek66)> the robots are taking over
19:19:31FromGitter<UrKr> How would I reuse the same datastructures on the server and the client? That is if I have some complex nim type that is being edited by nim generated JS in the browser, how would I send it to the server and vice-versa?
19:20:15FromGitter<UrKr> do I need to write custom code to serialise/deserialise or is there something else?
19:21:29FromDiscord<dom96> You can just serialize to/from JSON
19:30:28*lritter quit (Ping timeout: 252 seconds)
19:36:43*fredrikhr joined #nim
19:42:41*narimiran quit (Ping timeout: 240 seconds)
20:01:20*filcuc_ joined #nim
20:02:22*haxscramper quit (Remote host closed the connection)
20:18:09*couven92 joined #nim
20:21:07*fredrikhr quit (Ping timeout: 248 seconds)
20:27:51*couven92 is now known as fredrikhr
20:28:26*couven92 joined #nim
20:28:37*fredrikhr quit (Disconnected by services)
20:28:45*couven92 is now known as fredrikhr
20:35:38ForumUpdaterBotNew thread by Japplegame: Nim compiler generates strange C code, see https://forum.nim-lang.org/t/7762
20:38:12FromDiscord<zetashift> Is there anything like Scala's case classes (https://docs.scala-lang.org/tour/case-classes.html) for Nim?
20:38:35FromDiscord<Technisha> Oof no-one has commented on my post yet :p
20:38:51FromDiscord<Technisha> Nim doesn't have classes @zetashift
20:39:10FromDiscord<konsumlamm> case classes don't have much to do with OOP classes tbf
20:40:21FromDiscord<ElegantBeef> If you arent using runtime instantiations you could do `type Message[sender,recipient,body: static string] = object` 😄
20:41:03FromDiscord<ElegantBeef> For runtime instantiations it's as simple as making a `Message` object and using getters for the properties
20:41:16FromDiscord<ElegantBeef> That way only your `initMessage` can set the fields and you cannot change them elsewhere
20:41:22PMunch@Technisha, which post?
20:41:33FromDiscord<zetashift> In reply to @Technisha|💻⭐ "Oof no-one has commented": I don't know much about JNim sadly
20:41:38FromDiscord<zetashift> @PMunch https://forum.nim-lang.org/t/7757
20:41:43FromDiscord<konsumlamm> In reply to @zetashift "Is there anything like": which aspect do you mean? for pattern matching, there is `fusion/matching` (<https://nim-lang.github.io/fusion/src/fusion/matching>) which works with normal `object` and `ref object` types, for ADTs. there are variant objects, for auto-generated `==` and `hash`, you get those for free for any object type
20:42:36FromDiscord<zetashift> I didn't know about the auto-generated `==` and `hash` actually, thank you for that haha
20:43:39FromDiscord<konsumlamm> (`$` is also auto-generated)
20:44:03FromDiscord<konsumlamm> but that doesn't apply to ref objects
20:44:54FromDiscord<zetashift> I guess only thing missing is auto generated `apply` equivalents
20:44:59PMunch@Technisha, I'm guessing it's because it can't find the Main class..
20:45:21FromDiscord<Technisha> Oh
20:45:23FromDiscord<ElegantBeef> I didnt comment cause i was uncertain but yea, i feel like you need to tell it you're using the minecraft api
20:45:25FromDiscord<zetashift> Writing init methods sometimes for small types is a bit of a pain and writing `Foo(bar: bar, baz: baz)`
20:45:33FromDiscord<ElegantBeef> Constructor zeta
20:45:36FromDiscord<ElegantBeef> Use my package
20:45:39FromDiscord<Technisha> I'm dumb xD
20:45:54FromDiscord<Technisha> Lemme try finding the actual main class now (just have to decompile it on my RPI...)
20:45:54PMunchLooks like main takes a string
20:46:14FromDiscord<ElegantBeef> @zetashift https://github.com/beef331/constructor do it! 😛
20:46:22FromDiscord<zetashift> In reply to @ElegantBeef "Use my package": I was googling your name but forgot the github part so I got some pictures of really fancy beefs
20:46:25PMunchSo try to do `proc main(astring: string)` in your definition
20:46:33FromDiscord<ElegantBeef> now you're just hungry
20:46:56FromDiscord<ElegantBeef> `defaults` and `construct` are there to reduce the tedium
20:46:57PMunchWhere the string is the command line input
20:47:12FromDiscord<zetashift> Yeah this looks like the missing part thank you!
20:47:45PMunchOh, it looks like the class is also called MinecraftServer and not `Main`
20:48:03FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2VkW
20:48:22FromDiscord<ElegantBeef> Or if you want default values defaults is pretty nice and fairly idiomatic
20:49:13PMunch@Technisha, try this: http://ix.io/2VkX/nim
20:50:44FromDiscord<Technisha> Oh okay! Thanks!
20:51:26PMunchJust a wild guess by the way, no idea if it'll work or not :P
20:52:18FromDiscord<zetashift> In reply to @ElegantBeef "You still have to": Still works well enough
20:52:35FromDiscord<ElegantBeef> Yay "well enough" that's all i need to hear!
20:52:45FromDiscord<Technisha> Yeah PMunch still not working :p
20:53:10PMunchHaha, well it was worth a shot
20:53:15PMunchSame error?
20:53:16FromDiscord<Technisha> Yeah haha
20:53:20FromDiscord<Technisha> Yup
20:53:32FromDiscord<Technisha> I'd paste it but discord being a bitch
20:53:46PMunchMaybe someone who has actually used JNim can help
20:53:52FromDiscord<Technisha> And formatting from copying from tmux also being stupid :p
20:53:55FromDiscord<Technisha> Yeah haha
20:55:29FromDiscord<ElegantBeef> I have a feeling you need some way to tell jnim you're using non standard java libraries
20:55:35FromDiscord<zetashift> Maybe open an issue in the repo?
20:55:42FromDiscord<Technisha> Oh?
20:55:57FromDiscord<ElegantBeef> or type yuriy's name here and hope he awakens from his slumber to help 😛
20:56:05FromDiscord<Technisha> In reply to @PMunch "Maybe someone who has": Don't have spoons for that :p
20:56:08FromDiscord<Technisha> XD
20:56:26FromDiscord<Technisha> Idk what his name is exactly lmao
20:56:34FromDiscord<ElegantBeef> It's literally on his github
20:56:53FromDiscord<ElegantBeef> Most people go by their github names(aside from me of course)
20:57:05FromDiscord<Technisha> I'll check in a bit just tired+low on spoons
20:57:08PMunchSpoons?
20:57:25FromDiscord<ElegantBeef> string spoons
20:57:28FromDiscord<ElegantBeef> Dont wanna be low on them
20:58:17PMunchHaha :P
20:58:23FromDiscord<ElegantBeef> Pmunch i'm impatiently waiting for your picos so i can cry that everything is unintuitive and garbage 😛
20:58:40FromDiscord<Technisha> https://www.healthline.com/health/spoon-theory-chronic-illness-explained-like-never-before
20:58:42PMunchThey are in the mail and have arrived in Norway!
20:58:52PMunchSo I'll probably have them within a couple of days
20:59:07*tane joined #nim
20:59:11FromDiscord<Technisha> I'm not chronically ill but it's a good way to describe everything for me
21:00:30PMunchUgh, healthline is one of those sites that won't allow you to browse without cookies
21:00:38FromDiscord<Technisha> Oof
21:00:45FromDiscord<Technisha> I can copy and paste everything :p
21:00:58FromDiscord<ElegantBeef> Ironic that they want you to indulge in cookies to visit a site with health in the name
21:01:08FromDiscord<Technisha> XD
21:02:00FromDiscord<lamersc> I love people who unironically say they’re a programmer then I say what language and they tell me HTML
21:02:45FromDiscord<ElegantBeef> replace html with python and you got a good joke
21:03:27FromDiscord<ElegantBeef> Calm down everyone typing it was a joke, i dont gatekeep unless you write python 😉
21:04:50FromDiscord<Technisha> Lmao
21:05:09FromGitter<ynfle> Nim's syntax is because of python, so if python isn't a language, nim isn't
21:05:26FromDiscord<ElegantBeef> TIL offside rule only exists cause of python
21:08:37Fish-Facelearning is good
21:09:01Fish-FacePMunch: spoons are an unnecessarily confusing way of saying "mental energy"
21:09:53*filcuc_ quit (Quit: Konversation terminated!)
21:10:07*filcuc_ joined #nim
21:10:16FromDiscord<Technisha> Not for neurodivergent people :p
21:10:29FromDiscord<Technisha> (People with things like ADHD and shit)
21:10:31Fish-FaceI would like to learn how to use `parallel`, but the documentation seems lacking - it doesn't explain what is actually happening inside the `parallel` block, for example. Is there any tutorial or something for it
21:11:06Fish-FaceI don't see why the term needs to be different; it seems like some people just have less mental energy to begin with, or have it depleted differently than other people
21:11:30*filcuc_ quit (Client Quit)
21:11:40*zedeus quit (Ping timeout: 252 seconds)
21:11:43*filcuc_ joined #nim
21:12:32FromDiscord<Technisha> @yglukhov, could i have some help with JNim? :P
21:13:05FromDiscord<Technisha> I'm tryna use JNim to create a wrapper around the Paper server jar
21:13:10*zedeus joined #nim
21:13:16Fish-Face"spoon theory" takes something everyone understands (not having the energy to do something) and puts it in terms of something less helpful, because while we all need mental energy to do everyday tasks, nobody needs spoons to do tasks that aren't eating and things! So it has to say "imagine if you needed a certain number of spoons to do something" instead of "you know how you need energy to do things" :)
21:13:23*rockcavera quit (Ping timeout: 248 seconds)
21:13:44FromDiscord<Technisha> Basically it's spoons for mental energy instead of cooking ingredients :p
21:14:04FromDiscord<Technisha> So i have 2 teaspoons and 3 spoons worth of energy (as an example)
21:14:05leorize[m]Fish-Face: my genuine advice is don't even try to understand how parallel work
21:14:32Fish-Faceleorize[m]: and hence... don't use it?
21:15:14leorize[m]yep, there's mratsim's weave if you need computational parallelism
21:15:45Fish-Faceah
21:15:58Fish-FaceI am always biased towards stdlib for unknown reasons
21:16:02leorize[m]parallel is broken by design and the replacement is still in the concepts state
21:16:21Fish-Faceby design?
21:16:54*filcuc_ quit (Quit: Konversation terminated!)
21:17:08*filcuc_ joined #nim
21:18:17Fish-Face@Technisha right, but I don't think anyone has any universal understanding of how "one teaspoon" corresponds to "ability to perform tasks" because there's no standard for that, and besides everyone's requirements are unique to them, and impossible to describe (whether talking in terms of spoons or something else, I mean)
21:19:19FromDiscord<Technisha> Yeah definitely, but for me it's just a way to represent it
21:19:30FromDiscord<Technisha> So for me, one smaller task is worth a teaspoon :p
21:19:30Fish-Facemmm
21:20:14FromDiscord<Technisha> It's not a universal thing
21:20:24leorize[m]parallel's analysis is completely flawed if you may. afaik we are redesigning the basis behind how parallel can detect/prevent races as simpler primitives
21:20:25FromDiscord<Technisha> And yeah at first i found the concept kinda stupid
21:20:36leorize[m]std/isolation is the first step torwards this
21:20:45Fish-Faceok
21:20:54FromDiscord<Technisha> But it's just a neat way for me to describe it in a few words for servers that are familiar with that type of thing :p
21:21:31Fish-FaceI did have one crash from what I think should be correct (and compiling) code that normally works that uses parallel. (I stalled because I couldn't get anything that uses `Lock`s to work)
21:22:07*filcuc_ quit (Quit: Konversation terminated!)
21:22:18Fish-Face@Technisha how often do you have to explain the choice of words :P (Don't feel like you actually have to answer that)
21:22:21*filcuc_ joined #nim
21:23:26FromDiscord<Technisha> Basically never aha
21:23:43FromDiscord<Technisha> I don't actually use the term frequently unless I'm extremely tired mentally :p
21:24:21FromDiscord<Technisha> Though I don't mind explaining it and if someone thinks it's stupid, i understand that :p
21:24:27*filcuc_ quit (Read error: No route to host)
21:24:43*filcuc_ joined #nim
21:25:16Fish-FaceI used to think it was just me who thought like this but a while ago I talked about it with my cousin - who has ME - and my aunt, who agreed, so uhhh yay for me
21:25:22Fish-Facebut not yay for ME
21:26:21FromDiscord<Technisha> ME?
21:27:02Fish-Faceaka Chronic Fatigue
21:27:49FromDiscord<Technisha> Ah
21:28:16FromDiscord<Technisha> For me it's ADHD and various other mental issues :p
21:28:38FromDiscord<Technisha> And plurality but that's not much of a condition more so a thing i live with :p
21:29:00FromDiscord<Technisha> https://morethanone.info for some plurality info
21:29:38*filcuc_ quit (Read error: Connection reset by peer)
21:29:54*filcuc_ joined #nim
21:34:52*filcuc_ quit (Quit: Konversation terminated!)
21:35:05*filcuc_ joined #nim
21:40:05*filcuc_ quit (Quit: Konversation terminated!)
21:40:19*filcuc_ joined #nim
21:45:16*filcuc_ quit (Quit: Konversation terminated!)
21:45:33*filcuc_ joined #nim
21:47:15FromDiscord<elph> hi, a basic question: how do I get the a file's path relatively to a unit test? so let's say I have a test at `$PROJ/tests/my_test.nim` and want to read a file in `$PROJ/tests/foo.txt`?
21:48:22FromDiscord<elph> (read the file from `my_test.nim` that is)
21:50:31*filcuc_ quit (Quit: Konversation terminated!)
21:50:45*filcuc_ joined #nim
21:55:39*filcuc_ quit (Quit: Konversation terminated!)
21:55:55*filcuc_ joined #nim
22:00:15*tane quit (Quit: Leaving)
22:00:49*filcuc_ quit (Quit: Konversation terminated!)
22:01:04*filcuc_ joined #nim
22:03:46*xet7 quit (Ping timeout: 240 seconds)
22:05:52FromDiscord<mrotaru> sent a long message, see http://ix.io/2Vln
22:06:00*filcuc_ quit (Quit: Konversation terminated!)
22:06:13*filcuc_ joined #nim
22:07:32FromDiscord<dom96> you need to add `requires "fsnotify"` in your .nimble file
22:11:01FromDiscord<mrotaru> In reply to @dom96 "you need to add": Thanks !
22:11:17FromDiscord<mrotaru> still, where _does_ nimble place installed files ?
22:11:32FromDiscord<mrotaru> they don't seem to be inside the project
22:12:00FromDiscord<ElegantBeef> `~/.nimble/pkgs`
22:12:46*Vladar quit (Quit: Leaving)
22:14:07*filcuc_ quit (Ping timeout: 260 seconds)
22:21:44leorize@Clonkk @zetashift fixed that bug in nim.nvim :) please update your installation and test
22:40:27*PMunch quit (Quit: leaving)
23:06:16FromDiscord<Technisha> :p
23:09:25FromDiscord<Technisha> :p
23:13:22*NimBot joined #nim
23:23:21FromDiscord<Gary M> :p
23:30:51*rockcavera joined #nim
23:40:41*fredrikhr quit (Ping timeout: 240 seconds)
23:54:48*j quit (Quit: K-Lined)