<< 24-04-2020 >>

00:00:12*couven92 quit (Ping timeout: 265 seconds)
00:01:50*bunbunbunbunny joined #nim
00:04:49*ftsf joined #nim
00:46:38*ryan__ is now known as tlangir
00:58:32FromGitter<gogolxdong> @timotheecour glad to hear you like karax, me too, I built an application based on pure karax https://www.cloudfastnet.com/
01:01:27*dchem quit (Ping timeout: 250 seconds)
01:28:57*bunbunbunbunny quit (Quit: leaving)
01:32:13*rockcavera quit (Read error: Connection reset by peer)
01:32:34*rockcavera joined #nim
01:32:34*rockcavera quit (Changing host)
01:32:34*rockcavera joined #nim
01:39:46*dddddd quit (Ping timeout: 265 seconds)
01:39:55*zacharycarter quit (Ping timeout: 260 seconds)
01:59:24*chemist69 quit (Ping timeout: 256 seconds)
02:01:02Yardanicowow I only now found out that nim irc logs go all way back to 30.05.2012 https://irclogs.nim-lang.org/30-05-2012.html
02:01:06*chemist69 joined #nim
02:04:17*Guest15289 quit (Ping timeout: 250 seconds)
02:05:29*dadada joined #nim
02:05:52*dadada is now known as Guest90556
02:06:08*letto quit (Remote host closed the connection)
02:06:35*letto joined #nim
02:13:05*dchem joined #nim
02:14:49*muffindrake quit (Ping timeout: 272 seconds)
02:16:38*muffindrake joined #nim
02:17:40skrylar[m]does nims hcr work on windows these days
02:39:05shashlick!repo plugins
02:39:07disbothttps://github.com/genotrance/plugins -- 9plugins: 11Plugin system for Nim 15 21⭐ 1🍴 7& 29 more...
02:39:47Yardanicois it possible to make --gc:arc work for --os:standalone? because https://github.com/watzon/JackOS seems to have it but I couldn't compile because "Error: system module needs: nimErrorFlag" which happens because with os:standalone "system" includes system/embedded which doesn't have arc-specific stuff
02:40:54disrupteki can't think of a reason it couldn't.
02:41:47*granight joined #nim
02:53:04skrylar[m]suppose nobody knows then. ah well
02:58:17*granight quit (Quit: Leaving)
03:03:09FromDiscord_<KingDarBoja> Hi guys
03:13:25skrylar[m]hiyo
03:17:24*ftsf quit (Ping timeout: 265 seconds)
03:19:10FromDiscord_<KingDarBoja> \o/
03:19:21FromDiscord_<KingDarBoja> What's up bro?
03:23:34skrylar[m]nothing much yet. writing my test notes on v, still have to test code reloading in nim. and at some point sit down and get the fancy text module built
03:24:07disruptekseems like the glfw bindings i need have vanished from github.
03:24:33skrylar[m]how lucky that sdl2 does all you need to get the gl context then :^)
03:24:50disruptekit's a req for some code i want to run.
03:26:49FromDiscord_<KingDarBoja> on V?
03:26:51FromDiscord_<KingDarBoja> V lang?
03:27:00FromDiscord_<KingDarBoja> https://www.youtube.com/watch?v=sgHbC6udIqc I am watching this
03:28:23skrylar[m]yes. v is very nearly "acceptable," but i hate the reasoning for operator overloads
03:29:02skrylar[m]its "you might do a bad with them, so no soup for you." which means i couldn't ex. port and use skmap, it would get some third world keyword notation instead of just override [], and since their maps don't even hash non-string keys and mine do, its just. eurgh.
03:30:01skrylar[m]nim doesn't hide things from me because someone else might do it wrong, which is nice
03:30:23skrylar[m](those 0.7sec full compiles though.. cripes.)
03:35:34FromDiscord_<KingDarBoja> Good
03:35:48FromDiscord_<KingDarBoja> I still struggling to not fall into learning too many stuff
03:35:55FromDiscord_<KingDarBoja> I don't want to be a jack of all trades lol
03:36:45skrylar[m]generalists have their place
03:38:03FromDiscord_<KingDarBoja> Yup
03:38:21skrylar[m]oh unicode. nopes out at full speed
03:38:33skrylar[m]been there, did that
03:38:35FromDiscord_<KingDarBoja> Too bad I didn't pick CS as my bachelor career
03:39:00skrylar[m]schools are dumb. read knuth books instead
03:39:01FromDiscord_<KingDarBoja> 😒 That's why I tend to struggle, I lack the base knowledge but start digging harder on a single cave
03:39:13FromDiscord_<KingDarBoja> By single cave I mean single tech
03:40:15skrylar[m]knuth was kind of funny in that he's been quoted as saying he couldn't be bothered to keep up with languages so he just writes the algorithms in pseudocode
03:42:59FromDiscord_<KingDarBoja> That's better IMO
03:43:11FromDiscord_<KingDarBoja> Pseudocode as this is "language agnostic"
03:43:25skrylar[m]i will say there is something to be said for how they are self hosting in megabytes. Red pulled that off too, kinda
03:45:53skrylar[m]i think we can make go interfaces with macros in nim but it might be a little weird
03:46:37skrylar[m]those end up being structs with function pointers and go stuffs the pointers when you cast it
03:46:49skrylar[m]V precomputes a vtable for all the interfaces and the c code just indexes that
03:47:45skrylar[m]for cbor i just have a closure with an action enum and it calls that with the different operators it wants you to do, which absolutely does work but you have to write all the behavior in a big switch which is kinda dumbo
03:48:31skrylar[m]i suppose the answer is again, use a macro so it reads correct but just emits a swithc with a bunch of "iparam_2" glue
03:50:46shashlickEvery new thing works fast and is small
03:51:02disruptekHint: 542648 LOC; 39.196 sec; 845.305MiB peakmem;
03:51:18shashlickBut as you add capabilities and satisfy more use cases, it will become real
03:51:31shashlickStandard illusion of youth vs middle age
03:51:44skrylar[m]i don't entirely believe that. a lot of the speed penalties are because of design choices :\
03:51:57shashlickYou can judge wrinkles all you want
03:52:12skrylar[m]Β―\_(ツ)_/Β― CL certainly doesn't reach apocalyptic build times to update one function because they don't have a design based on compiling the entire image to update one function
03:53:11shashlickEverything new stands on the lessons of the old
03:53:34skrylar[m]you can put the book of aphorisms down, i'll stop talking
03:53:48shashlickThat's not my intention, sorry
03:54:15disruptektoo bad so few learned from cl.
03:54:24disrupteknot like it ain't old enough.
03:54:54skrylar[m]they took studying the classics out of the cirriculum to graduate several classes of java hacks
03:55:10disruptekpretty accurate, ime.
03:55:27skrylar[m]even MIT has clunked a lot of scheme to appeal to simpletons
03:55:41skrylar[m]as stepping stones sure thats fine but..
03:55:43skrylar[m]its just gone entirely
03:55:56FromDiscord_<KingDarBoja> I got lost while watching the video
03:56:14shashlickKnowledge is available like the sand, doesn't mean it is accessible to the everyone
03:56:16skrylar[m]are you trying to write your own unicode base code
03:56:29shashlickI can barely get thru a cs paper
03:58:04skrylar[m]i'll try not to go too far off the rails but basically there's been a systemic departure from the classical trivium/quadrivium and in to a lot of focus on wasting time or babblespeak. if you read ex. an aristotle book it's a very simple "here i will define my words, here is how they relate, now i'm going to take a nap." some of those cs papers seem to be rewarded on how indecipherable of language they use, because they can
03:58:04skrylar[m]almost always be rewritten with a lot less obfuscation
03:58:15disrupteki can barely get through a doorway.
03:58:25disruptekneed to get some exercise.
03:58:37shashlickFact is that every industry has its masters and paper pushers
03:59:17skrylar[m]well when trying to figure out how cassowary did its thing, there were a lot of references to other hard to decipher papers, and then on youtube someone just points out how simplex optimization works in five minutes
03:59:27skrylar[m]and then cassowary is just 'that' with a couple steps added
04:00:12skrylar[m]so.. things do get more toothy as they get complicated, but sometimes they didn't need to be complicated
04:00:39*silvernode joined #nim
04:00:39shashlickSounds Feynman'ish
04:01:56skrylar[m]well the last i should say is when you hide a lot of your class members in c++ via either a dptr, or a fixed-size block of bytes you typecast internally, a nontrivial amount of compile time bloat dies
04:02:33skrylar[m]lot of time wasted collecting data that was not needed
04:03:58skrylar[m]wonder if making a custom rect for text layout is wise or premature. there are a lot of boxes needed to lay out a paragraph and single glyphs are rarely >250px
04:04:36FromDiscord_<KingDarBoja> You guys got me wrong, I mean about the topic being discussed while I was watching the video, seems like disruptek was talking too
04:04:59FromDiscord_<KingDarBoja> But got the idea from Pro Tip #1
04:05:13FromDiscord_<KingDarBoja> Unicode on the inside (decode), bytes on the outside (encode)
04:05:31skrylar[m]unicode is all pretty well documented, its just tedious
04:05:44FromDiscord_<KingDarBoja> So I should pick any nim string (doesn't matter if it is raw aka triple quoted strings ?) and convert into unicode
04:05:50FromDiscord_<KingDarBoja> Use unicode module for that
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:08FromDiscord_<KingDarBoja> Deal any character (in this case, Rune) to check and return the decoded unicode
04:06:18skrylar[m]nim strings are already utf-8 aren't they
04:06:32*waleee-cl quit (Quit: Connection closed for inactivity)
04:06:45*supakeen joined #nim
04:07:06FromDiscord_<KingDarBoja> In that case, I just missing the unicode module
04:07:17FromDiscord_<KingDarBoja> To properly get the character at the desired position
04:08:07FromDiscord_<KingDarBoja> skylar[m]: Yeah, they are
04:08:34FromDiscord_<KingDarBoja> https://gist.github.com/Varriount/c3ba438533497bc636da
04:18:23rockcaverais not safe "var string" in procedure async?
04:20:38PrestigeIs there a table proc to check if a value exists? Or should I just loop over everything?
04:21:00PrestigeHm maybe a bidirectional map would be a better use for this
04:21:27leorizePrestige: yes, hasKey
04:21:33leorizeoh wait a value?
04:21:35leorizeyea then loop
04:21:38PrestigeHm ok
04:21:55Prestigeoh there's withValue, that looks good
04:26:24FromDiscord_<KingDarBoja> Does Nim has a pet?
04:26:58rockcaveraImproving the question: isn't "var T" safe in procedure async parameters?
04:28:04PrestigeA bidirectional map would be cool
04:36:13*rockcavera quit (Remote host closed the connection)
04:38:14FromDiscord_<Technicae Circuit> Heya, how would i declare a variable in Nim?
04:45:09FromDiscord_<InventorMatt> var x = sometype
04:47:48FromDiscord_<Technicae Circuit> Thanks
04:51:29silvernodearrays are immutable right?
04:56:14FromDiscord_<Elegant Beef> The length is
04:56:31FromDiscord_<Elegant Beef> Atleast to my knowledge arrays need to be a compiletime constant
04:56:38FromDiscord_<Elegant Beef> array lengths*
04:56:50FromDiscord_<Elegant Beef> I'm probably certainly wrong
04:56:53FromDiscord_<Elegant Beef> since i tend to be that a lot
04:57:38FromDiscord_<Technicae Circuit> Is there python-like lists in Nim?
04:57:47FromDiscord_<Technicae Circuit> So i can add and remove values
04:57:53FromDiscord_<Elegant Beef> sequences
04:58:06FromDiscord_<Technicae Circuit> How do i use them?
04:58:14FromDiscord_<Elegant Beef> `var s : seq[int] = @[1,2,3,4,5}`
04:58:24FromDiscord_<Elegant Beef> clearly supposed to be `]` at the end
04:58:38FromDiscord_<Technicae Circuit> Oh okay
04:58:53FromDiscord_<Technicae Circuit> Does that only accept one type?
04:59:01FromDiscord_<Elegant Beef> yes
04:59:10FromDiscord_<Technicae Circuit> Damn
04:59:14*silvernode quit (Ping timeout: 240 seconds)
04:59:16FromDiscord_<Elegant Beef> Strictly typed languages be like that πŸ˜„
04:59:31FromDiscord_<Technicae Circuit> So i should use a 2d sequence for multiple types in an array
04:59:33FromDiscord_<Technicae Circuit> :p
04:59:46FromDiscord_<Elegant Beef> What are doing that you need multiple types?
04:59:56FromDiscord_<Technicae Circuit> Just curious right now
05:02:18FromDiscord_<Technicae Circuit> Nim is surprisingly nice for a compiled language
05:02:32FromDiscord_<Elegant Beef> I agree
05:02:34FromDiscord_<Technicae Circuit> Probably because i am used to the Pythonish syntax
05:02:46FromDiscord_<Technicae Circuit> And it doesn't use a main function for code
05:02:53FromDiscord_<Elegant Beef> I like some of the syntaxial sugar
05:02:58FromDiscord_<Technicae Circuit> Mhmm
05:03:00FromDiscord_<Elegant Beef> Main function doesnt matter really
05:03:14FromDiscord_<Elegant Beef> Since you can think of your main file as a named function
05:03:23FromDiscord_<Technicae Circuit> True, but i just prefer anything without the main function
05:03:25FromDiscord_<Technicae Circuit> Yeah
05:03:46FromDiscord_<Elegant Beef> i mean mained*
05:04:11FromDiscord_<Technicae Circuit> Oh okay
05:04:12FromDiscord_<Elegant Beef> I still use a main function and just call it at the end cause i prefer containerizing the code for reusabillity
05:04:24FromDiscord_<Technicae Circuit> Oh okay
05:04:36FromDiscord_<Technicae Circuit> How do i define a function again? :P
05:04:39FromDiscord_<Elegant Beef> Is "oh okay" equivlent to "I didnt ask"
05:04:49FromDiscord_<Technicae Circuit> not like that
05:04:50FromDiscord_<Elegant Beef> `proc name(args:type):returnType = body`
05:04:52FromDiscord_<Technicae Circuit> I'm interested
05:04:54skrylar[m]arrays elements are mutable the length is constant. sequences are mutable and te length is mutable.
05:04:55FromDiscord_<Technicae Circuit> Thanks
05:05:00FromDiscord_<Technicae Circuit> :p
05:05:10skrylar[m]also nim correctly exposes length and capacity separately which you would be surprised how many languages botch
05:05:25FromDiscord_<Elegant Beef> In what way to they bodge them?
05:05:28FromDiscord_<Elegant Beef> Make them the same thing?
05:05:41skrylar[m]many of them don't let you pre-allocate for capacity
05:05:58skrylar[m]iirc nim you can ask for a length of zero but a capacity of whatever upper bound you expect
05:06:17skrylar[m]so when you go append stuff one at a time it doesn't trigger reallocs
05:06:25FromDiscord_<Elegant Beef> Ah
05:06:41FromDiscord_<Elegant Beef> I know C# has those features too, and it's the only other language i've really used
05:09:38FromDiscord_<KingDarBoja> If you want different types, use tables
05:09:48FromDiscord_<KingDarBoja> Which are the equivalent to dictionaries
05:10:03FromDiscord_<Elegant Beef> That doesnt give you different types
05:10:11FromDiscord_<Elegant Beef> It's still typeA,typeB
05:10:42FromDiscord_<Elegant Beef> And afaik it only works on ints/strings as keys unless it has a hash method
05:11:27FromDiscord_<Elegant Beef> https://nim-lang.org/docs/tables.html#basic-usage-hashing
05:11:27FromDiscord_<Elegant Beef> Hey im right, write it down!
05:12:10*manjaroi3 joined #nim
05:15:23*mwbrown quit (Ping timeout: 250 seconds)
05:16:04FromDiscord_<Technicae Circuit> Why is Nim such a good language?
05:17:45FromDiscord_<Elegant Beef> Well designed, nice sugar, it's not python πŸ˜„
05:18:18*mwbrown joined #nim
05:18:39FromDiscord_<Technicae Circuit> :p
05:18:47FromDiscord_<Technicae Circuit> I got the error `Error: expression 'main()' is of type 'int' and has to be discarded`
05:18:53FromDiscord_<Elegant Beef> yep
05:18:58FromDiscord_<Elegant Beef> You have a return type you dont handle
05:19:05FromDiscord_<Technicae Circuit> Oh okay
05:19:15FromDiscord_<Elegant Beef> `discard main()` will solve it
05:19:19FromDiscord_<Technicae Circuit> Cool
05:19:45FromDiscord_<Technicae Circuit> I just did ```nim
05:19:45FromDiscord_<Technicae Circuit> proc main():int =
05:19:45FromDiscord_<Technicae Circuit> return 0
05:19:45FromDiscord_<Technicae Circuit>
05:19:45FromDiscord_<Technicae Circuit> main()```
05:19:48FromDiscord_<Technicae Circuit> :p
05:19:49FromDiscord_<Elegant Beef> Yea
05:20:14FromDiscord_<Technicae Circuit> It worked
05:20:16FromDiscord_<Technicae Circuit> Coolio
05:20:28FromDiscord_<Elegant Beef> In most languages you can put a value on any line, and the language doesnt complain, nim doesnt like values that dont get handled
05:20:50FromDiscord_<Elegant Beef> so in python you can put `"This is totally useless"` anywhere and it still runs
05:20:51FromDiscord_<Technicae Circuit> Oh okay
05:20:57FromDiscord_<Technicae Circuit> Yeah
05:21:06FromDiscord_<Technicae Circuit> That's actually good to know
05:21:14FromDiscord_<Elegant Beef> in nim you need to `discard "This is totally useless"`, so it's less funny
05:21:31FromDiscord_<KingDarBoja> Arrr got it wrong, sorry
05:21:42FromDiscord_<Technicae Circuit> So how would multiline comments work? In python you just use a multline strings
05:21:46FromDiscord_<Technicae Circuit> So how would multiline comments work? In python you just use a multline string
05:22:06FromDiscord_<KingDarBoja> Multiline comments? Or multiline strings
05:22:09FromDiscord_<Elegant Beef> `#[Multiline inbetweenhere]#`
05:22:25FromDiscord_<KingDarBoja> Use `##[]##` if you wish it to be docstring-like
05:22:36FromDiscord_<Technicae Circuit> Thanks!
05:22:37FromDiscord_<Elegant Beef> Python doesnt have multiline comments so people tend to just drop strings for comments and let the language figure it out πŸ˜„
05:22:43FromDiscord_<Technicae Circuit> Yeah
05:23:08FromDiscord_<KingDarBoja> πŸ˜„
05:23:25FromDiscord_<Technicae Circuit> I like Nim alot
05:23:49*narimiran joined #nim
05:23:51FromDiscord_<Elegant Beef> I have a feeling that's a shared feeling in these parts
05:23:54FromDiscord_<Technicae Circuit> I need to get Syntax highlighting for Nim with nano
05:23:58FromDiscord_<Technicae Circuit> Eheheheh
05:24:08FromDiscord_<KingDarBoja> I use VSCode so...
05:24:15FromDiscord_<Elegant Beef> Use vscode with nim alt
05:24:17*FromDiscord_ <KingDarBoja> I am doomed
05:24:19FromDiscord_<Elegant Beef> Gary's done some good work on that
05:24:20FromDiscord_<KingDarBoja> nvm
05:24:27FromDiscord_<Technicae Circuit> I mainly use vsc, but I'm on mobile using Termux
05:24:41FromDiscord_<Technicae Circuit> So i prefer nano
05:24:41*pbb quit (Ping timeout: 265 seconds)
05:24:49*pbb_ joined #nim
05:24:58FromDiscord_<KingDarBoja> Gonna play a bit
05:25:22skrylar[m]kakoune here.. though i used to have a highly customized emacs+mode, though i dunno where my mode is buried atm
05:25:54FromDiscord_<Technicae Circuit> What's kakoune?
05:26:16skrylar[m]https://github.com/mawww/kakoune
05:26:40skrylar[m]reimagined vim; based around multiple selections and composed keystrokes
05:26:53*manjaroi3 quit (Quit: leaving)
05:27:18FromDiscord_<Technicae Circuit> Oo
05:27:20FromDiscord_<Technicae Circuit> Cool
05:28:21*tlangir is now known as number_two
05:30:18*lritter joined #nim
05:30:43FromDiscord_<Technicae Circuit> Why was Nim made?
05:30:57FromDiscord_<Elegant Beef> Araq, probably knows
05:31:03FromDiscord_<Technicae Circuit> And who were the people who developed ir
05:31:05FromDiscord_<Technicae Circuit> It*
05:31:07FromDiscord_<Technicae Circuit> Oh okay
05:31:24FromDiscord_<Elegant Beef> He's the language founder and is around here quite a bit
05:31:35FromDiscord_<Elegant Beef> You can always look at the nim github to see the contributors
05:31:35FromDiscord_<Technicae Circuit> O
05:31:45FromDiscord_<Technicae Circuit> Cool
05:32:14FromDiscord_<Technicae Circuit> Nim has a small community right now, doesn't it?
05:32:31FromDiscord_<Elegant Beef> It was only officially released last october, so it's super new
05:32:36FromDiscord_<Technicae Circuit> O
05:32:46FromDiscord_<Technicae Circuit> It was released before October then?
05:33:33FromDiscord_<Technicae Circuit> Well
05:33:45FromDiscord_<Technicae Circuit> Was it available to the public before October is what i mean
05:33:48FromDiscord_<Elegant Beef> It's been around since 2008, just first full release was october
05:33:58FromDiscord_<Technicae Circuit> Oh okay
05:34:00FromDiscord_<Technicae Circuit> Cool
05:34:07FromDiscord_<Elegant Beef> All your other questions can be answered here
05:34:08FromDiscord_<Elegant Beef> https://en.wikipedia.org/wiki/Nim_(programming_language)
05:34:13FromDiscord_<Technicae Circuit> Thanks!
05:34:14skrylar[m]probably because araq was a delphi head and delphi is kill
05:34:27skrylar[m]i should say delphi enthusiast i dont think he worked at borland
05:34:44FromDiscord_<Technicae Circuit> O
05:34:44skrylar[m]old versions of nim were very much pythonized pascal
05:34:45FromDiscord_<KingDarBoja> Woah
05:34:47FromDiscord_<Elegant Beef> I mean im sorta disppointed it's not called nimrod anymore
05:34:48FromDiscord_<KingDarBoja> 2008-2020
05:35:03FromDiscord_<Technicae Circuit> Why are you disappointed for?
05:35:14FromDiscord_<KingDarBoja> That's like... 12 years under development, but glad it got it's first release
05:35:23skrylar[m]it was a capitulation to make derps happy
05:35:25FromDiscord_<Elegant Beef> Cause nimrod is a peak language name
05:35:35FromDiscord_<Technicae Circuit> :p
05:35:43FromDiscord_<Elegant Beef> Well it started development in 2005 wikipedia says
05:35:48FromDiscord_<Elegant Beef> so 15 years
05:35:52skrylar[m]then you have mozilla name a language after a literally undesirable situation that makes your metal unusable
05:36:05skrylar[m]... which is appropriate, nevermind. :ducks:
05:36:06FromDiscord_<Technicae Circuit> Is it older then Python?
05:36:13FromDiscord_<KingDarBoja> I admire him for not giving up on those years
05:36:21FromDiscord_<Technicae Circuit> Mhm
05:36:30*FromDiscord_ <KingDarBoja> Rusty Rusty
05:36:44*FromDiscord_ <KingDarBoja> Go deep, Go Haxe
05:36:45FromDiscord_<Elegant Beef> Lol skrylar dont say that too loud the crabs will attack
05:36:45skrylar[m]some of these altlangs are pretty old actually
05:37:02skrylar[m]haxe is quite aged too, as was D1
05:37:03FromDiscord_<Technicae Circuit> That's very nice
05:37:07FromDiscord_<Elegant Beef> All im going to say is what does a king crab wear on his head?
05:37:22FromDiscord_<Technicae Circuit> Idk
05:37:29FromDiscord_<Elegant Beef> *the answer is a crown*
05:37:38*FromDiscord_ <KingDarBoja> Crab dance
05:37:38FromDiscord_<Elegant Beef> The icon of nim πŸ˜„
05:37:43skrylar[m]well "nimrod" was also a positive bible reference iirc, which a lot of tech places hate
05:37:46FromDiscord_<Technicae Circuit> O
05:37:57FromDiscord_<Technicae Circuit> > <skrylar[m]> well "nimrod" was also a positive bible reference iirc, which a lot of tech places hate
05:37:57FromDiscord_<Technicae Circuit> Oof
05:38:00FromDiscord_<KingDarBoja> https://www.youtube.com/watch?v=LDU_Txk06tM
05:38:06skrylar[m](i somehow doubt if it was called "hailsatan" google would have been nearly as offended, but i won't go in to that further)
05:38:21FromDiscord_<Technicae Circuit> Haha
05:39:00FromDiscord_<Elegant Beef> I've now lost interest in the nimrod language, i thought it was based off the insult
05:39:14FromDiscord_<Technicae Circuit> O
05:39:17skrylar[m]the insult was itself based on the same reference
05:39:31FromDiscord_<Technicae Circuit> ~~Don't lose interest for this amazing language~~
05:39:32FromDiscord_<Elegant Beef> *obviously*
05:39:45FromDiscord_<Elegant Beef> I've already made a window manager for it, im already too deep
05:39:48FromDiscord_<Elegant Beef> with it*
05:40:14skrylar[m]the interesting times when childrens cartoons contained heavy doses of irony and reference to classical texts :thonk:
05:40:32FromDiscord_<Technicae Circuit> Oo
05:41:22FromDiscord_<Elegant Beef> So after reading that hash stuff i thought, why isnt there macro that makes hash functions for objects if declared
05:41:50FromDiscord_<Elegant Beef> Seems like hashing all the hashable members of a type is a logical thing for a proc to do
05:41:57FromDiscord_<Elegant Beef> macro*
05:42:13skrylar[m]and now you know why skmap has a user supplied hash function :3
05:42:39FromDiscord_<Elegant Beef> Huh?
05:42:51FromDiscord_<Technicae Circuit> Is there something like `import github/username/repo`
05:43:01FromDiscord_<Elegant Beef> `nimble install repo`
05:43:01skrylar[m]no we aren't Go
05:43:11FromDiscord_<Elegant Beef> Works if it's a nimble package
05:43:11FromDiscord_<Technicae Circuit> Which would just be the approximate path to to the GitHub folder
05:43:17FromDiscord_<Technicae Circuit> O
05:43:30FromDiscord_<Elegant Beef> If it's not a nimble package you cant, cause that's silly
05:43:48skrylar[m]fwiw even the go folk have started t orealize why importing github directly was bad and have been walking it back with dep and vendoring tools
05:44:42skrylar[m]@Elegant Beef i made my hash tables accept a closure when you initialize it which hashes the key, so the hash functions are replacable. for things like custom key hashing
05:45:41FromDiscord_<Elegant Beef> Ah, i was thinking to just have the macro automate the hashing of objects, but couldnt be arsed to write it so thought i'd see if there was anything like that
05:45:42*ftsf joined #nim
05:45:49FromDiscord_<Elegant Beef> Feel like something like that should be included in the tables module
05:45:53skrylar[m]but otherwise, i don't think anything stops you from writing a macro that walks over the fields of a struct and feeds them to another hash function underneath
05:46:10FromDiscord_<Elegant Beef> Well yea nothing stops me but my laziness
05:46:26skrylar[m]laziness bad. git gud :E
05:46:41FromDiscord_<Elegant Beef> Eh, i gotta still implement fullscreen windows into my window manager
05:47:01FromDiscord_<Elegant Beef> *Note to self never use xlib ever agaiN*
05:47:04FromDiscord_<Elegant Beef> *Note to self never use xlib ever again*
05:47:10skrylar[m]oof
05:47:18skrylar[m]still have to finish an xxhash port
05:48:01*skrylar[m] may be unnecessarily using a crypto hash to store keys because its the only hash that works in the lib xD
05:48:10FromDiscord_<Elegant Beef> lol
05:48:43FromDiscord_<Elegant Beef> I do think ill try writting that function cause it seems rather useful to speed up using tables
05:48:52FromDiscord_<Elegant Beef> but after i get fullscreen support πŸ˜„
05:49:32skrylar[m]https://github.com/Skrylar/skflatbuffers/blob/master/skflatbuffer.nim#L76 not sure if this macro still works
05:49:48skrylar[m]i already wrote some that iterate fields and try to emit code for it
05:50:14FromDiscord_<Elegant Beef> ah yea
05:50:14skrylar[m]which is 90% of the job you're trying to do lol
05:50:26FromDiscord_<Elegant Beef> I know i previously tried to automate making constructors
05:50:57FromDiscord_<Elegant Beef> so you could do something like
05:50:58FromDiscord_<Elegant Beef> `construct(type,"memberA","memberB")`
05:51:02FromDiscord_<Elegant Beef> and it'd handle everything
05:51:12FromDiscord_<Technicae Circuit> How do Nim tables work?
05:51:15*hoijui joined #nim
05:51:35FromDiscord_<Elegant Beef> They're hashmaps but the key needs to be a int/string/type with two procs implemented
05:51:39skrylar[m]never used them. but they're supposed to be your standard key/value store
05:51:41FromDiscord_<Elegant Beef> scroll up there is a explanation on there
05:51:50FromDiscord_<Technicae Circuit> Okay
05:52:06FromDiscord_<Rika> til skrylar was already working on xxhash, damn, thought that could be my next project
05:52:30skrylar[m]it still could. i haven't worked on it in a few days
05:52:39skrylar[m]i have spookyhash too but theres a bug in it
05:52:51FromDiscord_<Rika> that's just a waste of effort aint it?
05:52:55FromDiscord_<Rika> unless i fork your repo
05:52:56skrylar[m]blake however is tested against the official versions test vectors and works
05:54:30FromDiscord_<Technicae Circuit> Table are basically made like `{"key":"value"}`
05:54:36FromDiscord_<Technicae Circuit> Table are basically made like `{"key":"value"}.toTabls`
05:54:54FromDiscord_<Technicae Circuit> `{"key":"value"}.toTable`*
05:55:10FromDiscord_<Technicae Circuit> I forgot about editing ;-;
05:55:12FromDiscord_<Rika> yes
05:55:26FromDiscord_<Elegant Beef> You can also use the initTable proc, to initalize an empty table
05:55:48FromDiscord_<Technicae Circuit> Oh okay, cool
05:56:19FromDiscord_<Rika> `{"key": "value"}` is essentially `((key: "key", val: "value"))` (two tuples)
05:56:44FromDiscord_<Technicae Circuit> Oh? Why is it like that?
05:57:16FromDiscord_<Rika> tables arent imported by default
05:57:23FromDiscord_<Technicae Circuit> So i know how to use input and output, i know about let, const and var, i know about sequences, arrays and tables, so do i need to know anything else?
05:57:26FromDiscord_<Technicae Circuit> True
05:57:36FromDiscord_<Elegant Beef> Flow control
05:57:46FromDiscord_<Rika> do you know tuples?
05:57:47FromDiscord_<Technicae Circuit> What's that? :P
05:57:54FromDiscord_<Rika> if else elif when
05:57:58FromDiscord_<Rika> thats flow control i assume
05:58:05FromDiscord_<Elegant Beef> if,case,else,elif,while,for i'd consider flow control
05:58:17FromDiscord_<Technicae Circuit> Not yet, unless tuples in nim are similar to Python's tuples
05:58:20FromDiscord_<Technicae Circuit> Oh okay
05:58:25FromDiscord_<Rika> they pretty much are
05:58:38FromDiscord_<Rika> except nim tuples can have names assigned to their fields
06:01:46*hoijui quit (Quit: Leaving)
06:02:41FromDiscord_<Technicae Circuit> Oh okay, nice
06:02:49FromDiscord_<Technicae Circuit> ```/data/data/com.termux/files/home/nim_stuff/main.nim(3, 14) Error: undeclared field: 'toLower' for type system.string [declared in /data/data/com.termux/files/usr/lib/nim/lib/system.nim(34, 3)]
06:02:49FromDiscord_<Technicae Circuit> u0_a165@localhost ~/nim_stuff [1]> cat main.nim
06:02:49FromDiscord_<Technicae Circuit> proc main():int =
06:02:49FromDiscord_<Technicae Circuit> let userinput:string = string(readLine(stdin))
06:02:49FromDiscord_<Technicae Circuit> if userinput.toLower == "hi":
06:02:50FromDiscord_<Technicae Circuit> echo userinput
06:02:51FromDiscord_<Technicae Circuit> elif userinput.toLower == "hello":
06:02:53FromDiscord_<Technicae Circuit> echo userinput
06:02:54FromDiscord_<Technicae Circuit> else:
06:02:56FromDiscord_<Technicae Circuit> echo "Heya"
06:02:57FromDiscord_<Technicae Circuit> return 0
06:02:59FromDiscord_<Technicae Circuit>
06:03:00FromDiscord_<Technicae Circuit> discard main()```
06:03:02FromDiscord_<Technicae Circuit> Any idea what thw issue is?
06:03:05FromDiscord_<Technicae Circuit> Any idea what the issue is?
06:03:08FromDiscord_<Technicae Circuit> Wait
06:03:12FromDiscord_<Technicae Circuit> Lemme use a paste service
06:04:50FromDiscord_<Technicae Circuit> https://hastebin.com/jolefumovo.bash
06:05:10FromDiscord_<Technicae Circuit> That's my code and I'm getting an undeclared field error
06:05:17FromDiscord_<Elegant Beef> tolower is in unicode/strutils
06:05:17FromDiscord_<Technicae Circuit> Unless toLower is wrong
06:05:23FromDiscord_<Technicae Circuit> Oh okay
06:05:29FromDiscord_<Elegant Beef> You need to import strutils
06:05:36FromDiscord_<Technicae Circuit> Oki
06:06:17FromDiscord_<Elegant Beef> also be nice to thes irc nerds dont paste too many lines
06:06:24FromDiscord_<Elegant Beef> a few is fine more than that is bad
06:06:36FromDiscord_<Technicae Circuit> Yeah, i just realised :p
06:07:06FromDiscord_<Technicae Circuit> Nim might be my favourite language soon
06:07:17FromDiscord_<Technicae Circuit> My current favourite lang is Python
06:07:47FromDiscord_<Elegant Beef> Well that's weird, liking python
06:08:05FromDiscord_<Technicae Circuit> Say that to the Python discord server :p
06:08:37FromDiscord_<Technicae Circuit> Python has alot of stuff that can be used
06:08:53FromDiscord_<Elegant Beef> But not a sensible typing
06:08:57FromDiscord_<Technicae Circuit> Wdym?
06:09:16FromDiscord_<Elegant Beef> I hate dynamically typed languages
06:09:24FromDiscord_<Technicae Circuit> Oh okay
06:09:38FromDiscord_<Technicae Circuit> I prefer them but i know that that can reduce speed
06:09:44FromDiscord_<Technicae Circuit> There is also Cython
06:09:56FromDiscord_<Technicae Circuit> Which compiles Python to C or C++
06:10:08*kenran joined #nim
06:10:29FromDiscord_<Technicae Circuit> And it allows you to do `cpdef type var_name = value`
06:10:53FromDiscord_<Elegant Beef> Yea that's not hideous
06:11:14FromDiscord_<Technicae Circuit> For booleans you just use an integer since bools are just ints in Python
06:11:20FromDiscord_<Technicae Circuit> Which i personally don't like
06:11:32FromDiscord_<Technicae Circuit> Because `False + 1 == True` basically
06:12:58FromDiscord_<Rika> bools in python inherit from int?
06:13:12FromDiscord_<Elegant Beef> Bools are enums in nim, so it's not too crazy πŸ˜„
06:13:17FromDiscord_<Elegant Beef> Although they're magic here
06:13:51FromDiscord_<Technicae Circuit>
06:13:51FromDiscord_<Technicae Circuit> https://cdn.discordapp.com/attachments/371759389889003532/703126538580918332/Screenshot_20200424_071342_com.termux.jpg
06:14:01FromDiscord_<Technicae Circuit> > bools in python inherit from int?
06:14:01FromDiscord_<Technicae Circuit> Yup
06:14:05skrylar[m]i like janet, but i use python :b
06:14:29FromDiscord_<Elegant Beef> `echo bool(int(false) + 1)`
06:14:35FromDiscord_<Elegant Beef> There you go that's how you do it in nim
06:14:44FromDiscord_<Technicae Circuit> `>>> dir(int)
06:14:44FromDiscord_<Technicae Circuit> ['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos
06:14:50FromDiscord_<Technicae Circuit> Specifically __bool__
06:14:50FromDiscord_<Rika> πŸ‘€
06:15:10FromDiscord_<Rika> `__bool__` just means you can convert it to a bool aint it
06:15:12FromDiscord_<Elegant Beef> "Yea i noticed the paste, i'll host it" procedes to attack our irc brethern
06:15:16FromDiscord_<Technicae Circuit> Yeah
06:15:22FromDiscord_<Technicae Circuit> Wut
06:15:23FromDiscord_<Rika> > "Yea i noticed the paste, i'll host it" procedes to attack our irc brethern
06:15:23FromDiscord_<Rika> @Elegant Beef its a single line
06:15:28FromDiscord_<Elegant Beef> Ah
06:15:28FromDiscord_<Technicae Circuit> 2 lines
06:15:35FromDiscord_<Technicae Circuit> :p
06:15:35FromDiscord_<Rika> yeah, that
06:15:40FromDiscord_<Elegant Beef> Got discord on my portrait monitor
06:15:48FromDiscord_<Elegant Beef> That's a big ol' block fo text
06:15:53FromDiscord_<Elegant Beef> of*
06:15:53FromDiscord_<Rika> lucky you, with two monitors
06:15:54FromDiscord_<Technicae Circuit> Haha
06:15:54skrylar[m]matrix here o/
06:16:01FromDiscord_<Rika> fuck matrix
06:16:06FromDiscord_<Rika> (im joking)
06:16:07FromDiscord_<Technicae Circuit> There's a matrix channel for Nim?
06:16:14FromDiscord_<Elegant Beef> You're in it right now
06:16:17FromDiscord_<Elegant Beef> Through discord
06:16:17FromDiscord_<Rika> no theres a matrix bridge
06:16:21skrylar[m]as a protocol matrix isn't exactly bad.
06:16:26FromDiscord_<Technicae Circuit> Oh okay
06:16:33FromDiscord_<Rika> hey i said i was joking
06:16:38FromDiscord_<Elegant Beef> From my understanding video/audio is garbo
06:16:43FromDiscord_<Elegant Beef> I havent actually ever used matrix
06:16:54FromDiscord_<Elegant Beef> I wanted to use it over discord cause the discord linux client is spotty to me
06:17:00skrylar[m]technically yall are all bridged to said irc :p
06:17:14FromDiscord_<Elegant Beef> And is no one going to comment that they're using comic sans as their keyboard font?
06:17:16FromDiscord_<Technicae Circuit> Never tried video or audio do i never needed to
06:17:24FromDiscord_<Technicae Circuit> I am
06:17:31FromDiscord_<Technicae Circuit> So
06:17:32FromDiscord_<Rika> oh what the fuck
06:17:39FromDiscord_<Technicae Circuit> :p
06:18:11skrylar[m]oh never used voice/audio in matrix. just read over the text stuff a few times. and frowned that the primary server was some python heavyweight. but there's a c one that is getting more mature so its pretty efficient now
06:18:37FromDiscord_<Technicae Circuit> O
06:18:40FromDiscord_<Technicae Circuit> Riot?
06:18:46FromDiscord_<Rika> rest in peace nim chat
06:18:50FromDiscord_<Rika> nothing nim related
06:18:54skrylar[m]if they added a topic field it would be a lot like zulip which is pretty nice
06:18:55FromDiscord_<Technicae Circuit> Oof
06:19:15FromDiscord_<Elegant Beef> Nah we're planning a new nim based chat client that's not garbage and intercepts the discord rich presence shit
06:19:16FromDiscord_<Elegant Beef> πŸ˜„
06:19:25FromDiscord_<Technicae Circuit> Cool
06:19:31skrylar[m]zulip is the only one where you can actually have multiple topics in a chat and it not all go to crap because you can have them all filed with their own topic tags ._.
06:21:04*martinium quit (Read error: Connection reset by peer)
06:21:10FromGitter<timotheecour> can someone please review and merge https://github.com/nim-lang/Nim/pull/14102 to un-break nim CI?
06:21:13disbotβž₯ fix nim CI; fix local testament ; snippet at 12https://play.nim-lang.org/#ix=2jiK
06:21:54FromDiscord_<Technicae Circuit> @gitterirc should do `.strip("<FromGitter>")`-
06:22:10narimiran@timotheecour can we fix that SSL cert?
06:22:10FromDiscord_<Rika> not possible, we dont own the bot afaik?
06:22:17FromDiscord_<Technicae Circuit> O
06:23:27narimiranalso, your un-breaking breaks SSL CI tests
06:23:38FromGitter<timotheecour> how so?
06:24:00FromGitter<timotheecour> these test failures seem unrelated as i noted PR
06:24:44*solitudesf joined #nim
06:24:52FromDiscord_<Technicae Circuit> Nim should add a gitlab and Codeberg repo mirror
06:26:04FromDiscord_<Rika> why?
06:26:17narimiranbtw, i've seen that you reported to `inim`, so i'd rather wait a bit to see if they can fix it on their side. because these "temporary fixes" usually last much longer than they should....
06:27:12FromGitter<timotheecour> > can we fix that SSL cert? ⏎ ⏎ @narimiran the test https://github.com/timotheecour/Nim/blob/pr_fix_ci_ssl/tests/stdlib/thttpclient_ssl.nim (as written) is expected to fail, and `alert number 48` should mean the same as `certificate verify failed` according to https://mta.openssl.org/pipermail/openssl-users/2017-December/007046.html
06:27:44narimirani'm waiting for federico3's input on that problem
06:28:35FromDiscord_<Technicae Circuit> > why?
06:28:36FromDiscord_<Technicae Circuit> So more people can see nim
06:29:44FromDiscord_<Rika> but it's already found on github so...? i'd understand if it was from gitlab to github mirror but
06:31:04FromGitter<timotheecour> we should keep nim CI green, at all times, having it broken affects every single PR that rebases against devel; there’s already an open ticket for inim and important_packages should not break because of bugs unrelated to nim compiler; @0atman has been prompt to fix inim issues in the past anyways. I don’t see a reason to wait for inim.
06:32:44FromDiscord_<Elegant Beef> also i just learned that on/off are aliased to true/false
06:32:48FromDiscord_<Elegant Beef> That's comically fantastic
06:32:59FromDiscord_<Rika> haha, thats for switches in nimscript i think
06:33:07FromDiscord_<Elegant Beef> ah
06:36:45narimiranyou didn't understand my point....
06:36:59*PMunch joined #nim
06:42:36FromDiscord_<Technicae Circuit> Nim is OP
06:42:44FromDiscord_<Technicae Circuit> I just made a python module in Nim so simply
06:43:43FromDiscord_<Rika> it gets harder the more complex the module
06:44:12FromDiscord_<Technicae Circuit> True
06:44:14FromDiscord_<Technicae Circuit> But eh
06:45:27PMunchRika, harder to integrate with Python, or harder to use Nims more powerful features?
06:45:48FromDiscord_<Technicae Circuit> What's the best way to make a discord bot in Nim?
06:46:01FromDiscord_<Technicae Circuit> > <PMunch> Rika, harder to integrate with Python, or harder to use Nims more powerful features?
06:46:01FromDiscord_<Technicae Circuit> Probably both imo
06:46:33PMunchI mean sure, Nims macros can be a bit daunting at first. But once you get into it it's not that hard
06:46:46PMunchHaven't tried integrating it with Python though
06:47:19PMunchTechnicae Circuit, I'd say this would be a good starting point: https://github.com/Krognol/discordnim
06:48:28FromDiscord_<Technicae Circuit> Okay then, thanks!
06:48:51PMunchHow did PR thursday go Araq? Last I checked it was 114 PRs, now it's up to 123..
06:51:00PMunchBy the way, if you're looking for a package: https://nimble.directory/search?query=discord
06:53:42FromGitter<nhanb> Guys, how do I send a streaming response using asynchttpserver? I'm basically writing an http proxy that streams from google drive to the end-user's browser. The "downloading from google drive" part I could do by reading chunks from httpclient's AsyncResponse.bodyStream, but I could not find anything from asynchttpserver that would let me write chunks to the requesting client?
06:54:15FromDiscord_<Technicae Circuit> I got this error https://hastebin.com/gododekiba.coffeescript
06:54:27FromDiscord_<Technicae Circuit> While using discordnim
06:56:12PMunchAha, you have a bad version of zlib
06:56:19PMunchOr rather a different one than expected
06:56:49FromDiscord_<Technicae Circuit> Which version do i need?
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:43FromDiscord_<flywind> what do you need? streaming response or chunk response?@nhanb
07:01:01FromDiscord_<flywind> stream response https://github.com/dom96/jester/blob/d8a03aa4c681bc8514bb7bbf4953d380d86f5bd6/jester.nim#L200
07:01:16FromDiscord_<flywind> chuncks response https://github.com/iocrate/netkit/blob/master/netkit/http/chunk.nim
07:02:20FromDiscord_<flywind> chunks response https://github.com/iocrate/netkit/blob/master/netkit/http/chunk.nim
07:02:46PMunchTechnicae Circuit, TBH I'm not sure..
07:03:53PMunchIt might be this thing that you've run into: https://github.com/nim-lang/zip/issues/39
07:03:55disbotβž₯ ZlibStreamError due to size mismatch of data types (Linux) ; snippet at 12https://play.nim-lang.org/#ix=2iJQ
07:04:53*gmpreussner joined #nim
07:05:02FromDiscord_<Technicae Circuit> Thanks
07:08:08FromGitter<nhanb> Thanks flywin, streaming response is what I need. I'll check out how jester does it via the stdlib then
07:08:31FromDiscord_<flywind> no problem.
07:10:49FromDiscord_<Technicae Circuit> I don't know what I can do because Zlib is broken
07:13:12PMunchHmm, well you can go into .nimble/pkgs/zip-0.2.1/zip/zlib.nim and change Ulong on line 14 to be uint instead of uint32
07:13:21PMunchThat seems to be what I've done
07:19:06FromDiscord_<Technicae Circuit> Okay then
07:23:25FromDiscord_<Technicae Circuit> https://hastebin.com/ekoresojew.coffeescript
07:23:34FromDiscord_<Technicae Circuit> I'm now getting this error
07:25:15PMunch"Exception message: key not found: .user.username"
07:25:19PMunchWell, do you have that key?
07:25:37FromDiscord_<Technicae Circuit> What do you mean
07:25:55FromDiscord_<Technicae Circuit> I don't even understand the error
07:26:18FromDiscord_<Technicae Circuit> I'm just using the example
07:26:22PMunchIt tries to access the field .user.username in a JSON object, but it isn't there, so it fails
07:26:26FromDiscord_<Technicae Circuit> Hm
07:26:42FromDiscord_<Technicae Circuit> I have no idea ;-;
07:27:14PMunchWild guess, you haven't set the "token" environment variable it tries to use to connect to Discord
07:27:36PMunchSo instead of valid messages you get an authentication error JSON response instead
07:28:06FromDiscord_<Technicae Circuit> I thought that i just put my token in the code
07:28:21PMunchOh, you could do that as well
07:28:38FromDiscord_<Technicae Circuit> I've messed with the api myself so this should be right
07:28:50FromDiscord_<Technicae Circuit> ```nim
07:28:51FromDiscord_<Technicae Circuit> import asyncdispatch, discordnim
07:28:51FromDiscord_<Technicae Circuit>
07:28:51FromDiscord_<Technicae Circuit> proc messageCreate(s: Shard, m: MessageCreate) =
07:28:51FromDiscord_<Technicae Circuit> if s.cache.me.id == m.author.id: return
07:28:51FromDiscord_<Technicae Circuit> if m.content == "ping":
07:28:54FromDiscord_<Technicae Circuit> asyncCheck s.channelMessageSend(m.channel_id, "pong")
07:28:55FromDiscord_<Technicae Circuit>
07:28:57FromDiscord_<Technicae Circuit> let d = newShard("Bot My token")
07:28:57PMunchUgh..
07:28:58FromDiscord_<Technicae Circuit>
07:29:00FromDiscord_<Technicae Circuit> proc endSession() {.noconv.} =
07:29:01FromDiscord_<Technicae Circuit> waitFor d.disconnect()
07:29:02FromDiscord_<Technicae Circuit>
07:29:04FromDiscord_<Technicae Circuit> setControlCHook(endSession)
07:29:06FromDiscord_<Technicae Circuit> d.compress = true
07:29:07FromDiscord_<Technicae Circuit>
07:29:09FromDiscord_<Technicae Circuit> let removeProc = d.addHandler(EventType.message_create, messageCreate)
07:29:09PMunchPlease don't paste code into Discord..
07:29:11FromDiscord_<Technicae Circuit> waitFor d.startSession()
07:29:12FromDiscord_<Technicae Circuit>
07:29:13FromDiscord_<Technicae Circuit> removeProc()```
07:29:20PMunchIt comes through on IRC and looks horrible..
07:29:34FromDiscord_<Elegant Beef> *quick silent stab at irc*
07:29:40PMunchhttps://irclogs.nim-lang.org/24-04-2020.html#07:28:38
07:29:42FromDiscord_<Technicae Circuit> Oh sorry
07:29:46FromDiscord_<Technicae Circuit> I completely forgot
07:30:16FromDiscord_<Technicae Circuit> https://hastebin.com/mudawitezu.cs
07:30:18FromDiscord_<Technicae Circuit> There
07:30:31PMunchNothing wrong with IRC, the Discord bot is the issue..
07:30:58PMunchYeah, so it's the basic_bot example
07:31:36*Hideki_ joined #nim
07:32:26*Hideki_ quit (Remote host closed the connection)
07:32:52FromDiscord_<Technicae Circuit> Mhm
07:33:13PMunchThis seems to be where the issue comes from: https://github.com/Krognol/discordnim/blob/master/src/ctors.nim#L139
07:34:15PMunchCalled from here: https://github.com/Krognol/discordnim/blob/master/src/discord.nim#L252
07:34:59FromDiscord_<Technicae Circuit> Damn
07:35:02PMunchI'm guessing that maybe the Discord API changed..
07:35:07FromDiscord_<Technicae Circuit> Probably
07:35:10FromDiscord_<Technicae Circuit> Because intents
07:35:17FromDiscord_<Technicae Circuit> And https://blog.discordapp.com/the-future-of-bots-on-discord-4e6e050ab52e
07:38:36FromDiscord_<Technicae Circuit> I think I might have to write my own library
07:38:38PMunchhttps://github.com/Krognol/discordnim/issues/27
07:38:40disbotβž₯ Exception: key not found: username ; snippet at 12https://play.nim-lang.org/#ix=2jj0
07:39:20FromDiscord_<Technicae Circuit> Hm
07:39:25PMunchSo maybe check out the develop branch
07:39:28FromDiscord_<Technicae Circuit> Okay then
07:39:34FromDiscord_<Technicae Circuit> That's 16 months old
07:39:40PMunch(With nimble you can do that with #develop)
07:40:24FromDiscord_<Technicae Circuit> I might try a c++ library in Nimble if possible
07:42:14*MarderIII joined #nim
07:42:14FromDiscord_<Technicae Circuit> I might try https://github.com/nim-lang/c2nim but i know little to none nim
07:44:56*letto quit (Quit: Konversation terminated!)
07:45:17FromDiscord_<Technicae Circuit> Would https://github.com/yourWaifu/sleepy-discord be a good library to try c2nim on?
07:45:49Araqwhen you try c2nim PLEASE understand its workflow
07:45:50PMunchDunno
07:46:05Araqyes, c2nim cannot parse Y.
07:46:28Araqno, you don't have to abandon it because of that, you're suppose to tweak the header file(s)
07:46:47*letto joined #nim
07:47:06Araqyou tweak the header files and use enough options of c2nim so that you don't have to edit the produced Nim code
07:47:24PMunchDoes nimterop work on C++?
07:47:34Araqand then you keep C header diff and reapply the patch for newer versions of the header file
07:47:54AraqPMunch, afaik no, it doesn't
07:48:54PMunchUgh, why are some things that feel so natural to us so hard to formally describe..
07:49:07Araqwhat do you mean?
07:49:14PMunchI'm back to fiddling with my no-overlap window manager
07:49:48Araqah, these things are nice. a Window manager that actually manages your windows
07:49:54PMunchYes
07:50:32PMunchSo it essentially tries to ensure that your windows don't overlap by repositioning them, or if need be scale them as little as possible
07:51:04FromDiscord_<Technicae Circuit> > <Araq> yes, c2nim cannot parse Y.
07:51:04FromDiscord_<Technicae Circuit> Okay
07:53:25FromDiscord_<Technicae Circuit> I can't figure out c2nim
07:53:42Araqargh...
07:53:44*Araq dies
07:54:17PMunchHaha, you tried Araq
07:56:48FromDiscord_<Technicae Circuit> Haha
07:57:04FromDiscord_<Technicae Circuit> Sorry πŸ˜…
07:57:58FromDiscord_<Technicae Circuit> I don't know whether i should attempt to make my own discord lib in Nim or whether i should keep trying c2nim on sleepy_discord
07:59:03PMunchI mean, getting the parts you need should be easy
08:00:03FromDiscord_<Technicae Circuit> Welp, looks like I have to directly interact with the discord API
08:00:17FromDiscord_<Technicae Circuit> And now I'ma also bombard everyone here with a bunch of questions
08:01:05FromDiscord_<Technicae Circuit> So, what's a good library i should use for making post, get, pull and delete requests?
08:01:56PMunchhttpclient in the stdlib should serve you well
08:02:04PMunchhttps://nim-lang.org/docs/httpclient.html
08:02:11FromDiscord_<Technicae Circuit> Thanks
08:02:33*liblq-dev joined #nim
08:03:01FromDiscord_<Technicae Circuit> So, how do i use an async proc?
08:04:26PMunchasyncdispatch
08:05:41FromDiscord_<Technicae Circuit> Thanks
08:05:51FromDiscord_<Technicae Circuit> I think i might just use a python lib with nimpy
08:07:17PMunchWell that's no fun!
08:11:35*letto quit (Quit: Konversation terminated!)
08:13:28*letto joined #nim
08:19:52*hax-scramper quit (Read error: Connection reset by peer)
08:20:08*hax-scramper joined #nim
08:26:34*hax-scramper quit (Ping timeout: 240 seconds)
08:26:39*dddddd joined #nim
08:26:44*hax-scramper joined #nim
08:39:19FromDiscord_<Technicae Circuit> I don't know nearly enough Nim to do this ;-;
08:39:28FromDiscord_<Technicae Circuit> I might try anyway
08:42:27*hax-scramper quit (Ping timeout: 258 seconds)
08:43:04*hax-scramper joined #nim
08:44:54*Faulander quit (Read error: Connection reset by peer)
08:45:12*Faulander joined #nim
08:48:02PMunchThat's just an opportunity to learn :)
08:48:03FromDiscord_<Technicae Circuit> I'm going to try it anyway
08:48:07FromDiscord_<Technicae Circuit> :p
08:48:30FromDiscord_<Technicae Circuit> So, how do i make a package?
08:48:42*couven92 joined #nim
08:49:23PMunchnimble init
08:49:27FromDiscord_<Technicae Circuit> Oki
08:49:55FromDiscord_<Technicae Circuit> I'ma call it `nimcord`
08:52:25FromDiscord_<Technicae Circuit> Should i use `C`, `C++`, or `ObjC`?
08:52:45liblq-devC
08:53:12FromDiscord_<Technicae Circuit> Thanks, can i ask for the reason why?
08:53:25FromDiscord_<Recruit_main707> cuz *speed*
08:53:31FromDiscord_<Technicae Circuit> Haha okay
08:53:38PMunchIt's the default
08:53:48FromDiscord_<Technicae Circuit> What's the most standard Nim version?
08:53:50PMunchBasically don't use the others unless you have a particular reason
08:53:55PMunchThe most standard?
08:53:58FromDiscord_<Technicae Circuit> Mhm
08:54:03FromDiscord_<Technicae Circuit> As in the most common
08:54:05PMunchLatest stable 1.2.0 should be good
08:54:08FromDiscord_<Technicae Circuit> Oki
08:54:31PMunchI'm not sure if choosenim does statistics
08:54:44FromDiscord_<Technicae Circuit> :p
08:55:36dom96it does actually
08:57:16PMunchAre they published anywhere?
08:59:07*NimBot joined #nim
08:59:11dom96nope
08:59:23dom96and they're probably not 100% accurate anyway
08:59:32PMunchOf course not
08:59:38PMunchBut it would be interesting to see
08:59:48PMunchE.g. how fast people move onto a new version
09:00:06*xcm quit (Remote host closed the connection)
09:02:33*xcm joined #nim
09:08:08*MarderIII quit (Quit: Leaving)
09:11:50FromDiscord_<Technicae Circuit> How do i make it so I can do `nimble build` to install my lib?
09:12:18FromDiscord_<Recruit_main707> with a .nimble file iirc
09:12:43*Vladar joined #nim
09:13:06FromDiscord_<Technicae Circuit> I have the nimble file but it'd saying nothing to build
09:16:17FromDiscord_<Technicae Circuit> It's*
09:18:13*hax-scramper quit (Ping timeout: 264 seconds)
09:18:40*hax-scramper joined #nim
09:21:29*hax-scramper quit (Read error: Connection reset by peer)
09:21:31PMunch`nimble build` is to build packages that provides tools
09:21:35PMunchSo they make a binary
09:21:42PMunchWhat you want is `nimble install`
09:21:44*hax-scramper joined #nim
09:21:54PMunch@Technicae Circuit ^
09:22:04FromDiscord_<Recruit_main707> @Technicae Circuit ^
09:24:08FromDiscord_<clyybber> @Technicae Circuit Is this your library? https://github.com/krisppurg/dimscord/blob/master/README.md
09:25:01PMunchclyybber, I highly doubt it, he literally just started :P
09:26:52FromDiscord_<clyybber> Oh, well. This just got submitted to the pkglist
09:27:13FromDiscord_<clyybber> Might wonna use that instead of making another one yourself
09:28:22PMunchYeah I was about to say
09:29:15FromDiscord_<clyybber> @Yardanico
09:29:50FromDiscord_<clyybber> Maybe this could be used for the bridge
09:48:19*waleee-cl joined #nim
09:55:29FromDiscord_<Technicae Circuit> > <PMunch> What you want is `nimble install`
09:55:29FromDiscord_<Technicae Circuit> Oh okay, thanks
09:55:45PMunchNo problem :)
09:56:00FromDiscord_<Technicae Circuit> > Oh, well. This just got submitted to the pkglist
09:56:00FromDiscord_<Technicae Circuit> Oh cool, thanks, I'll probably make my own lib once i get more experience
09:57:30PMunchIf you want a project we sorely need a better Discord bot for this channel
09:57:45PMunchOne that create paste links instead of directly forwarding code..
09:59:55FromDiscord_<Technicae Circuit> That would be kinda hard πŸ˜…, I'd need to find an API similar to hastebin (hastebin doesn't have an API afaik), and i barely know Nim ;-;
10:00:38PMunchix.io is your friend :)
10:00:55PMunchYou can have a look at how the Nim playground does it, super simple
10:01:46PMunchhttps://github.com/PMunch/nim-playground/blob/master/src/nim_playground.nim#L111-L115
10:02:13PMunchAnd the point was to have a project to do in Nim to learn the language :)
10:03:58FromDiscord_<Technicae Circuit> Oo cool
10:06:04FromDiscord_<Technicae Circuit> Now i need to figure out a command handler ;-;
10:06:16PMunchCommand handler?
10:06:18FromDiscord_<Technicae Circuit> Does Nim allow you to import local files
10:06:25FromDiscord_<Technicae Circuit> Yeah for the discord lib
10:06:40PMunchThe question to "Does Nim allow you to" is pretty much always "yes" :P
10:06:48FromDiscord_<Technicae Circuit> Haha
10:07:02FromDiscord_<Technicae Circuit> How do i do it? `import ./file/path`?
10:07:19PMunchJust "import file/path" works fine
10:07:56*natrys joined #nim
10:12:36FromDiscord_<Technicae Circuit> Thanks!
10:12:40FromDiscord_<Technicae Circuit> https://github.com/Oples/nanorc-nim/blob/master/nim.nanorc
10:12:43FromDiscord_<Technicae Circuit> I am saved!
10:15:58*hax-scramper quit (Ping timeout: 265 seconds)
10:16:15*hax-scramper joined #nim
10:16:54*sunwukong joined #nim
10:17:06FromDiscord_<Technicae Circuit> Does importing a module make the variables declared available aswell?
10:17:34FromDiscord_<Technicae Circuit> I am planning on writing a command handler like thr discord.js command handler in the docs
10:17:42*couven92 quit (Remote host closed the connection)
10:18:03skrylar[m]they would have to be exported with *
10:18:10*couven92 joined #nim
10:18:41FromDiscord_<Technicae Circuit> So like `const *name ...`?
10:19:54FromDiscord_<Recruit_main707> after the name
10:22:18FromDiscord_<Technicae Circuit> Oki
10:22:24FromDiscord_<Technicae Circuit> Also, how do i make arrays?
10:22:44FromDiscord_<Recruit_main707> var array = [1, 2, 3, 4]
10:23:00FromDiscord_<Technicae Circuit> Thanks
10:23:13FromDiscord_<Recruit_main707> or var array: array[4, int] = [1, 2, 3, 4]
10:25:26FromDiscord_<Technicae Circuit> So the structure would be like ```nim
10:25:26FromDiscord_<Technicae Circuit> const
10:25:26FromDiscord_<Technicae Circuit> name*:string = "Name"
10:25:26FromDiscord_<Technicae Circuit> aliases*:array[amount_of_aliases] = [aliases]
10:25:27FromDiscord_<Technicae Circuit>
10:25:27FromDiscord_<Technicae Circuit> proc code(msg:idk_about_this_yet, args:array) =
10:25:29FromDiscord_<Technicae Circuit> # Stuff```
10:25:42FromDiscord_<Technicae Circuit> Would that work?
10:25:50FromDiscord_<Technicae Circuit> So the structure would be like ```nim
10:25:50FromDiscord_<Technicae Circuit> const
10:25:50FromDiscord_<Technicae Circuit> name*:string = "Name"
10:25:50FromDiscord_<Technicae Circuit> aliases*:array[amount_of_aliases] = [aliases]
10:25:50FromDiscord_<Technicae Circuit>
10:25:51FromDiscord_<Technicae Circuit> proc code(msg:idk_about_this_yet, args:array)* =
10:25:52FromDiscord_<Technicae Circuit> # Stuff```
10:26:05FromDiscord_<Technicae Circuit> Annd i forgot about editing...
10:26:18FromDiscord_<Technicae Circuit> And i forgot about irc
10:26:28FromDiscord_<Technicae Circuit> πŸ˜…
10:26:49FromDiscord_<Recruit_main707> nope, there are a few things wrong
10:28:05FromDiscord_<Technicae Circuit> https://paste.pythondiscord.com/veroziwelu.py
10:28:24FromDiscord_<Technicae Circuit> Does the `*` need to be after the type aswell?
10:29:17FromDiscord_<Recruit_main707> https://play.nim-lang.org/#ix=2jjU
10:29:27FromDiscord_<Recruit_main707> thats how it should be done
10:30:27FromDiscord_<Recruit_main707> `["alias1", "alias2"] # etc` this would need to reach the size of your array
10:31:20FromDiscord_<Recruit_main707> also, `const` means those variables are only available at compile time, have it in mind
10:35:38FromDiscord_<Technicae Circuit> Oh okay
10:35:42FromDiscord_<Technicae Circuit> Thanks
10:36:57solitudesfno, const means that value is known at compile time
10:37:00FromDiscord_<Technicae Circuit> Thanks
10:37:40*natrys quit (Quit: natrys)
10:38:08FromDiscord_<Technicae Circuit> I want to make sure `args` is an array but i don't know how long it'll be
10:38:22FromDiscord_<Recruit_main707> then use seq[string]
10:38:38FromDiscord_<Recruit_main707> they are basically python lists (if you come from python)
10:39:00FromDiscord_<Technicae Circuit> Cool
10:39:05FromDiscord_<Technicae Circuit> I do come from Python :p
10:39:40FromDiscord_<Technicae Circuit> ```let
10:39:40FromDiscord_<Technicae Circuit> number_of_aliases = 3
10:39:40FromDiscord_<Technicae Circuit> name*:string = "Name"
10:39:40FromDiscord_<Technicae Circuit> aliases*:array[number_of_aliases, string] = ["alias1", "alias2"] # etc
10:39:40FromDiscord_<Technicae Circuit> #[This part is optional ]#
10:39:41FromDiscord_<Technicae Circuit>
10:39:43FromDiscord_<Technicae Circuit> proc code*(msg:idk_about_this_yet, args:seq[string]) =
10:39:44FromDiscord_<Technicae Circuit> #code```
10:39:46FromDiscord_<Technicae Circuit> ```nim
10:39:48FromDiscord_<Technicae Circuit> let
10:39:49FromDiscord_<Technicae Circuit> number_of_aliases = 3
10:39:51FromDiscord_<Technicae Circuit> name*:string = "Name"
10:39:53FromDiscord_<Technicae Circuit> aliases*:array[number_of_aliases, string] = ["alias1", "alias2"] # etc
10:39:55FromDiscord_<Technicae Circuit> #[This part is optional ]#
10:39:56FromDiscord_<Technicae Circuit>
10:39:58FromDiscord_<Technicae Circuit> proc code*(msg:idk_about_this_yet, args:seq[string]) =
10:39:59FromDiscord_<Technicae Circuit> #code```
10:40:01FromDiscord_<Technicae Circuit> Should be alright now
10:40:05FromDiscord_<Recruit_main707> use this web for pasting code: https://play.nim-lang.org/
10:40:08PMunchPleeease stop pasting..
10:40:11FromDiscord_<Technicae Circuit> Oh sorry
10:40:18FromGitter<sheerluck> Technicae Circuit god damn
10:40:19FromDiscord_<Technicae Circuit> I keep forgetting ;-;
10:40:45FromDiscord_<Recruit_main707> and when you edit messages they are sent again iirc, so try not to either
10:41:19PMunchAnd hurry up with creating the new Discord bot! :P
10:41:25PMunchs/bot/bridge
10:41:29FromDiscord_<Technicae Circuit> :p
10:41:39FromDiscord_<Technicae Circuit> I don't even know how to use irc
10:41:44FromDiscord_<Technicae Circuit> https://play.nim-lang.org/#ix=2jk1
10:41:46FromDiscord_<Technicae Circuit> There
10:41:52FromDiscord_<Technicae Circuit> Would that code be valid?
10:42:04FromDiscord_<Technicae Circuit> (also does irc have a feature for editing messages?)
10:42:18PMunchNope
10:42:35PMunchIt's very basic text chat
10:42:39FromDiscord_<Technicae Circuit> Damn
10:42:50FromDiscord_<Recruit_main707> PlaygroundCode on GitHub
10:42:50FromDiscord_<Recruit_main707> Font size:
10:42:50FromDiscord_<Recruit_main707> 13
10:42:50FromDiscord_<Recruit_main707> Compilation target: Nim version:
10:42:51FromDiscord_<Recruit_main707> 1
10:42:51FromDiscord_<Recruit_main707> let
10:42:51FromDiscord_<Recruit_main707> 2
10:42:53FromDiscord_<Recruit_main707> number_of_aliases = 2 # You dont need this
10:42:54FromDiscord_<Recruit_main707> 3
10:42:56FromDiscord_<Recruit_main707> name*:string = "Name"
10:42:57FromDiscord_<Recruit_main707> 4
10:42:59FromDiscord_<Recruit_main707> aliases*:seq[string] = @["alias1", "alias2"] # @ means its a seq instead of an array
10:43:01FromDiscord_<Recruit_main707> 5
10:43:02PMunchRecruit_main707...
10:43:02FromDiscord_<Recruit_main707>
10:43:03FromDiscord_<Recruit_main707> 6
10:43:05FromDiscord_<Recruit_main707> proc code*(msg, args:seq[string]) =
10:43:06FromDiscord_<Recruit_main707> 7
10:43:08FromDiscord_<Recruit_main707> #code
10:43:09FromDiscord_<Recruit_main707> 8
10:43:10FromDiscord_<Recruit_main707> ​
10:43:12FromDiscord_<Recruit_main707> Share to ixShowing: outputRun!(ctrl-enter)
10:43:14FromDiscord_<Recruit_main707> https://play.nim-lang.org/#ix=2jk3
10:43:15FromDiscord_<Recruit_main707> oh shit
10:43:17FromDiscord_<Technicae Circuit> hahaha
10:43:34*hax-scramper quit (Ping timeout: 240 seconds)
10:43:43FromDiscord_<Technicae Circuit> Also, why not use webhooks on discord, so the user name would be the irc username
10:43:44PMunchDid you just dit Ctrl+A Ctrl+C? :P
10:43:50PMunchGot line numbers and everything :P
10:44:02FromDiscord_<Technicae Circuit> And if irc has webhooks do the same for irc :p
10:44:06skrylar[m]someone did a bad job
10:44:10PMunchMost people just use the old skool star fix
10:44:12PMunchschool*
10:44:16FromDiscord_<Recruit_main707> i selected with mouse, and it went a bit too high :p im so sorry
10:44:17PMunchLike that ^
10:44:35*hax-scramper joined #nim
10:44:41PMunchOr like I do with substitution syntax
10:44:48PMunchLike I did earlier with s/bot/bridge
10:44:50FromDiscord_<Technicae Circuit> What language is the bot written in right now?
10:45:07PMunch@FromDiscord_, help
10:45:14PMunch@FromDiscord_, version
10:45:17PMunchHmm
10:45:19PMunchNo idea
10:45:21FromDiscord_<Technicae Circuit> Wut
10:45:24PMunchThink it's an off the shelf one
10:45:35FromDiscord_<Technicae Circuit> @gitterirc
10:45:39FromDiscord_<Technicae Circuit> @gitterirc help
10:45:51PMunchI know disbot has some commands like that
10:45:56PMunch!help
10:46:00PMunchHmm
10:46:07PMunch!eval echo 3+4
10:46:08FromDiscord_<Technicae Circuit> Would you mind if i first rewrite the bot in Python, then rewrite it in Nim later?
10:46:09NimBot7
10:46:27FromDiscord_<Technicae Circuit> !eval echo "Test"
10:46:30NimBotTest
10:46:31FromDiscord_<Technicae Circuit> Oof
10:46:34FromDiscord_<Technicae Circuit> Oh cool
10:46:35PMunchAs long as we don't get code pastes on IRC you can rewrite it in assembler for all I care..
10:46:42FromDiscord_<Technicae Circuit> Haha
10:46:52FromDiscord_<Technicae Circuit> Does irc not support newlines either?
10:46:56PMunchHuh, disbot PMs you the reply
10:47:16PMunchDon't think so
10:47:36PMunchWe do have colours and italics/bold etc.
10:48:01FromDiscord_<Technicae Circuit> Damn
10:48:07PMunchYou can try IRC here if you like: https://webchat.freenode.net/
10:48:28FromDiscord_<Technicae Circuit> I've tried it before but I can't login again πŸ˜…
10:48:47*PMunch_web joined #nim
10:48:50PMunch_webYou don't need a password
10:49:03FromDiscord_<Technicae Circuit> Don't most channels need a password?
10:49:05PMunch_webJust choose a nick no one else uses and goahead
10:49:13PMunch_webSome do, but not all
10:49:20PMunch_webThis one for example doesn't
10:49:58*PMunch_web quit (Remote host closed the connection)
10:50:01*Technicae_Circui joined #nim
10:50:07PMunchHi Technicae_Circui
10:50:12Technicae_CircuiAnd my nim was cut off-
10:50:15Technicae_CircuiHeya
10:50:21Technicae_CircuiSup?
10:50:29PMunchHaha
10:50:38PMunchSo as I said it's only text
10:50:51Technicae_CircuiWhat do you mean?
10:50:58PMunchAnd italics bold and underline
10:51:04Technicae_CircuiOh okay
10:51:11PMunchA12lo02ng04 w06it08h 10co12lo02ur04s!
10:51:12Technicae_CircuiTest\ncool
10:51:15Technicae_CircuiOof
10:51:19Technicae_CircuiOo colours
10:51:23PMunchHaha
10:51:24Technicae_CircuiVery nice
10:51:35PMunchMostly used for bots to highlight messages and such
10:51:43PMunch!issue 42
10:51:45disbothttps://github.com/nim-lang/Nim/issues/42 -- 5illegal recursion in type 'TThread' 7& 29 more...
10:51:48PMunchLike that
10:51:58Technicae_CircuiOh cool
10:52:34Technicae_CircuiApparently new lines can be simulated by just splitting the message and sending those parts in quick succession
10:53:09PMunchYes, that's what happens when you paste code in here
10:53:18Technicae_CircuiOh okay, is it that bad?
10:53:38*Romanson joined #nim
10:53:40PMunchYou tell me: https://irclogs.nim-lang.org/24-04-2020.html#10:38:08
10:53:41Technicae_CircuiSomeone from discord please send a multline message
10:53:45Technicae_CircuiO
10:54:05Technicae_CircuiI can't see it ;-;
10:54:15PMunchWhat do you mean you can't see it?
10:54:26FromDiscord_<Recruit_main707> should i?
10:54:26*Technicae_Circui quit (Remote host closed the connection)
10:54:41PMunchNot now.. He quit the online IRC chat..
10:54:46FromDiscord_<Technicae Circuit> And my IRC session just got screwed while opening the link
10:54:51FromDiscord_<Technicae Circuit> :p
10:54:53*xcm quit (Remote host closed the connection)
10:54:56PMunchHaha
10:55:08FromDiscord_<Technicae Circuit> Oh damn
10:55:11FromDiscord_<Technicae Circuit> That is bad
10:55:37FromDiscord_<Technicae Circuit> I feel sorry for people who use irc
10:56:24FromDiscord_<Technicae Circuit> I could just use a paste api that just puts all multiline messages into a text file
10:56:28*Hideki_ joined #nim
10:56:34*Guest90556 quit (Ping timeout: 265 seconds)
10:56:59FromDiscord_<Technicae Circuit> But does anyone else here know irc?
10:57:04*xcm joined #nim
10:57:15FromDiscord_<Technicae Circuit> I mean
10:57:27FromDiscord_<Technicae Circuit> Does anyone know how to make an irc bot in Python here?
10:57:44FromDiscord_<Technicae Circuit> I'm going to use Python until i learn more Nim
10:58:01FromGitter<sheerluck> I'm going to use Python too until i learn more Nim
10:58:08FromDiscord_<Technicae Circuit> Coolio
10:58:19FromDiscord_<Recruit_main707> learn-by-doing
10:58:42FromDiscord_<Technicae Circuit> Nim doesn't have a good discord lib yet
10:58:48FromDiscord_<Rika> Discordnim?
10:58:50FromDiscord_<Technicae Circuit> Plus I don't even know irc
10:58:55FromDiscord_<Technicae Circuit> That's broken af
10:59:03FromDiscord_<clyybber> it now has
10:59:13FromDiscord_<clyybber> dimscord
10:59:13FromDiscord_<Technicae Circuit> Discordsrm or something
10:59:20FromDiscord_<Technicae Circuit> Yeah
10:59:32FromDiscord_<Technicae Circuit> I don't know about irc though
10:59:33FromDiscord_<clyybber> well, in a few minutes, ones the CI passes πŸ˜„
10:59:34FromDiscord_<Rika> Who made it
10:59:42FromDiscord_<Technicae Circuit> I'm not sure
10:59:48FromDiscord_<clyybber> https://github.com/krisppurg/dimscord
11:00:10FromDiscord_<Rika> Ya sure this one works better?
11:00:32FromDiscord_<clyybber> didn't try it
11:00:50FromDiscord_<Technicae Circuit> It works atleast
11:00:53FromDiscord_<Technicae Circuit> I think
11:00:58FromDiscord_<clyybber> its also maintained
11:01:02FromDiscord_<Rika> @Technicae Circuit Yardanico is already working on a new bridge
11:01:07FromDiscord_<clyybber> and theres plan for voice support
11:01:15PMunchVoice support?
11:01:23FromDiscord_<Recruit_main707> hold up, voice support?
11:01:28FromDiscord_<Recruit_main707> for a discord bot?
11:01:42FromDiscord_<clyybber> yeag
11:01:48FromDiscord_<Rika> Many libraries have voice support
11:01:48FromDiscord_<clyybber> *h
11:01:56FromDiscord_<Recruit_main707> how is that though?
11:02:00FromDiscord_<Rika> Hm I'll switch my bot to this I guess
11:02:10*Trustable joined #nim
11:02:41FromDiscord_<Rika> Never mind, I'm skeptical
11:02:59FromDiscord_<clyybber> lol
11:03:45FromDiscord_<clyybber> can't hurt trying
11:04:08FromDiscord_<Rika> ??? Everything is a ref object
11:04:09FromDiscord_<Rika> Why?
11:04:14FromDiscord_<Technicae Circuit> It's not working
11:04:30FromDiscord_<Technicae Circuit> > @Technicae Circuit Yardanico is already working on a new bridge
11:04:30FromDiscord_<Technicae Circuit> Oh okay rhen
11:04:33FromDiscord_<Rika> What the heck
11:04:43FromDiscord_<Technicae Circuit> /data/data/com.termux/files/home/.nimble/pkgs/dimscord-0.0.9/dimscord.nim(1, 11) Error: cannot open file: lib/gateway
11:04:56FromDiscord_<Technicae Circuit> I'm really tempted to write my own library
11:05:06dom96voice support would be cool
11:05:10FromDiscord_<Rika> Good luck with that
11:05:15FromDiscord_<Technicae Circuit> :p
11:05:32dom96@Technicae Circuit: do it, sounds like a good learning experience :)
11:05:43FromDiscord_<Technicae Circuit> I've already messed with the discord API a bit ages ago
11:05:58FromDiscord_<Technicae Circuit> So it shouldn't be too hard, right? πŸ˜…
11:06:26FromDiscord_<clyybber> Not sure where that error comes from. Clearly there *is* a lib/gateway
11:06:27FromDiscord_<Rika> It's a lot of objects to encode
11:06:40FromDiscord_<Technicae Circuit> Welp
11:06:47FromDiscord_<Rika> There's a lib gateway nim not a lib gateway
11:07:08FromDiscord_<Technicae Circuit> I'm going to try and use https://nim-lang.org/docs/httpclient.html to send a message with Nim
11:08:05FromDiscord_<Technicae Circuit> ~~Why not make a channel where discord bots can be invited for testing purposes~~
11:08:21FromDiscord_<Technicae Circuit> ~~And only give bots access to that channel~~
11:08:27FromDiscord_<Rika> Perms aren't that granular in discord
11:08:32FromDiscord_<Technicae Circuit> Bad idea
11:08:34FromDiscord_<Technicae Circuit> Wdym?
11:08:46FromDiscord_<clyybber> @Rika > There's a lib gateway nim not a lib gateway
11:08:46FromDiscord_<clyybber> WDYM?
11:09:07FromDiscord_<Rika> @Clyybber error didn't state an extension
11:09:32FromDiscord_<Rika> @Technicae Circuit misunderstood
11:09:48FromDiscord_<clyybber> @Rika Thats normal
11:09:52FromDiscord_<Technicae Circuit> Oh
11:09:54FromDiscord_<clyybber> When the file doesn't exist
11:10:08FromDiscord_<clyybber> My guess is that the lib didn't get cloned/downloaded
11:10:12FromDiscord_<Technicae Circuit>
11:10:12FromDiscord_<Technicae Circuit> https://cdn.discordapp.com/attachments/371759389889003532/703201119169413120/Screenshot_20200424_121005_com.termux.jpg
11:10:21FromDiscord_<clyybber> yeah
11:10:22FromDiscord_<Technicae Circuit> I cloned it and used the devel branch
11:10:27FromDiscord_<Technicae Circuit> Then used nimble install
11:11:03FromDiscord_<clyybber> nimble doesn't copy it because its not specified in the .nimble file I think
11:11:18FromDiscord_<Technicae Circuit> Should i manually move the folder then?
11:11:25FromDiscord_<Technicae Circuit> Or would that break nimble?
11:11:26FromDiscord_<clyybber> yeah, for now
11:11:27FromDiscord_<clyybber> nope
11:11:29FromDiscord_<Technicae Circuit> Oki
11:11:30FromDiscord_<clyybber> it wouldn't
11:12:29FromDiscord_<Technicae Circuit> Invalid indentation now apparently
11:12:34FromDiscord_<Technicae Circuit> In their example
11:14:08FromDiscord_<Rika> Holy shit I really don't like the look of this library
11:14:24FromDiscord_<Rika> I'll stick to fixing discord nim I guess?
11:15:59FromDiscord_<clyybber> what "look"???
11:16:12dom96make sure to post issues on that libraries github
11:16:46FromDiscord_<clyybber> dom96: Is the solution to add lib to the srcdirs?
11:16:59FromDiscord_<Rika> @Clyybber the code
11:17:12FromDiscord_<Rika> Maybe I'll check what it does differently
11:17:22FromDiscord_<clyybber> I dunno, looks ok to me
11:17:30FromDiscord_<clyybber> And the ref objects seem to be ref on purpose
11:17:35FromDiscord_<clyybber> since some are not
11:17:44*dadada joined #nim
11:18:06*dadada is now known as Guest28090
11:18:10FromDiscord_<Rika> Seem
11:18:31FromDiscord_<Technicae Circuit> https://play.nim-lang.org/#ix=2jki
11:18:33dom96clyybber: doesn't sound right, but I'd have to look at the file structure
11:18:34*Hideki_ quit (Remote host closed the connection)
11:18:41FromDiscord_<Technicae Circuit> Doesn't work because of indentation apparently
11:19:00*Vladar quit (Quit: Leaving)
11:19:21*Hideki_ joined #nim
11:20:15FromDiscord_<Rika> Pass should be discard
11:20:27FromDiscord_<Technicae Circuit> Oh okay
11:21:25FromDiscord_<Technicae Circuit> Still invalid indentation
11:21:40*Hideki_ quit (Remote host closed the connection)
11:21:44PMunchBecause it's indented with 4 spaces..
11:21:55*Hideki_ joined #nim
11:22:16FromDiscord_<Technicae Circuit> That's the example :p
11:22:30FromDiscord_<Technicae Circuit> Does Nim only accept an indentation width of 2?
11:22:34PMunchTry this: https://play.nim-lang.org/#ix=2jkl
11:22:55PMunchWell 4 can work, but that's mostly by chance :P
11:23:20*Hideki_ quit (Remote host closed the connection)
11:23:56FromDiscord_<Technicae Circuit> Oh okay
11:23:59FromDiscord_<clyybber> huh?
11:24:09FromDiscord_<clyybber> nim doesn't care about how many spaces you indent with
11:24:15FromDiscord_<clyybber> as long as its correct
11:24:18*Hideki_ joined #nim
11:24:57FromDiscord_<Technicae Circuit> Still invalid
11:25:04PMunch"As long as it's correct", which is 2 spaces :P
11:25:09PMunchWhat line?
11:25:44FromDiscord_<clyybber> eh, 4 is correct too
11:25:50FromDiscord_<clyybber> X is correct
11:25:52*Hideki_ quit (Remote host closed the connection)
11:26:05*Hideki_ joined #nim
11:27:09FromDiscord_<clyybber> the lexer doesn't care about how many spaces you indent with
11:27:25FromDiscord_<clyybber> he only cares about: as many as in the line before, more, less
11:30:00FromDiscord_<Technicae Circuit> `<PMunch> What line?` line 19
11:32:25FromDiscord_<Technicae Circuit> I wish Nim had braces
11:32:39FromDiscord_<Technicae Circuit> Even though I come from Python, i prefer braces
11:32:49Faulanderthank god it doesn't.
11:33:03FromDiscord_<Recruit_main707> braces 🀒
11:33:05FromDiscord_<clyybber> braces are a longer curse
11:33:11FromDiscord_<Technicae Circuit> Haha
11:33:32FromDiscord_<Technicae Circuit> I like braces, idk why tho Β―\\_(ツ)\_/Β―
11:34:01Faulanderthen use rust, go, c, c++, java, js :)
11:34:02FromDiscord_<Recruit_main707> literally the first requierment for a new language for me was that it didnt use them :P 2 spaced tabs are so much more fitting for nim
11:34:33FromDiscord_<Recruit_main707> (i call them tabs, i know they are spaces)
11:34:38FromDiscord_<Technicae Circuit> O
11:34:42Faulandersame for me. it's one of the first selling points to me, if it has them or not. it's like a religious discussion. i kinda lika adas style though :)
11:34:51FromDiscord_<Technicae Circuit> Haha
11:35:10FromDiscord_<Technicae Circuit> I just think braces are nice
11:35:21FromDiscord_<clyybber> You can use braces in nim too btw
11:35:33FromDiscord_<clyybber> just put everything in `(` `)`
11:36:05Faulandercode without is so much more readable.
11:36:52FromDiscord_<Technicae Circuit> Wait
11:37:11FromDiscord_<Technicae Circuit> So `(` and `)` basically removes the need for indents?
11:37:19FromDiscord_<Technicae Circuit> Or do indents still need to be added?
11:37:51Faulanderwait ... you want to write code without indentation BUT with braces? Jesus, i hope the only person looking at that code is you ;)
11:38:41FromDiscord_<Technicae Circuit> I include indents even with braces
11:38:49FromDiscord_<Technicae Circuit> I just don't want the indents to matter
11:39:27*Hideki_ quit (Remote host closed the connection)
11:40:56FromDiscord_<clyybber> @Technicae Circuit No, you still cant write:
11:41:11FromDiscord_<clyybber> ```
11:41:11FromDiscord_<clyybber> (
11:41:12FromDiscord_<clyybber> this
11:41:12FromDiscord_<clyybber> is
11:41:12FromDiscord_<clyybber> stipud
11:41:12FromDiscord_<clyybber> )```
11:41:17FromDiscord_<Technicae Circuit> Yeah
11:41:30FromDiscord_<Technicae Circuit> It's a shame ;-;
11:41:33FromDiscord_<clyybber> think of it as a style check included with the compiler for your pleasure πŸ˜„
11:41:47FromDiscord_<clyybber> @Technicae Circuit why do you want to write such code....
11:41:53*Hideki_ joined #nim
11:42:33FromDiscord_<Technicae Circuit> Because indents can get annoying, and i blame one language ***cough cough*** ~~Python~~ ***cough cough***
11:42:54FromDiscord_<clyybber> you know whats more annoying
11:43:06FromDiscord_<clyybber> noone undestanding your code
11:43:18FromDiscord_<clyybber> and it looking like poop :p
11:43:32FromDiscord_<Technicae Circuit> True but I still include indents
11:43:44FromDiscord_<clyybber> then you shouldn't care ?
11:44:18*Hideki_ quit (Remote host closed the connection)
11:44:24FromDiscord_<clyybber> indentation based syntax makes it more convinient to code well styled code. And it also enforces you to code well styled code
11:44:33*Hideki_ joined #nim
11:44:34FromDiscord_<clyybber> Both are a plus in my book
11:44:49FromDiscord_<Technicae Circuit> I have issues with the fact that tabs and spaces can't be used at the same time, because i use spaces and all of my friends use tabs
11:44:56FromDiscord_<Technicae Circuit> And using tabs are bad practice
11:45:09FromDiscord_<clyybber> Its just an editor problem
11:45:22FromDiscord_<clyybber> Configure your editor to insert spaces instead of tabs.
11:45:25FromDiscord_<clyybber> Or make a git hook
11:45:28FromDiscord_<Recruit_main707> ^
11:45:35FromDiscord_<Technicae Circuit> What's a git hook?
11:45:55FromDiscord_<clyybber> Something that runs when git does something
11:46:01FromDiscord_<Technicae Circuit> O
11:46:02FromDiscord_<clyybber> like pre-commit, post-commit
11:46:20FromDiscord_<Technicae Circuit> So i can just turn all tabs to spaces
11:46:27FromDiscord_<clyybber> yeah
11:46:29FromDiscord_<Recruit_main707> yep
11:46:33FromDiscord_<Technicae Circuit> Coolio
11:46:44FromDiscord_<Technicae Circuit> ~~I still want braces~~
11:46:44FromDiscord_<clyybber> coders paradise
11:46:53FromDiscord_<Technicae Circuit> :p
11:47:19FromDiscord_<clyybber> if I want to write shitty code, I write perl : )
11:47:48FromDiscord_<sealegs> @Technicae Circuit install dimscord via git
11:48:05FromDiscord_<sealegs> I am currently aware of this issue and I'm trying my best to fix it
11:49:00*sunwukong quit (Quit: Leaving)
11:49:07FromDiscord_<Technicae Circuit> Haha
11:49:09FromDiscord_<Technicae Circuit> I did
11:49:19FromDiscord_<clyybber> @Technicae Circuit maybe this will cure you: https://github.com/belamenso/v
11:49:40FromDiscord_<Technicae Circuit> I did `git clone library_url` then nimble install
11:49:42FromDiscord_<Technicae Circuit> What's that
11:49:43FromDiscord_<clyybber> @Technicae Circuit Oh btw when you clone via git, you don't have to nimble install. You can nimble develop too
11:49:53FromDiscord_<clyybber> @Technicae Circuit It is cursed.
11:50:23FromDiscord_<Technicae Circuit> Omfg
11:50:30FromDiscord_<Technicae Circuit> ***This is amazing***
11:51:08FromDiscord_<clyybber> @Yardanico <- this fella here created an unholy abonimation fork of the above: https://github.com/Yardanico/nim-emojify/commit/dae1893a3e25d97f9c9078491b399c29f27e7184
11:51:49FromDiscord_<Technicae Circuit> Hahahaha
11:51:59FromDiscord_<sealegs> tech, I think what you need to do is first clone it, then once you got the dimscord folder make ur own folder then make a file in nim and import the library
11:51:59FromDiscord_<Technicae Circuit> I might actually troll my friends with this
11:52:14FromDiscord_<Technicae Circuit> Oh okay
11:52:19FromDiscord_<clyybber> @sealegs Might wonna ask dom96 about how to fix that issue
11:52:31FromDiscord_<clyybber> with lib not being copied/installed by nimble
11:53:11FromDiscord_<sealegs> okay
11:54:17*Vladar joined #nim
11:54:32*Hideki_ quit (Remote host closed the connection)
11:56:57*rockcavera joined #nim
11:57:11FromDiscord_<Technicae Circuit> Can we make a discord bot for this server?
11:57:13FromDiscord_<Technicae Circuit> In Nim
11:57:44FromDiscord_<Technicae Circuit> And then make it so commands are generated from files :p
11:57:48*Hideki_ joined #nim
11:58:56FromDiscord_<sealegs> Just like @gitterirc?
11:59:00FromDiscord_<Technicae Circuit> Mhm
11:59:08FromDiscord_<Technicae Circuit> But actually make the bot cool and useful
11:59:19FromDiscord_<sealegs> I was thinking of that before when I was working on the lib
11:59:25FromDiscord_<Technicae Circuit> Oh?
11:59:35FromDiscord_<sealegs> It actually took me 4 or 5 months
11:59:36FromDiscord_<Technicae Circuit> I think it'd be cool
11:59:39FromDiscord_<Technicae Circuit> Oo
12:00:29*Hideki_ quit (Remote host closed the connection)
12:00:43*Hideki_ joined #nim
12:01:03FromDiscord_<Technicae Circuit> I'd like the commands would be generated from files
12:01:08FromDiscord_<Technicae Circuit> Let me write an example
12:01:19FromDiscord_<sealegs> hmm ok
12:01:41FromDiscord_<Technicae Circuit> Generating the commands from files can clean everything up alot
12:01:46FromDiscord_<clyybber> ?
12:01:58FromDiscord_<clyybber> oh, you mean discord commands
12:02:00*Hideki_ quit (Remote host closed the connection)
12:02:03FromDiscord_<Technicae Circuit> Because having one massive file is hideous
12:02:04FromDiscord_<Technicae Circuit> Yeah
12:02:29FromDiscord_<clyybber> thats out of dimsord's scope I suppose
12:02:39FromDiscord_<clyybber> or are you talking about the bot?
12:02:53*Hideki_ joined #nim
12:02:55*Hideki_ quit (Remote host closed the connection)
12:03:11*Hideki_ joined #nim
12:03:42*Hideki_ quit (Remote host closed the connection)
12:04:29*Hideki_ joined #nim
12:04:30FromDiscord_<Technicae Circuit> The bot
12:04:35FromDiscord_<Technicae Circuit> It could be made easily
12:05:16*Hideki_ quit (Remote host closed the connection)
12:05:34*Hideki_ joined #nim
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:44*supakeen joined #nim
12:07:14*Hideki_ quit (Remote host closed the connection)
12:07:24*solitudesf quit (Remote host closed the connection)
12:07:51*Hideki_ joined #nim
12:08:55*solitudesf joined #nim
12:10:53PMunchSorry, I had to go there for a sec
12:10:58PMunchTechnicae Circuit, did you find your issue?
12:12:27*Hideki_ quit (Ping timeout: 265 seconds)
12:18:15*hax-scramper quit (Ping timeout: 265 seconds)
12:18:55*hax-scramper joined #nim
12:23:59FromDiscord_<Technicae Circuit> I had to go too :p
12:24:21FromDiscord_<Technicae Circuit> But https://play.nim-lang.org/#ix=2jkN is how i think the structure should be like
12:24:24FromDiscord_<Technicae Circuit> @KrispPurg
12:25:08FromDiscord_<Rika> Per file sounds insane imo
12:25:23FromDiscord_<Rika> Maybe commands can be split into modules
12:25:47FromDiscord_<Rika> I mean, not nim modules just something called "modules"
12:25:56*Hideki_ joined #nim
12:27:12*Hideki_ quit (Remote host closed the connection)
12:29:04*Hideki_ joined #nim
12:29:25FromDiscord_<Technicae Circuit> Haha
12:29:30FromDiscord_<Technicae Circuit> Sure
12:29:45FromDiscord_<Technicae Circuit> Or a class based command system
12:29:46rockcaveraThis pull (https://github.com/nim-lang/Nim/pull/14004) broke old code. Example: https://play.nim-lang.org/#ix=2jkQ
12:29:48disbotβž₯ fixes #14001
12:30:40FromDiscord_<sealegs> Well, I mean having a split file is cool through, but I'm sure you can just modify the example code and make it use split file command
12:31:16rockcaveraNow it remains to be seen whether it was deliberate, since previous behavior was inappropriate.
12:31:49FromDiscord_<Rika> then you can also just `include` files
12:33:48*Hideki_ quit (Ping timeout: 256 seconds)
12:39:10solitudesfpretty sure it was delibarete
12:39:37solitudesf4raq is aware of that breakage, at least
12:50:46FromGitter<Bennyelg> What is the best practice to open connections on an API ? ⏎ on every route open or at the top like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea2e0a6568e5258e47fd37a]
12:50:56FromDiscord_<Technicae Circuit> Are giu able to Include C files?
12:51:22FromDiscord_<Technicae Circuit> Are you able to include header files?
12:51:34*Hideki_ joined #nim
12:52:11PMunchYes
12:54:41rockcaverasolitudesf, thanks. I believe too.
12:55:24*Vladar quit (Quit: Leaving)
12:58:33rockcaveraI am in need of help. I have an asynchronous procedure that returns a Future [int], but I pass a 'var string' as a parameter, but I receive that it is not safe and does not compile.
12:59:51dom96You can use FutureVar
12:59:56Araqrockcavera: it wasn't the PR, it was a different PR
13:00:14Araqand the code isn't supported
13:00:44dom96(if you're adventurous you can modify the async macro to transform `var string` into `FutureVar[string]` and make a PR :))
13:01:22rockcaverathanks
13:01:23Araqnah, people should use FutureVar[string] explicitly and learn about the stack vs heap
13:01:24rockcavera:)
13:02:35dom96Araq, why? :)
13:02:40PMunchIs there a way to wrap a field like `char title[50]` in a structure to something that would be treated as as string?
13:02:52dom96ideally {.async.} should support the language's features transparently
13:02:53PMunchOr would I need to do array[50, char]?
13:03:17AraqPMunch: use array[50, char]
13:04:33PMunchBut then it's a pain to assign string data or echo the contents..
13:05:10dom96write procs that make those operations easier then
13:05:48PMunchOh, I'm not needing this for anything in particular
13:05:58PMunchI'm just writing up an article on Nim/C interop
13:06:04*Hideki_ quit (Remote host closed the connection)
13:06:04PMunchAnd wondered if there was a better way of doing it
13:07:16Araqin your tutorial also show template toCstring(x): cstring = unsafeAddr(x[0])
13:08:07PMunchIs that template defined anywhere? Or just show off that it's possible to do it?
13:08:38FromDiscord_<Technicae Circuit> So how would i use a C++ library in Nim?
13:11:34PMunchLike this: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
13:11:46Araqdom96: "less magic" is en vogue
13:11:53FromDiscord_<Technicae Circuit> Thanks!
13:12:05AraqPMunch: that template doesn't exist
13:12:22PMunch(except for the fact that the code example literally says "Horrible example of how to interface with a C++ engine" :P)
13:12:27PMunchAraq, okay thanks
13:13:36Araqanybody around with experience on this algorithm https://en.wikipedia.org/wiki/Path-based_strong_component_algorithm ?
13:13:44Araqclyybber?
13:14:10PMunchIs there a way to limit a template to only string literals?
13:15:18dom96Araq, okay, at the very least, someone should suggest FutureVar when `var` is attempted in an async macro :)
13:15:35dom96alehander42: maybe you'd be interested in this improvement also?
13:16:23PMunchAh, can be done with {lit} like in term rewriting macros
13:18:14shashlickDo templates work for simple substitutions - #define MyCoolUint32 uint32
13:18:42disrupteksure.
13:20:28FromGitter<alehander92> dom96 i agree this should be at least hinted
13:20:35FromGitter<alehander92> i think i didnt know i can use FutureVar as well ...
13:22:35PMunchSo something like this helps deal with the situation: https://play.nim-lang.org/#ix=2jlg
13:22:45PMunchTo bad I can't create an = operator
13:28:39*zacharycarter joined #nim
13:30:33*Hideki_ joined #nim
13:30:46*Hideki_ quit (Remote host closed the connection)
13:31:01*Hideki_ joined #nim
13:31:02*Hideki_ quit (Remote host closed the connection)
13:31:34*Hideki_ joined #nim
13:31:39dom96btw yesterday I created a quick hacky implementation of intsets for the JS backend which uses JS' native `Set` and got some nice perf improvements. I wonder how many others things like this there are in the stdlib.
13:31:55dom96Araq, would you accept patches to implement them using JS-native APIs
13:31:56dom96?
13:32:37Araqif the patch is clear enough
13:33:09Araqfor example, one solution is to make intsets.nim contain
13:33:20Araqwhen defined(js): include intsets_js
13:33:23dom96yep
13:33:27Araqelse: include insets_native
13:33:28FromDiscord_<Rika> wait would that mean that ES3 compatibility is no longer guaranteed?
13:33:55FromDiscord_<Rika> wait, was nim the one that guaranteed ES3 compatibility? i forgot
13:34:17dom96Set has pretty good browser support from what I checked
13:34:21AraqRika: in the worst case it means 'when defined(js) and not defined(nimArchaneJs): ...'
13:34:46dom96https://gist.github.com/dom96/d5cdd3c2406992aae4173b9e47ae5249
13:34:53dom96my hack from last night
13:35:06dom96awesome that I can code something like that up in like 10 mins btw
13:35:36*Hideki_ quit (Remote host closed the connection)
13:35:51*Hideki_ joined #nim
13:35:52*Hideki_ quit (Remote host closed the connection)
13:36:13disruptekright?
13:36:22disruptekAraq: i'm blocked by stupid shit.
13:36:33Araqshoot
13:36:41disrupteksee stream late yesterday or i will demo in a few; lemme get some coffee.
13:37:05disruptekRope != ref object Rope
13:37:12disruptekdafuq
13:37:19FromDiscord_<Technicae Circuit> Is therr a way to get the C++ code and not just the compiled binary?
13:37:27*xcm quit (Remote host closed the connection)
13:37:36FromGitter<alehander92> hm, i should start using sets
13:37:44dom96Araq, I wonder how much effort it'd be to reimplement the nim stdlib to use native JS strings
13:37:44FromGitter<alehander92> i constantly use JsAssoc[stuff, bool]
13:37:47FromGitter<alehander92> to immitate that
13:37:59FromGitter<alehander92> oh we wanted that with @zah
13:38:01*Hideki_ joined #nim
13:38:07*Trustable quit (Remote host closed the connection)
13:38:09FromGitter<alehander92> but the problem is the mutability thing
13:38:22*tane joined #nim
13:38:27Araqdisruptek: simple, there are two different ropes modules
13:38:27dom96hm. I see.
13:38:50dom96tbh I'm not sure strings are the bottleneck for my game
13:38:54Araqthe compiler doesn't use the stdlib's ropes module, watch out
13:39:12Araqdom96: IME karax with its 'kstring' does it best
13:39:20FromGitter<alehander92> we can have something like kstring
13:39:44*xcm joined #nim
13:39:47Araqsometimes a library solutions patching over language problems work best
13:39:53dom96spent a while optimising things last night and while I improved certain timings, Edge was still stuck at 9fps :(
13:40:44dom96might need to rethink how I move particles or be less ambitious (this was 2500 particles moving at once)
13:40:49*narimiran quit (Ping timeout: 256 seconds)
13:42:07*Hideki_ quit (Remote host closed the connection)
13:42:20*Hideki_ joined #nim
13:42:23*Hideki_ quit (Remote host closed the connection)
13:43:01*Hideki_ joined #nim
13:43:05*dddddd quit (Ping timeout: 256 seconds)
13:47:37*Hideki_ quit (Ping timeout: 256 seconds)
13:51:20Araqholy shit... my cycle collector works for 'hamming.nim'
13:53:24FromDiscord_<Recruit_main707> thats probably really good! congrats! :p
13:58:05Araqit's suprising as the collector is incomplete :-)
13:58:10FromDiscord_<clyybber> Araq: Regarding the algorithm, nope.
13:58:18FromDiscord_<clyybber> Araq: Also \o/
13:58:21FromDiscord_<clyybber> πŸ˜„
13:58:37Araqwell now I have the proof that my architecture is correct
13:58:50Araqand the other algorithm is broken
13:58:57Araqbecause my new one works
13:59:09Araqno errors according to valgrind
13:59:24disruptekAraq: you're blowing my mind right now. also, thanks.
14:03:01FromDiscord_<Technicae Circuit> > Is therr a way to get the C++ code and not just the compiled binary?
14:03:04FromDiscord_<Technicae Circuit> :p
14:03:25disrupteklook in your nimcache.
14:03:30disruptek~nimcache
14:03:31disbotnimcache: 11the best way to figure out where it is located is to specify that location with --nimcache -- disruptek
14:03:50FromDiscord_<Technicae Circuit> Thanks
14:03:53FromDiscord_<Recruit_main707> you can do `--nimcache:./cache` or something like that
14:04:23FromDiscord_<Technicae Circuit> So just specify a path for the cache to go?
14:04:43FromDiscord_<Recruit_main707> yep
14:04:56FromDiscord_<Recruit_main707> there is a default one somewhere
14:05:02FromDiscord_<Technicae Circuit> Oki
14:07:42FromGitter<alehander92> it should be in `~/.cache/nim/<somenameofyourproject>`
14:07:44FromGitter<alehander92> by default IIRC
14:08:02FromGitter<alehander92> you can also `--nimcache: ` to `/dev/shm/` or `/tmp/` location
14:08:21PMunch_d for debug and _r for release
14:08:38FromDiscord_<Technicae Circuit> Thanks, but when i do `nim --nimcache:path` it says i need a command
14:09:02FromGitter<zetashift> still need to add c/cpp and a nim file probably
14:09:29FromGitter<zetashift> like `nim c --nimcache:path main.nim`
14:09:59FromDiscord_<Technicae Circuit> Oh okay, thanks
14:10:04FromGitter<alehander92> of course this is for linux, i am not so experienced in nim with other platforms
14:10:15PMunchShould wrapped types have importc on them? Why/why not?
14:10:21FromDiscord_<Technicae Circuit> I am a linux user too :)
14:10:25FromGitter<alehander92> ok
14:10:45FromDiscord_<Technicae Circuit> Is there an option in my nim.cfg to set a default path for cache,m
14:10:50FromDiscord_<Technicae Circuit> Is there an option in my nim.cfg to set a default path for cache?
14:11:11disruptekhold it closer to the screen.
14:11:16disruptekcan't quite read it from here.
14:11:21zacharycarterHackathon went well btw - I have no idea if we won, but our project elicited the most ooos and ahhhs
14:11:33FromDiscord_<Technicae Circuit> Cool
14:11:46*Hideki_ joined #nim
14:11:52PMunchOh nice zacharycarter!
14:11:55disruptekwhich hackathon?
14:11:55zacharycarterand I wrote the AWS lambda in Nim
14:11:57PMunchWhat did you make?
14:12:11FromGitter<alehander92> Technicae yeah you can just write your flags there
14:12:14FromGitter<alehander92> e.g. `--nimcache:..`
14:12:19zacharycarterwe made a chat bot / did NLP stuff
14:12:35FromGitter<alehander92> https://github.com/nim-lang/Nim/issues/7402#issuecomment-376153970
14:12:36FromDiscord_<Technicae Circuit> Thanks
14:12:37disbotβž₯ [TODO] could nimcache be generated out-of-source (in /tmp) like rdmd does in D?
14:13:00zacharycarterso you'd say you want to see what shipments are getting picked up or dropped of on a particular day and our bot would retrieve that information
14:13:08FromDiscord_<Technicae Circuit> There should also be a `transpile` option
14:13:13FromGitter<alehander92> ? why
14:13:23FromDiscord_<Technicae Circuit> So it outputs the converted code
14:13:37FromGitter<alehander92> but it does output it
14:13:39zacharycarterNim doesn't do transpilation though
14:14:00FromGitter<alehander92> and outputting it on the screen would be confusing as you generate a lot of boilerplate
14:14:01FromDiscord_<Technicae Circuit> Does it not? How else does it generate C, C++ and JS?
14:14:07zacharycartercompilation
14:14:09FromGitter<alehander92> and different files
14:14:17FromDiscord_<Technicae Circuit> Welp
14:14:29disrupteksyntax.
14:14:30FromGitter<alehander92> Technicae this is like a flamewar topic "is transpilation useful term or not"
14:14:46FromDiscord_<Technicae Circuit> Oh okay :p
14:15:09*Hideki_ quit (Remote host closed the connection)
14:15:24disruptektranspilation usually suggests no change to semantics.
14:15:27FromGitter<alehander92> you can use the `debug` options to get line directives inside your c/javascript files
14:15:32FromGitter<alehander92> or `--lineDir:on`
14:15:42*Romanson quit (Quit: Connection closed for inactivity)
14:16:01*Hideki_ joined #nim
14:16:29FromDiscord_<Technicae Circuit> Hm
14:16:33FromGitter<alehander92> we also have `--sourcemap:on` now for javascript, but its a bit experimental (all those if you want to map the outputted code to nim cod)
14:17:23FromDiscord_<Technicae Circuit> Are files compiled by Nim decompilable?
14:17:59zacharycarterCan you do that in any other language?
14:18:01disruptekno less so than any other c file.
14:18:07Zevvup to a certain level, sure
14:18:25zacharycarterI mean c2nim can generate nim code from parsing C
14:18:26zacharycarterand C++
14:18:33Araqit's all decompilable unless you convert it to 'move'-only code
14:19:03Zevveven then. just given enough time and patience
14:19:13FromDiscord_<Technicae Circuit> Hm
14:19:16Araqhttps://github.com/xoreaxeaxeax/movfuscator use this on your code
14:19:20FromDiscord_<Technicae Circuit> That's a plus fot me then
14:19:27FromDiscord_<Technicae Circuit> That's a plus for me then
14:20:03AraqZevv: nobody has enough time to deal with mov-only code ;-)
14:20:57FromGitter<alehander92> Technicae code is always reverse engineerable
14:21:01*Hideki_ quit (Ping timeout: 265 seconds)
14:21:27FromDiscord_<Technicae Circuit> I want to just get a C or C++ file that can be compiled for use in Python scripts, so i want to be able to decompile the code :p
14:22:01FromGitter<alehander92> what do you call decompile
14:23:05FromDiscord_<Technicae Circuit> Just get all the code in it's C form, no matter how messy it is, if it works, then it works
14:23:27FromDiscord_<Technicae Circuit> Messy or unreadable*
14:24:32PMunchSo you just want the C code from Nim code?
14:24:40PMunchThat's compiling, not decompiling..
14:25:02FromDiscord_<Technicae Circuit> If I'm using the binary to get the C code?
14:25:10PMunchDecompiling would be to go the other way, from binary to C/Nim or from C to Nim.
14:25:47PMunchBut why would you want to do that when you can just get the Nim compiler to output the C code in the first place?
14:25:53FromGitter<alehander92> yeah :P
14:26:14FromDiscord_<Technicae Circuit> But doesn't the cache generate a bunch of files?
14:26:20FromDiscord_<Technicae Circuit> I only want to get one file
14:26:35FromGitter<alehander92> but still it's much much much easier to just postprocess them somehow
14:26:40FromGitter<alehander92> than to decompile a binary
14:26:48FromGitter<alehander92> and why do you need just a single file?
14:26:51PMunchfind ./nimcache -name *.nim.c -exec cat {};
14:27:01FromGitter<alehander92> this shouldn't matter in general
14:27:26FromDiscord_<Technicae Circuit> I want a single file so i can just give the setup.py one file to compile in C
14:27:40PMunchI guess just `cat nimcache/*.nim.c` would work as well
14:28:02FromGitter<alehander92> but why would you give that to setup.py at all
14:28:13FromGitter<alehander92> if nim can already compile the c files
14:28:17PMunchYou have the --genscript switch which creates a script to compile your C sources
14:28:22PMunchProvided that it still works
14:28:32FromGitter<alehander92> can you explain a bit more what exactly does your python program do
14:29:25*kenran quit (Quit: leaving)
14:29:52FromGitter<alehander92> (and yeah, you can still compile the whole directory, it is basically a set of `gcc` invocations => `.o` files and final => binary)
14:29:54FromGitter<alehander92> IIRC
14:29:59*PMunch quit (Quit: leaving)
14:31:56FromDiscord_<Technicae Circuit> I'm planning on starting to write all of my Python extensions in Nim, but having massive amounts of files doesn't seem that nice, since that would clog the directory with masses of .c files
14:32:43FromGitter<bung87> `+ (id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask ⏎ ⏎ ``` handler:(NSEvent * _Nullable (^)(NSEvent *))block;```` [https://gitter.im/nim-lang/Nim?at=5ea2f88b2bf9ef12699fdcc8]
14:32:45FromGitter<alehander92> well you can just have subdirectories
14:32:55FromGitter<bung87> how to write this in c using objc runtime?
14:33:21FromGitter<bung87> `objc_msgSend(objc_getClass('NSEvent'), sel_registerName('addLocalMonitorForEventsMatchingMask:handler:'),1 << 14,(IMP)KeyboardEventHandler,"v@:@");`
14:33:28FromGitter<bung87> this not work
14:34:13FromGitter<alehander92> Technicae but for sure there are ways to generate single c/h files from groups of c/h , do that, dont decompile :)
14:34:41FromDiscord_<Technicae Circuit> How would i do that then? :P
14:35:17FromGitter<alehander92> well, does a subdirectory not work?
14:37:04FromGitter<alehander92> if not, https://github.com/cil-project/cil is one option
14:39:18FromGitter<alehander92> http://cil-project.github.io/cil/doc/html/cil/
14:39:30FromGitter<alehander92> => Using the merger
14:46:58FromDiscord_<Technicae Circuit> Okay, I'm using Nimpy right now but i need to figure out how would iterate through a list of functions, the functions are passed to Nim from Python
14:47:24FromDiscord_<Technicae Circuit> > <FromGitter> <alehander92> well, does a subdirectory not work?
14:47:24FromDiscord_<Technicae Circuit> Yeah it does, so i guess a subdir should be fine :p
14:48:57FromGitter<alehander92> good!
14:50:47disruptek~stream
14:50:48disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:50:50disruptekgamer tool today.
14:51:54FromGitter<alehander92> technicae the iteration should work if not ask
14:51:58FromGitter<alehander92> disruptek oo
14:54:34FromDiscord_<Technicae Circuit> I can only iterate through one type which is sad
14:54:54FromDiscord_<Technicae Circuit> But i need to iterate through a list with multiple data types
14:55:07FromDiscord_<Technicae Circuit> ~help
14:55:15FromDiscord_<Technicae Circuit> !help
14:55:29FromDiscord_<Technicae Circuit> Oof
14:55:36*FromDiscord_ <Recruit_main707> **there is no help**
14:55:57FromGitter<alehander92> :)
14:56:09FromGitter<alehander92> can't you collect them
14:56:19FromDiscord_<Technicae Circuit> What do you mean?
14:58:09*hax-scramper quit (Read error: Connection reset by peer)
14:58:14*xcm quit (Remote host closed the connection)
14:58:15FromDiscord_<Technicae Circuit> How would i iterate through a list that i passed from Python to Nim if it has multiple data types (like and int and a string)
14:58:28*hax-scramper joined #nim
14:58:35*hax-scramper quit (Read error: Connection reset by peer)
14:59:34*hax-scramper joined #nim
15:00:26*xcm joined #nim
15:01:52*Vladar joined #nim
15:02:26FromGitter<alehander92> ahhh !
15:02:39FromGitter<alehander92> sorry, i didnt realize what you need
15:02:44FromGitter<alehander92> can't you pass it as a tuple somehow
15:03:14FromGitter<alehander92> or can't you work with them as some kind of general objects, not too familiar with nimpy tho
15:03:47FromDiscord_<Technicae Circuit> It's basically using Nim
15:04:13FromGitter<alehander92> but can you directly introspect PyObjects
15:04:19FromDiscord_<Technicae Circuit> And the limitation is that sequences (Python lists get turned into sequences) can only have one type
15:04:21FromDiscord_<Technicae Circuit> Oh?
15:04:23FromDiscord_<Technicae Circuit> How?
15:04:32FromGitter<alehander92> sorry its a ? :D
15:17:05companion_cubewhat's the tech behind FromGitter/FromDiscord? is it free?
15:17:30*liblq-dev quit (Ping timeout: 256 seconds)
15:18:16dom96FromGitter is written in Crystal by oprypin
15:18:37dom96FromDiscord is whatever the most popular relay written in Go is, can't remember the name
15:18:42*natrys joined #nim
15:19:08companion_cubeoh really? :o
15:19:13*liblq-dev joined #nim
15:19:39FromDiscord_<sealegs> @Technicae Circuit, I have updated the library dimscord with the fix of the example and the nimble issue.
15:19:55*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
15:20:16*kitech1 joined #nim
15:22:02*zacharycarter quit (Quit: Lost terminal)
15:26:22FromDiscord_<Technicae Circuit> Oh, nice!
15:26:43FromDiscord_<Technicae Circuit> I recommend making the library simpler though since the current version isn't the best
15:28:05FromDiscord_<clyybber> ?
15:30:19FromDiscord_<Yardanico> @sealegs hello, I'm interested in your dimscord library, can it run for long periods of time without any crashes and stuff (like days and weeks)? I'm asking because https://github.com/Yardanico/ircord currently uses discordnim and it's not that reliable
15:30:45YardanicoFromDiscord in this channel is matterbridge
15:31:49dom96Yardanico, how often do crashes happen
15:31:50dom96?
15:32:03companion_cubeahhh cool, thanks Yardanico
15:32:07dom96if they're not too frequent it shouldn't be a problem, just restart the program
15:32:26Yardanico@dom96 well the worst thing is that there's no such reliable way to detect that
15:32:36Yardanicoit just stops handling discord events
15:32:39Yardanicowithout any exceptions
15:32:45dom96ahh, that's really bad
15:33:11dom96does the library do something silly like catch exceptions and then ignore them or something?
15:33:29dom96My guess is that discord is timing out the connection and it cannot reconnect
15:33:39Yardanicowell discord has that well documented
15:34:03Yardanicoand there are "try" statements but they echo stuff if they catch an exceptions
15:35:10dom96might be worth just getting rid of those
15:35:11FromDiscord_<codic> Does Nim have anything like a Python list?
15:35:11FromDiscord_<codic> Dynamic, can hold elements of any type
15:35:14dom96it's always better to crash early
15:35:20FromDiscord_<codic> Does Nim have anything like a Python list?
15:35:20FromDiscord_<codic> Dynamically sized, can hold elements of any type
15:35:21dom96if the crash happens to often then fix the crash
15:35:25dom96if it's rare you can always restart
15:35:27Yardanico@codic no, you'll have to use stuff like variant objects
15:35:38Yardanico@dom96 usually it happens in less than a day
15:35:54YardanicoI'll try using dimscord :P
15:36:19dom96sometimes you gotta get your hands dirty
15:36:41dom96libraries won't be fixed unless you help the process along
15:36:59Yardanicoi know, I tried looking why discordnim crashes, but didn't get any meaningful info
15:37:04FromDiscord_<codic> ah, how do variant objects work? I can't find anything about variant objects, just ***object variants*** :P https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
15:37:10Yardanicoyeah, object variants
15:37:19FromDiscord_<codic> haha
15:37:21Yardanicosince discordnim is pretty much unmaintained it's bundled in ircord
15:37:45FromDiscord_<codic> is it?
15:37:46FromDiscord_<codic>
15:37:46FromDiscord_<codic> https://cdn.discordapp.com/attachments/371759389889003532/703268456845410434/unknown.png
15:37:50FromDiscord_<codic> last commit on jan 16
15:38:11FromDiscord_<codic> ;P
15:38:23Yardanicowell if you look at it it doesn't really do any meaningful changes
15:38:25Yardanicojust some styling
15:38:30FromDiscord_<codic> oh
15:38:39FromDiscord_<codic> Let's see
15:38:45FromDiscord_<codic> Commit a day before it
15:38:50FromDiscord_<codic> https://github.com/Krognol/discordnim/commit/e3b7223ff726d12295dfdacdf78f2ab6abae8774
15:39:13FromDiscord_<codic> although that seems to be mainly removing whitespace?
15:39:25FromDiscord_<codic> Why was that whitespace there in the first place?
15:40:07FromDiscord_<codic> also, I wonder how nim hasn't exploded into popularity yet, seeing that it's 15 years old and provides great speed with simplicity
15:41:01Yardanicowell whitespace can be there if you do <Space><enter>
15:41:23Yardanicoin my projects I sometimes have a space after "=" in proc definition or after ":" (in if/when/etc)
15:41:34FromDiscord_<codic> true, but why would that affect the compiler?
15:41:39Yardanicoit won't?
15:41:40dom96codic: I wouldn't call it 15 years old, 12 at most
15:41:59Yardanicowell, except the whitespace before the code
15:42:03FromDiscord_<codic> Then there's no need to remove it, that whole commit is about that except for an import change
15:42:06Yardanicobecause nim is whitespace significant :)
15:42:17FromDiscord_<codic> wasn't nim created in 2005?
15:42:20Yardanico@codic that comment also replaces some procs with templates, although I'm not really sure that it's neccessary either
15:42:25Yardanico@codic first public release in 2008
15:42:31FromDiscord_<codic> Yeah, but I think that's for whitespace at the end, not at the beginning
15:42:33FromDiscord_<codic> Ahh, okay
15:43:06FromDiscord_<codic> Still
15:43:11*hax-scramper quit (Ping timeout: 265 seconds)
15:43:11FromDiscord_<codic> A 12 year old language is pretty old
15:43:17Yardanicono big corporate backing
15:43:29FromDiscord_<codic> True I guess
15:43:36*hax-scramper joined #nim
15:43:50FromDiscord_<Rika> then also many people dont seem to like some of the features
15:44:00FromDiscord_<codic> like which ones?
15:44:09FromDiscord_<Rika> whitespace instead of braces, semi case-insensitivity
15:44:53Yardanicowell you can write pRoC a = echo "hi" but no one does that :P
15:45:05FromDiscord_<codic> That's cool
15:45:09FromDiscord_<codic> I should now write
15:45:20Yardanicomostly case insensitivity is used for snake_case vs camelCase
15:45:27Yardanicoso if someone has a lib in snake_case you can use it as camelCase
15:45:56FromDiscord_<codic> ```nim
15:45:56FromDiscord_<codic> pROc a(b: INT, c: INT) =
15:45:57FromDiscord_<codic> return b + c
15:45:57FromDiscord_<codic> ECHO "TEST"
15:45:57FromDiscord_<codic> ```
15:46:02Yardanicopls don't paste stuff in discord
15:46:06dom96two main criticisms are always: style insensitivity and how module imports work by default
15:46:08Yardanicocurrently in IRC it looks bad :(
15:46:11FromDiscord_<codic> Am I allowed to go that far?
15:46:14FromDiscord_<codic> I didn't paste anything
15:46:20Yardanico@dom96 the latter is probably because these people are coming from python
15:46:29dom96three lines is fine, just don't paste 50
15:46:45FromDiscord_<codic> Erm....
15:46:51FromDiscord_<codic> Okay
15:46:56FromDiscord_<codic> Ohhh I see what you mean hahha
15:46:59FromDiscord_<codic> Ohhh I see what you mean haha
15:47:13Yardanicodon't edit either :P really need to get that ircord done
15:47:32*waleee-cl quit (Quit: Connection closed for inactivity)
15:48:29FromDiscord_<Rika> tfw discord too modern for irc
15:48:31FromDiscord_<Rika> smh smh
15:48:45dom96IRC is too cool for Discord :P
15:48:52Faulanderhey guys, has someone created a epub out of the official manual by any chance? I need it with me on my ebook reader :)
15:49:00Yardanicoyeah, discord doesn't even support colored messages smh
15:49:35FromDiscord_<Rika> does it have to be epub? does your e-reader not work with pdf?
15:49:43FromDiscord_<sealegs> @Yardanico I'll answer your question later because im gonna have a shower
15:49:46FromDiscord_<Rika> it'd be a pretty shitty e-reader to not work with pdf
15:50:27Faulanderit works with pdf, but epubs are WAY better. i won't go into details here, but pdf doesn't scale well.
15:50:42Yardanicofind some html -> epub tool I guess?
15:51:03Faulanderhaha, i can do it no problem. i just wanted to know if someone already did :)
15:51:30Faulander(and maybe make a lib out of it, practising my nim knowledge)
15:51:52dom96search around, this was done before IIRC
15:51:58Faulanderkk
15:52:20*xcm quit (Remote host closed the connection)
15:52:34Faulanderbzw. just wrote my 1000 line of nim code (yay!) and only one program left to convert from python to nim.
15:53:12Faulanderand i bought your book dom, its pretty good.
15:54:19*xcm joined #nim
15:54:38dom96yay, thanks for getting a copy :)
15:55:56FromDiscord_<codic> > <dom96> IRC is too cool for Discord :P
15:55:58FromDiscord_<codic> nope, matrix best
15:56:14Yardanicotoo much centralization, people talked about this in nim-offtopic I think
15:56:26Yardanicothe most popular matrix server is matrix.org and it's really overloaded
15:56:28Yardanicoso it's not that fast
15:56:30dom96lol Matrix sucks
15:56:39FromDiscord_<codic> matrix.org sucks
15:56:44FromDiscord_<codic> but there are other nice servers
15:56:45dom96All I see is netsplits from it
15:56:48FromDiscord_<codic> like privacytools.io
15:56:57Yardanico@dom96 that's thanks for the JS-powered matrix bridge bot
15:57:00dom96Although to be fair, I never actually used it
15:57:03FromDiscord_<codic> Does nim have a type like Go's `interface{}`, basically satisfying every type? That way, assuming it was called `any`, I could make a `seq[any]`
15:57:05FromDiscord_<codic> ll
15:57:06FromDiscord_<codic> Lol
15:57:20Yardanico@codic that's not really possible
15:57:25FromDiscord_<codic> Aww
15:57:31dom96codic: seq[RootObject] but then you need to use inheritance which sucks
15:57:45FromDiscord_<codic> What do you mean, I have to use inheritance?
15:57:46dom96what are you trying to do?
15:57:59dom96FooBar = object of RootObject
15:58:03FromDiscord_<codic> create a dynamic array which can hold any sort of type (ik, I'm stupid)
15:58:13dom96and then you can store FooBar in that seq or any other type that inherits from RootObject
15:58:26FromDiscord_<codic> in this case, i'm trying to use a sequence
15:58:30FromGitter<alehander92> codic i dont really think you can do that
15:58:33FromDiscord_<codic> ah
15:58:33dom96right, but why do you need this?
15:58:36FromGitter<alehander92> because e.g. ints are not boxed
15:58:39FromDiscord_<codic> for being stupid
15:58:42dom96what is your concrete use case?
15:59:09FromDiscord_<codic> Let's assume that I have an array of user input from a website or something
15:59:29FromGitter<alehander92> is it like json
15:59:30FromDiscord_<codic> Some of the input may be ints, others may be strings, so on
15:59:31Yardanicoit's just that different languages have different ways of dealing with problems
15:59:37Yardanico@codic use object variants
15:59:40FromGitter<alehander92> you can use case objects `codic`
15:59:42FromGitter<alehander92> yeah , the same
15:59:43FromDiscord_<codic> true, i agree
15:59:54Yardanicoor json module (it can be used for boxing different kinds of variables)
15:59:54FromDiscord_<codic> I have no idea how to use object variants, the docs don't explain much
16:00:01FromGitter<alehander92> which languages have you used before
16:00:05FromDiscord_<codic> oh, json does seem like a good idea
16:00:09Yardanicoand unless you convert it to string the inner representation won't be json at all
16:00:13FromDiscord_<codic> python, ruby, go, and kotlin
16:00:16Yardanicojson in nim is implemented using object variants too
16:00:28Yardanicohttps://nim-lang.org/docs/json.html#JsonNodeObj
16:00:38FromDiscord_<codic> that's actually a good idea
16:01:19FromGitter<alehander92> ok they are something like sealed classes in kotlin from what i read
16:01:22dom96yeah, json is a good example
16:01:40dom96you can copy the object variant used there as an example
16:01:46dom96or just use JsonNode directly
16:01:50FromGitter<alehander92> i really want to add something like patty's variant constructor
16:01:53FromGitter<alehander92> to stdlib or fusion
16:02:01FromGitter<alehander92> now with type pragmas
16:04:16FromGitter<alehander92> this should be easier : just writing `A {.sum.} = object .. Int(a: int) String(text: string) Other(b: seq[A])` etc
16:04:51*madpata joined #nim
16:06:11Faulandercodic is missing pythons list i think. i used that extensively aswell, slow but comfortable.
16:06:34FromGitter<alehander92> yeah, but no
16:06:51FromGitter<alehander92> `seq` is list, he is missing isinstance and duck typing imho
16:06:59FromGitter<alehander92> but one usually doesnt really need that
16:07:10Faulanderseq is one type only, lists are not
16:07:19FromGitter<alehander92> but this isnt about seq ;)
16:07:27FromGitter<alehander92> its about all nim collections
16:07:27YardanicoFaulander: seq *is* a list
16:07:29FromGitter<alehander92> they all are typed
16:07:38FromGitter<alehander92> but you usually use just several kinds of values, so you can just wrap them in case objects
16:07:58FromGitter<alehander92> its about `any` vs sum type/case objects vs traditional typed value
16:08:02FromGitter<alehander92> not about seq vs list
16:08:34FromGitter<alehander92> you can also use two types only in Table and many in dict, one in set and many in python set
16:08:38Faulanderi am way too pragmatic, i just converted everything to json if i needed it :)
16:08:45Yardanicoit's fine
16:08:49FromGitter<alehander92> that works sometimes too :P
16:08:58Yardanicounless you convert a JsonNode to string it won't be stored as JSON inside of memory
16:09:09Yardanicoit'll be just stored as object variants
16:09:47FromDiscord_<Technicae Circuit> So uh, anyone figured out how to have any type in a sequence? :P
16:09:56Yardanicoas we said, use object variants instead
16:10:01Yardanicoor inheritance
16:10:34FromDiscord_<Technicae Circuit> Which way would be better suited for being passed a Python list?
16:10:50FromGitter<alehander92> probably variants imho
16:11:12FromGitter<alehander92> but you really have to look inside nimpy a bit
16:11:31FromGitter<alehander92> i am sure internally it should be able to work with a more general type somehow
16:12:38FromDiscord_<Technicae Circuit> Okay then
16:12:42FromDiscord_<Technicae Circuit> Thanks
16:13:16madpataGood evening, why doesn't this (https://play.nim-lang.org/#ix=2jmI) throw an "ambiguous call" error? Both the member callback and the proc could be called. Will it always be like this or is there somewhere I can read up on nim's ufcs?
16:13:24*codic joined #nim
16:13:40*ftsf quit (Ping timeout: 256 seconds)
16:14:36FromGitter<alehander92> ok man i looked
16:14:44FromGitter<alehander92> `toJson` can help you maybe Technicae
16:14:53FromGitter<alehander92> https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L1176
16:15:01solitudesfobject fields have priority, but idk if its specified in manual
16:15:07FromGitter<alehander92> it does https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L725
16:15:38*Vladar quit (Quit: Leaving)
16:19:13madpataIt makes sense that object fields have priority. Do you know if there's a compiler flag to emit a warning? Just curious because this behaviour could lead to subtle bugs.
16:21:04FromDiscord_<codic> yup I'm missing python's list
16:21:11FromDiscord_<codic> i found a solution: to not be stupid
16:21:21FromDiscord_<codic> (aka convert everything to a string before making a seq)
16:21:45shashlickuse json
16:22:06Faulanderi knew it, i came over from python also a week ago, been there, done that ;)
16:22:32Faulandercovert to str and use seq if type doesn't matter, or use json (as i did)
16:23:10codicLol
16:23:21codicYeah, I can always convert the types back, that seems like the easiest solution
16:23:25shashlickwon't last for long
16:23:34codicwhy?
16:23:44shashlickbetter to be disciplined about types, I transitioned and code is a lot cleaner
16:23:48FromDiscord_<Rika> small brain: use object variants
16:23:48FromDiscord_<Rika> big brain: serialize to string, deserialize when needed
16:24:03codicπŸ€”
16:24:04shashlicki don't miss random failures due to python types
16:24:05FromDiscord_<Rika> (i am joking)
16:24:15codicoh
16:24:17FromDiscord_<Rika> please do not do what i jsut said
16:24:21codicYeah, but I don't get how I would use object variants
16:24:23codiclol
16:24:44codic~~i'm doing it~~
16:24:50FromDiscord_<Rika> its just "if field has this value, the other fields are these and have these types, else this is that etc etc"
16:25:06Faulanderyeah, answers here are sometimes too, well perfect. takes some time to recognize the beauty in most of them (if you even understand the words)
16:25:50codicNo, I literally don't understand how to use em haha
16:26:30Faulanderyeah, i still have the problem all the time: i do understand it conceptually, but cannot implement it :)
16:27:21Faulandernim-playground helps alot ... try it out and post the link here if you're stuck. then you probably get the help you need.
16:28:23Yardanicocodic: you store an object variant in a sequence, and then where you need to process it you do different stuff based on the kind of that object variant
16:28:48Yardanicowith case statements usually (if also works but case statements are better since they check for exhaustion)
16:29:09madpata@codic @Faulander The Nim manual has a section on object variants (https://nim-lang.org/docs/manual.html)
16:29:21Yardanicohttps://nim-lang.org/docs/manual.html#types-object-variants
16:31:24*silvernode joined #nim
16:35:09FromDiscord_<sealegs> @Yardanico, I haven't tested a bot running for days or weeks, but if you put your computer to sleep for long periods of time the library will manually throw an error, I'm planning on maybe just do a hard reset.
16:35:33Yardanicowell I'm asking for ircord
16:35:40Yardanicowhich is an IRC<->Discord bridge
16:39:21*hax-scramper quit (Read error: Connection reset by peer)
16:39:40*hax-scramper joined #nim
16:40:07codici saw the manual, it doesn't explain it
16:40:07codicCould anyone show an example?
16:40:10*rockcavera quit (Read error: Connection reset by peer)
16:40:23codic(yes, i'm on matrix now because it beats both discord and irc)
16:40:32*rockcavera joined #nim
16:40:32*rockcavera quit (Changing host)
16:40:32*rockcavera joined #nim
16:40:55Yardanicocodic: example of what?
16:40:59Faulanderok, i came so far as to create this: https://play.nim-lang.org/#ix=2jmX
16:41:00YardanicoJSON itself uses object variants for example
16:41:47codicOf object variants
16:41:47codicAh, thanks Faulander!
16:41:49Faulanderhow do i group different nodes together?
16:41:56YardanicoFaulander: just create a normal seq
16:41:58Yardanicoseq[Node]
16:42:21Yardaniconim compiler itself uses object variants for AST
16:42:41Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L723
16:42:50codicalright. so from what I can tell, an object variant is a type of key val pair?
16:42:55*hax-scramper quit (Read error: Connection reset by peer)
16:42:56Yardanicocodic: not really
16:43:13Yardanicoit's an object with a special field for determining the object kind
16:43:15*hax-scramper joined #nim
16:43:22Yardanicoand depending on that kind the object might have different fields "activated"
16:43:40Yardanicoyou can google "tagged union"
16:44:05Yardanicohttps://en.wikipedia.org/wiki/Tagged_union there's a nim example here too
16:44:20codicah. could it not also be used for key val?
16:44:30Yardanicocodic: not for arbitrary key/val
16:44:45Yardanicoit's declared in your source code
16:44:57Yardanicofor arbitrary key/val just use "json" module or something like that I guess
16:45:00codicthat's true
16:45:12codicWhy not tables?
16:45:13Yardanicoor just do TableRef[string, MyObj] where string is the key and MyObj is your object variant
16:45:51codicWhy not a regular table, without any object variants?
16:46:18codicπŸ˜›
16:46:31Yardanicoif you need string->string mapping, ok
16:46:36Yardanicoif you need actual types - object variants
16:46:50codicah k, thanks
16:47:05Yardanicothere's also "strtabs" module for string tables specifically
16:47:09codicI really think that I should understand other concepts of Nim before going into object variants... πŸ˜…
16:47:14codicah
16:47:16Faulandercodic: this should get you going: https://play.nim-lang.org/#ix=2jmX
16:47:44codicYeah, I saw that
16:47:58Yardanicohttps://github.com/nim-lang/irc/blob/master/src/irc.nim#L85 for another example
16:47:58Faulanderoops, my code vanished
16:48:04Faulanderi wrote a complete example :)
16:48:16codicoh haha
16:49:03*codic sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/CYlaZCYIEJfNwPaNHPRtXAFn >
16:49:12codicOof, "long message"
16:49:17Yardanicoit's fine
16:49:22codicBut why double ticks?
16:49:26Yardanicofor documentation
16:49:27codicFor comments
16:49:36Faulandernow: https://play.nim-lang.org/#ix=2jmZ
16:49:37Yardaniconim has automatic documentation generator
16:49:38Yardanicoand it's RST
16:49:49codicFor example: "the ``kind`` field is the discriminator"
16:49:58FromDiscord_<codic> πŸ‘ that's great
16:50:02Yardanicosee https://nim-lang.org/docs/tables.html#%5B%5D%2CTable%5BA%2CB%5D%2CA_2
16:50:06Yardanicot[key] here is in a different font
16:50:15Yardanicoand if you go to https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/tables.nim#L364 it uses double ticks for that
16:50:34codicOhhhhh
16:50:44codicWhy not follow single backticks, like the markdown convention?
16:50:56YardanicoRST is not markdown
16:51:05codicoh rst
16:51:07codicIgnore me
16:51:13codici'm stupid, sorry πŸ˜…
16:51:36Yardanicoalso see https://forum.nim-lang.org/t/4280
16:51:46Yardanicothe main problem is that literally all nim documentation already uses RST
16:51:49Faulanderits so funny, you are where i was a week ago.
16:51:57Faulanderi asked almost the same questions
16:53:53companion_cubeI think pandoc can convert from rst to markdown
16:53:57companion_cubebut it might be lossy :(
16:54:44Faulanderi use mddoc
16:55:39Faulanderhttps://github.com/faulander/nimQBittorrent (this is done with mddoc)
16:55:41*natrys quit (Ping timeout: 265 seconds)
16:55:58Yardanico"METHODS" ?
16:56:01Yardanicothey're procs :P
16:56:43Faulanderremember: one week! ;)
16:57:05Faulanderand methods is understood no matter what language you're used to! :)
16:58:01codicbut functions
16:58:04codicfunc = proc
16:58:07codiclol
16:58:07Yardanicocodic:
16:58:08Yardanicono
16:58:13Yardanicofunc in nim is different from proc
16:58:19codicOh?
16:58:22Yardanicoand it's actually the better meaning than in most other languages
16:58:24codicSomeone said it was an alias for proc
16:58:29Yardanicoit's not
16:58:33Yardanicohttps://nim-lang.org/docs/manual.html#procedures-func
16:58:39Yardanicoit's an alias for proc with {.noSideEffects.} pragma
16:59:00Yardanico*noSideEffect
16:59:07Yardanicoand about this pragma - https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma
16:59:09codicah, what does that pragma do?
16:59:24Faulanderthats all not needed, i wrote a library, even used macros and templates and don't know nothing about all that ;) It will all come with time, just start coding.
16:59:27FromDiscord_<Technicae Circuit> Is proc better then func?
16:59:34Yardanicoit's not "better"
16:59:37Yardanicothey're just different
16:59:49Yardanico"func" is just an alias for proc with noSideEffect pragma so you can have less verbosity in your code :P
16:59:55codicso if you had `func a() = echo 'test'`
16:59:56codicThat'd be the same as
17:00:00Yardanicothat won't work
17:00:03Yardanicoecho has side effects
17:00:12FromDiscord_<Technicae Circuit> Oh?
17:00:18Yardanicoread https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma again :P
17:00:25Yardanico"echo" has an IO side effect
17:00:37YardanicodebugEcho is the one which can be used in "func" routines, but only for debugging really
17:00:38codic`proc a(): {.noSideEffects.} = echo 'test'`
17:00:39FromDiscord_<Technicae Circuit> So proc would be a bit better for general use cases?
17:00:47Yardanicocodic: yeah that would be around the same
17:00:52codicAh, so func isn't really needed?
17:00:58Yardanicocodic: it's just sugar
17:01:09Yardanico@Technicae Circuit if you don't modify global variables or stuff you can use func to explicitly state so
17:01:13nisstyreit adds some optimization opportunities right?
17:01:24Yardaniconim also has stuff like effects/tags tracking
17:01:27nisstyrelike you can safely assume that f(1) == f(1) always
17:01:27solitudesfno, its just more static checks
17:01:32codicSo there wouldn't be a need for it for an average usecase
17:01:36Yardanicohttps://nim-lang.org/docs/manual.html#effect-system
17:02:10codicah
17:02:11solitudesfyou cant really assume that, since you can override sideeffect tracking
17:02:23nisstyrethen what's the point of having pure functions?
17:02:27codicwell, for most use cases
17:02:29Yardaniconisstyre: if you want to :P
17:02:49nisstyreYardanico: I know but what's the point of indicating to the compiler that they're pure?
17:02:51YardanicoI personally almost never use func (and noSideEffect pragma itself), because it's not that useful for me
17:02:54*silvernode quit (Ping timeout: 240 seconds)
17:02:54solitudesfto ensure thay your code is side effect free
17:02:58Yardaniconisstyre: they're not "pure" in the mathematical sense either
17:03:04nisstyreok, side effect free
17:03:05solitudesfto accidentally not introduce side effect?
17:03:10Yardanicoyeah that
17:03:11nisstyreI guess that's fair
17:03:51codicimport sugar, sequtils
17:03:51codicecho @[1,2,3].map((t)=>t*2) # ==> [2,4,6]??
17:04:02Yardanico?
17:04:05FromGitter<alehander92> it can still help you check you havent used globals or IO or stuff like that
17:04:07codiclol
17:04:10FromDiscord_<codic> Would that work?
17:04:16FromGitter<alehander92> basically if you can use func, use func, if not proc
17:04:20*natrys joined #nim
17:04:20Yardanico!eval import sugar, sequtils; echo @[1,2,3].map((t)=>t*2)
17:04:21FromGitter<alehander92> similar with let and var
17:04:22FromGitter<alehander92> i think
17:04:22NimBot@[2, 4, 6]
17:04:27Yardanicothere's also mapIt though
17:04:34FromGitter<alehander92> not that i do it .. but it seems as a good practice
17:04:35FromDiscord_<codic> yeah, yay
17:04:38Yardanico!eval import sequtils; echo @[1, 2, 3].mapIt(it * 2)
17:04:40NimBot@[2, 4, 6]
17:04:43codic!eval echo "TEST HELLO WORLD"
17:04:45NimBotTEST HELLO WORLD
17:04:52Yardanico!lag
17:04:52NimBot16ms between me and the server.
17:04:53FromDiscord_<codic> Pretty cool
17:04:56FromDiscord_<codic> Let's see if it works from discord
17:05:00FromDiscord_<codic> !eval echo "TEST"
17:05:00Yardanicoit does
17:05:02NimBotTEST
17:05:06FromDiscord_<codic> oh, nice
17:05:08Yardanicoit just uses play.nim-lang.org for code compilation btw
17:05:12FromDiscord_<codic> but less latency with matrix
17:05:17FromDiscord_<codic> ah, good way to sandbox
17:05:25Yardanicowell nim doesn't have a real "eval" anyway
17:05:30Yardanicoat runtime I mean
17:05:38FromDiscord_<codic> yeah, it's a compiled language, makes sense
17:05:41*xcm quit (Remote host closed the connection)
17:05:50Yardanicoalthough you can use compiler as a library xd
17:05:59FromGitter<alehander92> it kinda can have it if you import the nimscript
17:06:00FromGitter<alehander92> yeah
17:06:07FromGitter<alehander92> but its limited
17:06:08FromDiscord_<codic> !eval write(stdout, "Does this support input? "); echo(readLine(stdin))
17:06:10NimBot/usercode/in.nim(1) in↡/playground/nim/lib/system/io.nim(365) readLine↡/playground/nim/lib/system/io.nim(141) raiseEOF↡Error: unhandled exception: EOF reached [EOFError]↡Does this support input?
17:06:19FromDiscord_<codic> Welp
17:06:33FromDiscord_<codic> ")
17:06:35FromDiscord_<codic> :(
17:06:47Yardanicohow would it though?
17:06:53Yardanicothere's also nim on https://godbolt.org/
17:06:59Yardanicoand on a few other "online repl" websites
17:07:56*xcm joined #nim
17:08:51FromDiscord_<codic> yeah, like repl.it
17:08:55FromDiscord_<codic> I dont know
17:09:07Yardanicoon other note, nim really has A LOT of different features and modules in stdlib, and some of them are underused but cool
17:09:13Yardanicolike https://github.com/Yardanico/nim-strenc uses term-rewriting macros
17:09:29Yardanicohttps://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim
17:09:46FromDiscord_<codic> I hqve never understood why macros qre needed, tbh
17:09:57Yardanicomacros are needed to create DSLs and stuff
17:10:02Yardaniconim async itself is done via macros
17:10:07Yardanicoasync in nim*
17:11:07FromDiscord_<codic> Ah,ok
17:11:19Yardanicoyou can really do a lot of stuff with macros, A LOT :P
17:11:52Yardanicoas long as some code is valid nim syntax you can use handle it in macros
17:12:43FromDiscord_<codic> Great!
17:13:34*oculux quit (Ping timeout: 240 seconds)
17:14:22*oculux joined #nim
17:18:05*opal quit (Quit: No Ping reply in 180 seconds.)
17:18:43FromGitter<alehander92> if you want to make random syntax does stuff
17:18:46FromGitter<alehander92> you can use macros
17:19:01FromGitter<alehander92> makes syntax go brrr
17:19:18FromGitter<alehander92> probably not a good meme..
17:21:26FromDiscord_<Rika> its a good meme
17:21:33FromDiscord_<Rika> i rate it an 8/10
17:22:00FromDiscord_<Rika> "NOO YOU CANT JUST CHANGE SYNTAX ALL WILLY NILLY LIKE THAT"
17:22:01FromDiscord_<Rika> "haha macro system go brrr"
17:23:58*sz0 joined #nim
17:26:03*oculux quit (Read error: Connection reset by peer)
17:26:14*sagax quit (Ping timeout: 240 seconds)
17:27:04FromDiscord_<Venator> how do I represent a C void* in Nim?
17:27:20*oculux joined #nim
17:33:20Yardanico"pointer"
17:33:45Yardanico@Rika well you can't really change "syntax"
17:34:22Yardanico"While macros enable advanced compile-time code transformations, they cannot change Nim's syntax. However, this is no real restriction because Nim's syntax is flexible enough anyway."
17:37:39Yardanicobecause if some code isn't valid nim syntax you wouldn't be able to make AST for it
17:38:00Yardanicobut for example it just happens that almost all of Python syntax is also valid nim syntax :P
17:40:22*lritter quit (Quit: Leaving)
17:49:08disruptekshould default() behave static?
17:50:16FromDiscord_<Rika> Yardanico: its just a meme, and in other languages, macros can change syntax
17:50:25Yardanicowhat languages?
17:50:32Yardanicolisp family languages don't really have syntax
17:50:40FromDiscord_<Rika> i dont know, i heard lisp can
17:50:41Yardanicoand in other languages you can't really change syntax
17:50:42FromDiscord_<Rika> i mean
17:50:46FromDiscord_<Rika> thats a technicality
17:55:41*lritter joined #nim
18:05:14*dddddd joined #nim
18:05:54Faulanderi tried to wrap my head around lisp in school, 30 years ago, my professor was a hardcore lisp fan. this is too abstract for me to understand.
18:16:14*xcm quit (Ping timeout: 240 seconds)
18:18:21*xcm joined #nim
18:21:54YardanicoFaulander: well I tried scheme a bit and it's not that complicated
18:22:02*werbs joined #nim
18:22:11*abm joined #nim
18:26:33FromDiscord_<Joshua S. Grant> Faulander: Play around with Emacs; I'm not kidding. Elisp is not the best implementation of a Maclisp-like out there but certainly had a TON of fun messingabout with it in my mid-to-late teens. Emacs, more than anything else, pushed my interest into STEM -- in my 'formative years'. lol
18:27:51Faulanderit was more than 30 years ago, back then i was more interested in assembler than anything else.
18:28:46FromDiscord_<Joshua S. Grant> I mean, fair-enough; I just don't vibe with the notion of it 'being too abstract' -- I find it more likely there just wasn't a killer-app / driven purpose to learn it. :^P
18:28:54Faulanderassembler isn't abstract, this i can understand. the "higher" languages never appealed as much to me as assembler.
18:29:07*silvernode joined #nim
18:29:32Faulanderat least back then, assembler was put to good use in my *cough* not so legal activities *cough*
18:29:40Yardanicohacks?
18:29:53FromGitter<bung87> I thought higher language is more easier to understand ,right?
18:29:56Faulanderreplace the h with a cr ;)
18:30:05Yardanicowell the same mostly :P
18:30:10Yardanico@bung87 well it depends really
18:30:38FromDiscord_<Joshua S. Grant> @bung87 I think the argument is that literally "it's straight-foward" to what the machine's actual instructions are and not hidden between semantics / keywords?
18:30:43FromGitter<bung87> I starting programming from js
18:30:48Faulanderit depends on the wiring of your mind ... for me assembler - at least the old 8bit ones - is much, much easier to understand.
18:30:55Yardanicowell yeah
18:31:05Yardanicobut x86 and x86_64 literally have hundreds of instructions
18:31:05FromDiscord_<Rika> oh man i used to hack mobile games so i had to understand arm assembly
18:31:21Faulanderthats why i clearly said "8bit" :D
18:31:34FromGitter<bung87> hmm I got your point.
18:31:37FromDiscord_<Joshua S. Grant> Oh, actual Nim question! Godot-nim seems to be relatively complete -- but I can't find any demos / examples anywhere; Am I missing something or has this just not been a focus?
18:32:10FromDiscord_<Rika> its not really a focus i dont think, i rarely see questions about it here
18:32:16Yardanicowell the company which created godot-nim use it for their in-house game
18:32:32Yardanicothey've made UE4 bindings before but then decided that Godot was a better fit for their 2D game
18:32:53Yardanicothere's a simple example here https://github.com/pragmagic/godot-nim-stub
18:33:00FromDiscord_<Joshua S. Grant> Ah, so there's no real incentive to provide 3rd-party examples when they're dogfooding a game themselves? That's fair-enough I guess
18:33:07FromDiscord_<Joshua S. Grant> Also, cool will check that out
18:34:09FromDiscord_<Joshua S. Grant> Nim seems like such an obvious choice for a gamedev language; that it's crazy I don't see more hype behind it here -- I remember there being frag a few years ago, when I first checked the ecosystem; but seems to have died since
18:35:13FromDiscord_<Recruit_main707> to my knowledge, godot-nim is still not working, ue4 nim is outdated and we only have bare opengl vulkan and sdl2
18:36:02Yardanicowdym "godot-nim is still not working"?
18:36:39FromDiscord_<Recruit_main707> last time i tried using it it didnt work
18:36:48Yardanicowell maybe you did something wrong :P
18:36:54Yardanicoand we have SFML bindings too
18:36:58Araqfork it, make it work, create a PR so that it's an "important package"
18:37:07FromGitter<awr1> hello
18:37:11FromDiscord_<Joshua S. Grant> There seems to of been 58 'releases' on their github; But hasn't really been touched in 3 months -- I would assume it was relatively mature at this point (that they don't need constant pushes to it)?
18:37:12Yardanicohttps://github.com/search?o=desc&q=language%3Anim+game&s=stars&type=Repositories
18:37:14*narimiran joined #nim
18:37:23FromGitter<awr1> RE first languages: TI-BASIC was my first
18:37:25*martinium joined #nim
18:37:28Yardanicoalso see https://github.com/Vladar4/nimgame2
18:37:31FromDiscord_<Recruit_main707> Araq, its easy to say, but i am more or less newbie to nim yet
18:37:44*liblq-dev quit (Read error: No route to host)
18:38:09FromDiscord_<Joshua S. Grant> The name, it pains me lol
18:38:12FromDiscord_<Joshua S. Grant> 'nimgame2'
18:38:18Yardanicoseems okay for me
18:38:22FromDiscord_<Recruit_main707> about SFML, cant we make nim appear in here? https://www.sfml-dev.org/download/bindings.php
18:38:27Yardaniconot really
18:38:34Yardanicoah wait
18:38:35martiniumHello everyone
18:38:36Yardanicoit's already there
18:38:37martiniumHappy Friday
18:38:54*FromDiscord_ <Joshua S. Grant> waits for someone to make the arguably more painful -- nimtendo
18:38:55FromDiscord_<Recruit_main707> Yardanico: good call, im so blind
18:38:56kungtotteMy first language was the homegrown scripting language for the game Operation Flashpoint. It had a ternary operator and goto as its only control flow mechanisms
18:39:13FromDiscord_<Recruit_main707> martinium hi
18:39:27Yardanicoit wasn't updated in 17 months but it shouldn't be hard to update it to whatever the last SFML release is https://github.com/oprypin/nim-csfml
18:39:28FromDiscord_<Rika> kungtotte, ouch
18:39:34Araqhmm I'm a compiler dev and found a recursion algorithm where I'm unable to eliminate the recursion
18:39:36*oculux quit (Ping timeout: 265 seconds)
18:39:47Araq*recursive algorithm
18:40:01AraqI think I'm a bad compiler writer.
18:40:16FromDiscord_<Recruit_main707> facts say you are not though
18:40:48martiniumgreat compiler devs always think they are terrible compiler devs
18:40:58Yardanicoi always think that all compiler devs are great :P
18:41:02*liblq-dev joined #nim
18:41:14FromDiscord_<Rika> great (insert skill 1) people think they are terrible (insert skill 1) people
18:41:25martiniumAraq, where you get started with compiler dev stuff? College?
18:41:43Yardanicouniversity maybe?
18:42:10kungtotteRika, yeah it was Good Times(tm). You wrote code like ? (somecondition) : goto "true_label"
18:42:12FromGitter<bung87> guess TI-BASIC and flash guys are not young
18:42:29Yardanicokungtotte: that's still not the worst I guess
18:42:41kungtotteOh it's not the worst, but it was pretty terrible
18:43:13kungtotteYou made "blocks" by beginning with a label, then write your code, and end with a goto "continue"
18:43:18Araquniversity but I wrote interpreters with 18 fwiw
18:43:25kungtotteIf you missed that last goto it would just keep going
18:43:30kungtotteAlso no looping constructs
18:43:43kungtotteSo loops were written like #loop; code here; sleep 0.1; goto "loop"
18:43:50companion_cubeAraq: derecursification is a thing, but ugly af
18:43:57FromDiscord_<Rika> isnt "goto firstlabel" essentially a looping construct
18:44:05companion_cube(sorry, I imagineyou know it better than me)
18:44:14kungtotteThe sleep was necessary because it had no concept onf scheduling or threads, so without the sleep it would just pin the CPU and bog the game down
18:44:38kungtotteRika, right, I meant it had no for/while or anything like that. You rolled your own loops
18:44:41Araqwell I can translate it into push/pop opcodes and a virtual machine, companion_cube ;-)
18:44:42FromDiscord_<Rika> man that legit sounds awful
18:44:51FromGitter<awr1> way back in my high school math classes, i understood the math but was always messy with my arithmetic (forgetting to do a certain operation, etc.) so I made programs on my TI-84 and learned how to use the internal BASIC interpreter to automate a lot of the more annoying stuff in trigonometry, etc. TI-BASIC was crappy but it was insanely useful
18:45:26kungtottePeople wrote really complicated stuff in that language. They eventually replaced it with a better version that had things like functions, if/then/else, and for/while
18:45:45FromGitter<awr1> and now i (well, almost, i'm just waiting for it in the mail at this point) have a diploma for a bachelors in CS, so thank you TI-BASIC
18:49:50Araqkungtotte: if/then/else and for/while? you mean they added language features and the language became easier to use? but what about that "perfection is when you cannot remove features" and "less is more"? heresy, we should all use languages without features ;-)
18:50:37kungtotteAraq: it was more about removing footguns :P I don't mind goto, except when it's the -only- control flow option :P
18:50:47*waleee-cl joined #nim
18:52:53*lritter quit (Quit: Leaving)
18:53:24Araqafter all, what if somebody smarter than you comes along and uses these features to their full capacity... the horror.
18:54:11*silvernode quit (Ping timeout: 256 seconds)
18:54:19FromDiscord_<Recruit_main707> Yaradinco: `Invalid GODOT_BIN path: C:\Users\porra\OneDrive\Escritorio\Godot_v3.1.2-stable_win64.exe`
18:54:49Yardanicotry not to use OneDrive I guess
18:54:54Yardanicoand try to remove _ :P
18:55:08FromDiscord_<Recruit_main707> that came by default
18:57:16Araqfix the damn build so that it doesn't use environment variables, so annoying
18:57:39disruptekis enum position variant for enums with holes?
18:58:14disruptekenum.sym.position ...
19:00:20YardanicoAraq: well it uses that to generate API
19:00:32Yardanicohttps://github.com/pragmagic/godot-nim/blob/master/godot/godotapigen.nim
19:00:43Araqdisruptek: e.position it its ordinal value
19:00:55Yardanicoit gets JSON api description from that godot binary and uses it
19:01:38Araqoh not that again
19:02:07Araqdon't generate Nim code on the user's machine, it makes QA impossible...
19:02:32Araqgenerate it on your machine and push the Nim code to github. ffs...
19:03:19disruptekthanks.
19:08:37*werbs quit (Ping timeout: 240 seconds)
19:15:51*hax-scramper quit (Read error: Connection reset by peer)
19:17:00*hax-scramper joined #nim
19:24:31*couven92 quit (Read error: Connection reset by peer)
19:24:58*couven92 joined #nim
19:27:05*vesper quit (Quit: ZNC 1.7.5 - https://znc.in)
19:27:23*vesper11 joined #nim
19:28:54*hax-scramper quit (Ping timeout: 265 seconds)
19:30:19*NimBot joined #nim
19:30:41*martinium quit (Quit: Leaving)
19:50:13FromDiscord_<Recruit_main707> https://play.nim-lang.org/#ix=2jon how is this looking?
19:50:34FromDiscord_<Recruit_main707> im not sure if i got generics & shit correctly
19:50:46FromDiscord_<Recruit_main707> hol up
19:51:01FromDiscord_<Recruit_main707> nvm
19:51:28FromDiscord_<Recruit_main707> (the question is still up) :P
19:53:15leorizeI'm seeing capitalized proc names
19:53:33leorizeand non type-safe conversions?
19:53:37leorizecasting*
19:54:05FromDiscord_<Recruit_main707> about capitalized, im just transpiling as 1:1 as i can :p
19:54:14FromDiscord_<Recruit_main707> about casting, how would you?
19:54:19narimirandon't.
19:54:21Yardanicoit depends on what you want to do
19:54:33FromDiscord_<Recruit_main707> this are flatbuffers
19:55:03*xcm quit (Killed (card.freenode.net (Nickname regained by services)))
19:55:12leorizewithout seeing the original code, I can't comment on this
19:55:23leorizebut I'm pretty sure that some casts here are just plain wrong
19:55:34leorizeat least with the unconstrained generics
19:56:53*xcm joined #nim
19:57:39FromDiscord_<Recruit_main707> https://github.com/google/flatbuffers/blob/master/go/encode.go from line 135 to the end, the point is to make them generics
19:59:03FromDiscord_<Recruit_main707> also, i was told byte operations are not efficient.
19:59:24leorizeyea this is completely wrong, sorry
19:59:31leorizewdym by bytes operations not efficient?
19:59:59FromDiscord_<Recruit_main707> shl and shr
20:00:07FromDiscord_<Recruit_main707> whats wrong though?
20:00:11leorizethey are efficient?
20:00:24leorizebut shl works on bits, not bytes
20:00:33FromDiscord_<Recruit_main707> bits sorry :P
20:00:40leorizewhat do you expect WriteVal to do?
20:00:42Yardanicooperations on bits are as efficient as they can be
20:00:44Yardanicoalso see https://github.com/Skrylar/skflatbuffers
20:00:49Yardanicohttps://github.com/Skrylar/skflatbuffers/blob/master/skflatbuffer.nim
20:01:50leorizeskrylar[m] cracked this long ago? damn :P
20:01:56FromDiscord_<Recruit_main707> this is what the flatbuffers for c creator told me:
20:01:57FromDiscord_<Recruit_main707> > If you don't care about performance, you can easily use byte shift operations to have endian neutral behaviour, but you likely don't want that.
20:02:48narimiranleorize: while you're here, maybe you know: how do i escape `'` in init.vim?
20:03:01leorizebyte shift is definitely not the same as bit shifts
20:03:07*hax-scramper joined #nim
20:03:17leorizenarimiran: wdym by escape?
20:03:20leorizein a string?
20:03:23leorizethen you don't have to?
20:03:42FromDiscord_<Recruit_main707> i know very little about them, forgive my ignorance
20:04:22narimiranleorize: i have something like `'foo': 'bar'`, and i want to have `'foo': '\'bar'`
20:04:23leorizeI don't know much either
20:04:39leorizeRecruit_main707: though I think he was talking about bit shifts
20:04:45leorizegotta look up real quick
20:04:55leorizenarimiran: "'bar"?
20:05:06leorizeor if you like it the pascal way: '''bar'
20:05:26narimiranwait, are you telling me that double quotes just work?? why didn't i try that??
20:05:34FromDiscord_<Recruit_main707> '\'bar' shouldnt this also work though?
20:05:48narimiran(is that a 3x single quote in the second example?)
20:05:50FromDiscord_<Recruit_main707> damm it discord
20:06:07leorizenarimiran: yes
20:06:08narimiran`'\'bar'` doesn't work
20:06:42narimiranthanks, let me try if i can make it work....
20:07:16liblq-devleorize: nim.nvim is highlighting NPeg's fail() both as an error and as a template… lol
20:07:19leorizeRecruit_main707: idk, bitshifting is as efficent as it can be
20:07:35leorizeliblq-dev: don't blame me :P blame the compiler
20:07:48liblq-devnot blaming you ofc, it's nimsuggest
20:08:01FromDiscord_<Recruit_main707> leorize: its not a viable solution for generics though :P
20:08:24leorizewdym? :P
20:09:10FromDiscord_<Recruit_main707> if you want the lame question:
20:09:10FromDiscord_<Recruit_main707> how can i make all of those Write... functions in Nim (with generics)
20:11:06leorizeah, I get what that guy mean now
20:11:35narimiranleorize: yep, that will work! thanks!!
20:13:15*couven92 quit (Ping timeout: 250 seconds)
20:15:56FromDiscord_<Disciple> Is there a way to get the compiler to print warnings for exceptions that aren't handled?
20:16:13Yardanicoyes
20:16:22Yardanicobut it will error instead though :P
20:16:30Yardanicoadd {.raises: [].} to a proc definition or something else
20:16:36dom96how's everybody doing?
20:16:40Yardanicoand compiler will error if some exception can be raised
20:16:47dom96After doing some research I think I'm going to try and implement spatial hashing for my game
20:17:37*couven92 joined #nim
20:22:03FromDiscord_<Recruit_main707> leorize: u there?
20:22:27leorizeyea I figured out an efficient way but it's not pretty, mind you
20:22:27Yardanicoyou can use
20:22:29Yardanico!seen leorize
20:22:30disbotleorize spoke in 12#nim 2 seconds ago
20:22:36Yardanicohm
20:22:37Yardanico!help
20:23:29FromDiscord_<Recruit_main707> id rather have a fast and ugly solution than an slow one
20:23:48*fredrik92 joined #nim
20:25:25*a_b_m joined #nim
20:25:43leorizeto be fair, "slow" is an overstatement
20:25:58leorizein typical usage, you'd not even notice
20:26:13leorizeyou gotta do actual benchmarks to see how "slow" or "fast" this is
20:26:55*couven92 quit (Ping timeout: 260 seconds)
20:27:09FromDiscord_<Disciple> Raises works well, but what about standard library functions? Ie writing to a file
20:27:14FromDiscord_<Rika> Ah yes, premature optimization
20:27:15*letto_ joined #nim
20:28:06*abm quit (Ping timeout: 256 seconds)
20:28:16FromDiscord_<Recruit_main707> https://tenor.com/view/iwanna-see-it-show-me-let-me-see-iwant-to-see-big-boi-gif-13800468
20:28:36*letto quit (Ping timeout: 256 seconds)
20:28:56leorizeRecruit_main707: here's the "optimized" one. tbf you should compare it with a normal one to see if this is even an optimization: https://play.nim-lang.org/#ix=2jox
20:29:18leorizewithout comparision this might just be an overcomplicated way to implement this
20:30:34FromDiscord_<Recruit_main707> it does look ugly, but seems pretty good if we ignore that
20:31:09leorizethis is as efficient as I can think of in theory
20:31:20FromDiscord_<Rika> Might not be worth the maintenance cost for the performance if gains
20:31:30FromDiscord_<Rika> It*
20:31:37leorizeif you want "super micro optimization", you gotta pull out the profiler and instrument the individual instructions themselves
20:31:52FromDiscord_<Recruit_main707> Rika: this wont be changed in a long time
20:32:12*exigirl joined #nim
20:33:37leorizethat's just writeval
20:33:43leorizeyou gotta implement getval yourself
20:34:02FromDiscord_<Recruit_main707> get val wont work already??
20:34:13leorizenope
20:34:19leorizeyou implemented it wrong :P
20:34:35*sagax joined #nim
20:34:45FromDiscord_<Recruit_main707> gimme a little clue pls
20:34:57*exigirl quit (Client Quit)
20:35:02leorizeyou don't `cast` a `seq`
20:35:10leorizeit's not a byte buffer
20:35:11*letto_ is now known as letto
20:35:30FromDiscord_<Recruit_main707> and an openArray?
20:35:30leorizethe seq contains more than just the byte buffer I mean
20:35:40leorizesame thing applies here
20:35:48leorizejust see how I implemented WriteVal
20:35:59FromDiscord_<Recruit_main707> hmmm, so its not gonna be that easy :P
20:37:49FromDiscord_<Recruit_main707> yeah, its basically applying the same but as getter
20:37:54FromDiscord_<Recruit_main707> thank you
20:38:33leorize[m]https://godbolt.org/z/zedYJO
20:38:43leorize[m]yep, this really is as efficient as it gets, on an x86
20:39:05FromDiscord_<Recruit_main707> nice
20:39:22*narimiran quit (Quit: leaving)
20:39:44Yardanicoleorize[m]: seems like it got inlined?
20:39:45Yardaniconice
20:39:52Yardanicoah
20:39:54Yardanico{.inline.}
20:40:32leorizetook literally 0 instructions :)
20:41:32*abm joined #nim
20:41:32Yardanicono code - most performant code
20:44:18*a_b_m quit (Ping timeout: 265 seconds)
20:45:13dom96Researching this more I appear to already be using a spatial hash. lol.
20:46:29*natrys quit (Quit: natrys)
20:48:02*sagax quit (Remote host closed the connection)
20:48:31*Trustable joined #nim
20:50:17*couven92 joined #nim
20:54:03*a_b_m joined #nim
20:56:11*sagax joined #nim
20:57:15*abm quit (Ping timeout: 240 seconds)
21:03:15*couven92 quit (Ping timeout: 240 seconds)
21:23:17FromDiscord_<Varriount> leorize: Something I found out about Godbolt - it doesn't do linking, so any external functions get the odd "lea eax [rip+0x0]" and similar.
21:24:27leorizein the "options" menu it has the button to make it generate executable
21:29:25FromDiscord_<Varriount> leorize: I think that just runs the binary, it doesn't affect the assembly output. I still find `lea rdi,[rip+0x0] ` littered throughout the code, which doesn't match up with what I see from objdump locally
21:31:36leorizewell I activated "compile to binary" and I see `call` all over the place :P
21:32:01FromDiscord_<Varriount> Yeah, but do you see any calls to things like `echo`?
21:34:36leorizeI do see calls, but it calls some arbritary address instead
21:35:34leorizealso we don't have line correspondance with the asm here
21:36:09FromDiscord_<Varriount> If you use --linedir:on --debugger:native you get a (fairly inaccurate) asseembly map
21:36:43FromDiscord_<Varriount> You can make it slightly more accurate by puttin 2-3 blank lines between all lines containing actual code.
21:36:59*dchem quit (Ping timeout: 265 seconds)
21:47:10FromDiscord_<Varriount> Anyone know what needs to be passed to the compiler to dump the generated code of async procedures?
21:47:33disruptekexpandMacros
21:53:55*dchem joined #nim
21:55:10shashlickdisruptek: wanted to discuss the plugins issue with nimterop
21:57:16disruptekwhat?
21:57:20disruptekplugins?
21:57:54shashlickthe nimph issue where nimcache / nimblePath / path don't get passed to the plugin compile step
21:58:06disruptekwhat do you propose?
21:58:09shashlickso i was thinking about the design
21:58:36shashlickwe have std/compilesettings from which I can get nimcache, nimblePaths and lazyPaths
21:59:05shashlickbut i have no way to know if this is default values or if they are custom for that call
21:59:25disruptekwhat does that mean?
21:59:37disruptekwhat's the difference?
21:59:57disruptekthese are values set by the configuration, wherever it may occur, right?
22:00:20shashlickit means either I always propagate what i got even if nothing was changed from defaults or i run a nim dump and diff the changes
22:00:37disrupteki guess maybe you load the nim.cfg from the compiler to determine the "defaults", but it's hacky.
22:00:58shashlicki can run nim dump in json and get all the info i need but will have to do that diff
22:01:15disrupteki dunno what you mean by "propogate what i got"
22:01:20shashlickanother thing is that if you use the cImport() method, I know the nim flags received and can forward it to toast
22:01:39disruptekyou are trying to reuse the cache if no settings changed?
22:02:02shashlickso when you call nim c wrapper.nim, it picks up the flags
22:02:17shashlickthen the wrapper calls toast behind the scenes with CLI arguments
22:02:28shashlicktoast now might need to compile a plugin behind the scens
22:02:29shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/getters.nim#L720
22:02:55shashlickthat's the step that breaks since toast just runs nim as if no local deps were detected
22:03:09shashlickand since it is in nimcache, there's no nim.cfg in effect
22:03:29shashlickso I need to detect the correct flags in wrapper.nim, forward to toast who will forward it back to nim
22:03:43shashlickbut this design does not solve the issue when you just run toast directly
22:03:53shashlickthat will still fail unless toast is made smart enough to figure this out
22:04:15shashlickconsidering you have nim.cfg functionality within nimph, was wondering what your thoughts were around this
22:04:19disruptektoast could learn how to parse the config too, i guess.
22:04:26disrupteki mean, this is what tools do.
22:04:58shashlicknote also that wrapper.nim (in $projectDir) then imports cimport.nim which is in the deps directory which calls toast which calls nim on some file in nimcache
22:05:12shashlickso we have to pass projectDir context all the way even in that case
22:05:15disrupteki understand your wrapper.nim solution. that sounds workable to me, but still pretty brittle compared to including the code post-generation.
22:05:59disruptekthe projectDir context gets picked up fine toast is local to it -- inside it.
22:06:02shashlickand nim doesn't make currentDir reliable to know projectDir settings i should be referring to
22:06:25shashlickin localdeps mode yes, but the same design has to work in ~/.nimble/pkgs mode as well
22:06:31FromDiscord_<Varriount> rayman22201: Are you around?
22:07:11disruptekit already works in pkgs mode, right?
22:07:36shashlickya but how does toast know it isn't in localdeps mode
22:07:40disruptekpkgs mode is that same mode. what matters is where you are located; nim picks up env settings from the env.
22:07:43shashlickor in some $NIMBLE_DIR or other nim.cfg mode
22:08:09disrupteklocaldeps mode /is/ nimble mode as far as the compiler is concerned.
22:08:22disruptekthey are all the same.
22:08:32disruptekto pretend otherwise is to make life hard.
22:08:38*Hexeratops joined #nim
22:09:54shashlickhow about this - when toast runs, it checks where it is - if it is in ~/.nimble/pkgs then it runs per usual
22:10:28disrupteki'm trying to tell you that your model doesn't match reality.
22:10:37disruptekyou're asking me to choose how to cover my eyes.
22:10:41shashlickwhat do you propose
22:10:46shashlicki'm telling you the challenges
22:10:53disruptekcan you think of a good reason not to do it the way i do it?
22:10:59disruptekbecause i chose my design for a reason.
22:11:10shashlicki don't know your design which is why i'm asking you
22:11:24disruptekmy design is to emulate the compiler in all evaluations of the env.
22:11:31disruptekthus, whatever works in the compiler, works in nimph.
22:11:35shashlicka) I need to know what $projectdir is and b) evaluate it
22:11:40disrupteknim dump
22:12:03disruptekto find the project dir itself, i search cwd and up.
22:12:14disrupteki try to find one and only one .nimble file.
22:12:28disruptekfirst one found, bam, that's my project dir.
22:12:59shashlickif a user runs toast in or within project dir, i can figure that out, sure but i do not know which file is the main.nim cause that's not what you pass to toast
22:13:03shashlickdo you need main.nim?
22:13:12disrupteknah.
22:13:25disruptekdo you need main.nim?
22:13:27shashlickcause i noticed `nim dump .` does something different from `nim dump main.nim`
22:13:40shashlicki don't for toast, it is operating on C headers
22:13:42disrupteknim dump some.nim will also eval some.nim.cfg
22:13:58disruptekit may set other paths.
22:13:58*a_b_m quit (Quit: Leaving)
22:14:03shashlickyou run just `nim dump .`?
22:14:12*solitudesf quit (Ping timeout: 265 seconds)
22:14:30disrupteksee `findPrefixDir` in src/nimph/config.nim
22:14:44disrupteki dump it in json with a dummy target file.
22:15:51shashlickokay so then i can build that into toast - it can do the same and get the env info and propagate it to the plugin compilation
22:15:59rayman22201Varriount what's up?
22:16:00disruptekit's annoying, right?
22:16:24shashlickon the command line, user would typically run it in the project dir - if not, toast can grumble that it's not in a project directory
22:16:45shashlickwhen run through cImport, i can pass the project directory to toast as a CLI param so it knows the context
22:16:56shashlickdo you have code detecting .nimble as well?
22:17:06disruptekyeah; from bump.
22:17:24disrupteknimph is a little smarter because it knows how to follow link files.
22:18:06shashlicki'd rather have just depended on nimph for this but considering nimph is depending on nimterop, not possible
22:18:26disruptekmaybe we make a pmtools lib.
22:19:02shashlickthat'll be awesome
22:19:30shashlickget nimble to use it as well eventually
22:19:47FromDiscord_<Varriount> dom96: In code generated from async procedures, what is the purpose of the AsynCcontinue closure?
22:19:53disruptekprobably nimterop /could/ depend on nimph.
22:19:53shashlickanyway, 2 things i need - figure out where .nimble is for project dir and the nim dump parsing which you pointed to already
22:20:30dom96Varriount: to continue the async iterator AFAIK
22:20:33dom96*IIRC
22:21:15disruptekthe .nimble finder is bump.findTarget("some directory", target = "optional package name")
22:21:39disruptekreturns tuple[message: string; found: Option[Target]]
22:21:48dom96shashlick, disruptek: pretty sure Nimble has functionality, why aren't you depending on it?
22:21:56disruptekTarget is a repo, package, ext: string tuple.
22:22:15disruptekbecause i'm a comedian and not a clown.
22:23:56shashlickdom96: nimble doesn't parse nim.cfg to figure out if user overrides nimcache, paths, nimbleDir and other stuff
22:24:06*liblq-dev quit (Quit: WeeChat 2.7.1)
22:24:18shashlicknow i'm wondering why i added compilesettings if nim dump is the solution anyway
22:24:33dom96sure, but it can find the .nimble file for you
22:24:46disrupteki doubt it works from any subdirectory.
22:25:42dom96*shrug*
22:26:06dom96The point is: use what's there and improve it instead of making a pmtools package and then getting Nimble to depend on it
22:26:23disruptekyou're right; they both sound like silly ideas.
22:34:23shashlickwhat does nimph use from bump?
22:34:37disruptekthe target stuff, the version stuff.
22:36:21shashlickso you created linkedFindTarget in nimph that uses findTarget from bump?
22:36:32disruptekyeah, probably.
22:36:36shashlickwould you consider moving it to bump?
22:36:47disruptekbump doesn't need to know about it, but, i dunno, maybe.
22:36:54disruptekcan it be moved?
22:37:05shashlickon the flip side, does even nimterop?
22:37:15shashlickwhat's the case for searching through link files?
22:37:17disrupteknimterop can just import from nimph.
22:37:37disruptekbecause it helps me find the actual repo for a package.
22:37:47disruptekthis is something that the compiler does, so i do it too.
22:38:09disrupteki think i was gonna use the compiler code for it by my stuff was simpler.
22:38:40shashlicki import compiler into toast anyway, where is this in compiler? it doesn't look for nimble files does it
22:38:53disruptekit has to follow link files.
22:39:01shashlickah
22:39:34FromDiscord_<Recruit_main707> whats the process behind cast?
22:39:57disruptektreat memory like the dirty memory it is.
22:40:26disruptekload the bullets into your foot-shooter and go to town.
22:41:13FromDiscord_<Recruit_main707> its because leorize told me i couldnt just cast a deq[byte] into a type, but i dont know how would you do that
22:41:21FromDiscord_<Recruit_main707> seq*
22:44:20FromDiscord_<Recruit_main707> ive been thinking how for almost an hour now πŸ˜… but i dont know
22:44:40*xcm quit (Read error: Connection reset by peer)
22:46:42*martinium joined #nim
22:46:44shashlickwhat do you want to cast to what
22:47:00*xcm joined #nim
22:47:47martiniumis there a Nim equivalent to python's selenium?
22:48:47FromDiscord_<Recruit_main707> shshlick, ive already been told this is wrong, but it explains the problem: https://play.nim-lang.org/#ix=2jpu
22:49:24shashlickdisruptek: did you consider just using loadConfig() from compiler instead of nim dump?
22:49:56disrupteki cannot find the compiler without running it because choosenim.
22:50:01disruptekshims.
22:50:05disruptekthis is the problem.
22:50:13disruptekstupid designs.
22:51:14shashlickhow does that affect you when nimconf.nim is compiled into nimph?
22:51:20leorizeRecruit_main707: cast basically tell the compiler how to interpret a glob of data as
22:51:35disrupteki need to know how to set the prefixdir.
22:52:18disruptekit's not available in nim-1.0, fwiw.
22:52:28shashlickwish i had a better memory
22:53:11leorizedisruptek: set the prefixdir?
22:53:41leorizeah I see :P didn't pay enough attention to the conversation
22:53:45FromDiscord_<Technicae Circuit> What module is `getTime()` defined in?
22:54:09disruptekhttps://github.com/disruptek/nimph/issues/127
22:54:10disbotβž₯ Path error when using choosenim ; snippet at 12https://play.nim-lang.org/#ix=2gK1
22:54:43leorize@Technicae Circuit: times
22:55:27FromDiscord_<Technicae Circuit> Thanks
22:56:03shashlickthanks, that rang the bell
22:56:26disruptekbut eventually, we could maybe determine prefixDir this way.
22:57:00FromDiscord_<Recruit_main707> leorize, i surrender for today, will try tomorrow :p
22:57:14FromDiscord_<Technicae Circuit> So, what's the built-in http client Nim has?
22:57:28FromDiscord_<Technicae Circuit> I'm going to make my own simple library now
22:57:34leorizeHTTP/1.1 support, inefficient download/upload
22:57:35disruptekit's the built-in http client.
22:58:30shashlicki think this isn't related - what i'm saying is that instead of relying on `nim dump` to figure out what the nim.cfg evaluates to for a particular directory (for which you don't need prefix dir since you just run "nim")
22:58:36FromDiscord_<Technicae Circuit> What's it called? And is there a better alternative?
22:59:03shashlickwhat i'm asking is - why not use loadConfig() from nimconf.nim, compile that into nimph since you pull in the compiler anyway and detect it directly within nimph
22:59:08leorizeit's called httpclient. You should take a look at https://nim-lang.org/docs/lib.html
22:59:24disruptekshashlick: i do. you cannot make sense of loadConfig() without a valid prefixDir.
22:59:31FromDiscord_<Technicae Circuit> Oh okay, thanks!
23:00:16disrupteki use `nim dump` so you can build nimph with 1.0 and use it to configure nim 1.3.
23:01:09*tane quit (Quit: Leaving)
23:01:30disruptekwhen we can rely upon prefixDir in the config, then we can deprecate some of this.
23:01:47shashlickOk
23:02:12disruptekit would be good to know how to do that. i haven't even looked.
23:02:34disrupteki'm waiting for it to be backported and a new 1.0 patch. then i will bump reqs, etc.
23:07:59shashlickYou mean the nimExe addition?
23:20:30FromDiscord_<Technicae Circuit> Is the name `nimcord` taken in the package list?
23:20:39FromDiscord_<Technicae Circuit> Is the name `Nimcord` taken in the package list?
23:23:45*martinium quit (Changing host)
23:23:45*martinium joined #nim
23:36:09*Trustable quit (Remote host closed the connection)
23:43:42FromDiscord_<KingDarBoja> What's up boys
23:58:22*xet7 quit (Quit: Leaving)