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:32 | FromGitter | <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:02 | Yardanico | wow 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:40 | skrylar[m] | does nims hcr work on windows these days |
02:39:05 | shashlick | !repo plugins |
02:39:07 | disbot | https://github.com/genotrance/plugins -- 9plugins: 11Plugin system for Nim 15 21β 1π΄ 7& 29 more... |
02:39:47 | Yardanico | is 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:54 | disruptek | i can't think of a reason it couldn't. |
02:41:47 | * | granight joined #nim |
02:53:04 | skrylar[m] | suppose nobody knows then. ah well |
02:58:17 | * | granight quit (Quit: Leaving) |
03:03:09 | FromDiscord_ | <KingDarBoja> Hi guys |
03:13:25 | skrylar[m] | hiyo |
03:17:24 | * | ftsf quit (Ping timeout: 265 seconds) |
03:19:10 | FromDiscord_ | <KingDarBoja> \o/ |
03:19:21 | FromDiscord_ | <KingDarBoja> What's up bro? |
03:23:34 | skrylar[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:07 | disruptek | seems like the glfw bindings i need have vanished from github. |
03:24:33 | skrylar[m] | how lucky that sdl2 does all you need to get the gl context then :^) |
03:24:50 | disruptek | it's a req for some code i want to run. |
03:26:49 | FromDiscord_ | <KingDarBoja> on V? |
03:26:51 | FromDiscord_ | <KingDarBoja> V lang? |
03:27:00 | FromDiscord_ | <KingDarBoja> https://www.youtube.com/watch?v=sgHbC6udIqc I am watching this |
03:28:23 | skrylar[m] | yes. v is very nearly "acceptable," but i hate the reasoning for operator overloads |
03:29:02 | skrylar[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:01 | skrylar[m] | nim doesn't hide things from me because someone else might do it wrong, which is nice |
03:30:23 | skrylar[m] | (those 0.7sec full compiles though.. cripes.) |
03:35:34 | FromDiscord_ | <KingDarBoja> Good |
03:35:48 | FromDiscord_ | <KingDarBoja> I still struggling to not fall into learning too many stuff |
03:35:55 | FromDiscord_ | <KingDarBoja> I don't want to be a jack of all trades lol |
03:36:45 | skrylar[m] | generalists have their place |
03:38:03 | FromDiscord_ | <KingDarBoja> Yup |
03:38:21 | skrylar[m] | oh unicode. nopes out at full speed |
03:38:33 | skrylar[m] | been there, did that |
03:38:35 | FromDiscord_ | <KingDarBoja> Too bad I didn't pick CS as my bachelor career |
03:39:00 | skrylar[m] | schools are dumb. read knuth books instead |
03:39:01 | FromDiscord_ | <KingDarBoja> π’ That's why I tend to struggle, I lack the base knowledge but start digging harder on a single cave |
03:39:13 | FromDiscord_ | <KingDarBoja> By single cave I mean single tech |
03:40:15 | skrylar[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:59 | FromDiscord_ | <KingDarBoja> That's better IMO |
03:43:11 | FromDiscord_ | <KingDarBoja> Pseudocode as this is "language agnostic" |
03:43:25 | skrylar[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:53 | skrylar[m] | i think we can make go interfaces with macros in nim but it might be a little weird |
03:46:37 | skrylar[m] | those end up being structs with function pointers and go stuffs the pointers when you cast it |
03:46:49 | skrylar[m] | V precomputes a vtable for all the interfaces and the c code just indexes that |
03:47:45 | skrylar[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:31 | skrylar[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:46 | shashlick | Every new thing works fast and is small |
03:51:02 | disruptek | Hint: 542648 LOC; 39.196 sec; 845.305MiB peakmem; |
03:51:18 | shashlick | But as you add capabilities and satisfy more use cases, it will become real |
03:51:31 | shashlick | Standard illusion of youth vs middle age |
03:51:44 | skrylar[m] | i don't entirely believe that. a lot of the speed penalties are because of design choices :\ |
03:51:57 | shashlick | You can judge wrinkles all you want |
03:52:12 | skrylar[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:11 | shashlick | Everything new stands on the lessons of the old |
03:53:34 | skrylar[m] | you can put the book of aphorisms down, i'll stop talking |
03:53:48 | shashlick | That's not my intention, sorry |
03:54:15 | disruptek | too bad so few learned from cl. |
03:54:24 | disruptek | not like it ain't old enough. |
03:54:54 | skrylar[m] | they took studying the classics out of the cirriculum to graduate several classes of java hacks |
03:55:10 | disruptek | pretty accurate, ime. |
03:55:27 | skrylar[m] | even MIT has clunked a lot of scheme to appeal to simpletons |
03:55:41 | skrylar[m] | as stepping stones sure thats fine but.. |
03:55:43 | skrylar[m] | its just gone entirely |
03:55:56 | FromDiscord_ | <KingDarBoja> I got lost while watching the video |
03:56:14 | shashlick | Knowledge is available like the sand, doesn't mean it is accessible to the everyone |
03:56:16 | skrylar[m] | are you trying to write your own unicode base code |
03:56:29 | shashlick | I can barely get thru a cs paper |
03:58:04 | skrylar[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:04 | skrylar[m] | almost always be rewritten with a lot less obfuscation |
03:58:15 | disruptek | i can barely get through a doorway. |
03:58:25 | disruptek | need to get some exercise. |
03:58:37 | shashlick | Fact is that every industry has its masters and paper pushers |
03:59:17 | skrylar[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:27 | skrylar[m] | and then cassowary is just 'that' with a couple steps added |
04:00:12 | skrylar[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:39 | shashlick | Sounds Feynman'ish |
04:01:56 | skrylar[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:33 | skrylar[m] | lot of time wasted collecting data that was not needed |
04:03:58 | skrylar[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:36 | FromDiscord_ | <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:59 | FromDiscord_ | <KingDarBoja> But got the idea from Pro Tip #1 |
04:05:13 | FromDiscord_ | <KingDarBoja> Unicode on the inside (decode), bytes on the outside (encode) |
04:05:31 | skrylar[m] | unicode is all pretty well documented, its just tedious |
04:05:44 | FromDiscord_ | <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:50 | FromDiscord_ | <KingDarBoja> Use unicode module for that |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:08 | FromDiscord_ | <KingDarBoja> Deal any character (in this case, Rune) to check and return the decoded unicode |
04:06:18 | skrylar[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:06 | FromDiscord_ | <KingDarBoja> In that case, I just missing the unicode module |
04:07:17 | FromDiscord_ | <KingDarBoja> To properly get the character at the desired position |
04:08:07 | FromDiscord_ | <KingDarBoja> skylar[m]: Yeah, they are |
04:08:34 | FromDiscord_ | <KingDarBoja> https://gist.github.com/Varriount/c3ba438533497bc636da |
04:18:23 | rockcavera | is not safe "var string" in procedure async? |
04:20:38 | Prestige | Is there a table proc to check if a value exists? Or should I just loop over everything? |
04:21:00 | Prestige | Hm maybe a bidirectional map would be a better use for this |
04:21:27 | leorize | Prestige: yes, hasKey |
04:21:33 | leorize | oh wait a value? |
04:21:35 | leorize | yea then loop |
04:21:38 | Prestige | Hm ok |
04:21:55 | Prestige | oh there's withValue, that looks good |
04:26:24 | FromDiscord_ | <KingDarBoja> Does Nim has a pet? |
04:26:58 | rockcavera | Improving the question: isn't "var T" safe in procedure async parameters? |
04:28:04 | Prestige | A bidirectional map would be cool |
04:36:13 | * | rockcavera quit (Remote host closed the connection) |
04:38:14 | FromDiscord_ | <Technicae Circuit> Heya, how would i declare a variable in Nim? |
04:45:09 | FromDiscord_ | <InventorMatt> var x = sometype |
04:47:48 | FromDiscord_ | <Technicae Circuit> Thanks |
04:51:29 | silvernode | arrays are immutable right? |
04:56:14 | FromDiscord_ | <Elegant Beef> The length is |
04:56:31 | FromDiscord_ | <Elegant Beef> Atleast to my knowledge arrays need to be a compiletime constant |
04:56:38 | FromDiscord_ | <Elegant Beef> array lengths* |
04:56:50 | FromDiscord_ | <Elegant Beef> I'm probably certainly wrong |
04:56:53 | FromDiscord_ | <Elegant Beef> since i tend to be that a lot |
04:57:38 | FromDiscord_ | <Technicae Circuit> Is there python-like lists in Nim? |
04:57:47 | FromDiscord_ | <Technicae Circuit> So i can add and remove values |
04:57:53 | FromDiscord_ | <Elegant Beef> sequences |
04:58:06 | FromDiscord_ | <Technicae Circuit> How do i use them? |
04:58:14 | FromDiscord_ | <Elegant Beef> `var s : seq[int] = @[1,2,3,4,5}` |
04:58:24 | FromDiscord_ | <Elegant Beef> clearly supposed to be `]` at the end |
04:58:38 | FromDiscord_ | <Technicae Circuit> Oh okay |
04:58:53 | FromDiscord_ | <Technicae Circuit> Does that only accept one type? |
04:59:01 | FromDiscord_ | <Elegant Beef> yes |
04:59:10 | FromDiscord_ | <Technicae Circuit> Damn |
04:59:14 | * | silvernode quit (Ping timeout: 240 seconds) |
04:59:16 | FromDiscord_ | <Elegant Beef> Strictly typed languages be like that π |
04:59:31 | FromDiscord_ | <Technicae Circuit> So i should use a 2d sequence for multiple types in an array |
04:59:33 | FromDiscord_ | <Technicae Circuit> :p |
04:59:46 | FromDiscord_ | <Elegant Beef> What are doing that you need multiple types? |
04:59:56 | FromDiscord_ | <Technicae Circuit> Just curious right now |
05:02:18 | FromDiscord_ | <Technicae Circuit> Nim is surprisingly nice for a compiled language |
05:02:32 | FromDiscord_ | <Elegant Beef> I agree |
05:02:34 | FromDiscord_ | <Technicae Circuit> Probably because i am used to the Pythonish syntax |
05:02:46 | FromDiscord_ | <Technicae Circuit> And it doesn't use a main function for code |
05:02:53 | FromDiscord_ | <Elegant Beef> I like some of the syntaxial sugar |
05:02:58 | FromDiscord_ | <Technicae Circuit> Mhmm |
05:03:00 | FromDiscord_ | <Elegant Beef> Main function doesnt matter really |
05:03:14 | FromDiscord_ | <Elegant Beef> Since you can think of your main file as a named function |
05:03:23 | FromDiscord_ | <Technicae Circuit> True, but i just prefer anything without the main function |
05:03:25 | FromDiscord_ | <Technicae Circuit> Yeah |
05:03:46 | FromDiscord_ | <Elegant Beef> i mean mained* |
05:04:11 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:04:12 | FromDiscord_ | <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:24 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:04:36 | FromDiscord_ | <Technicae Circuit> How do i define a function again? :P |
05:04:39 | FromDiscord_ | <Elegant Beef> Is "oh okay" equivlent to "I didnt ask" |
05:04:49 | FromDiscord_ | <Technicae Circuit> not like that |
05:04:50 | FromDiscord_ | <Elegant Beef> `proc name(args:type):returnType = body` |
05:04:52 | FromDiscord_ | <Technicae Circuit> I'm interested |
05:04:54 | skrylar[m] | arrays elements are mutable the length is constant. sequences are mutable and te length is mutable. |
05:04:55 | FromDiscord_ | <Technicae Circuit> Thanks |
05:05:00 | FromDiscord_ | <Technicae Circuit> :p |
05:05:10 | skrylar[m] | also nim correctly exposes length and capacity separately which you would be surprised how many languages botch |
05:05:25 | FromDiscord_ | <Elegant Beef> In what way to they bodge them? |
05:05:28 | FromDiscord_ | <Elegant Beef> Make them the same thing? |
05:05:41 | skrylar[m] | many of them don't let you pre-allocate for capacity |
05:05:58 | skrylar[m] | iirc nim you can ask for a length of zero but a capacity of whatever upper bound you expect |
05:06:17 | skrylar[m] | so when you go append stuff one at a time it doesn't trigger reallocs |
05:06:25 | FromDiscord_ | <Elegant Beef> Ah |
05:06:41 | FromDiscord_ | <Elegant Beef> I know C# has those features too, and it's the only other language i've really used |
05:09:38 | FromDiscord_ | <KingDarBoja> If you want different types, use tables |
05:09:48 | FromDiscord_ | <KingDarBoja> Which are the equivalent to dictionaries |
05:10:03 | FromDiscord_ | <Elegant Beef> That doesnt give you different types |
05:10:11 | FromDiscord_ | <Elegant Beef> It's still typeA,typeB |
05:10:42 | FromDiscord_ | <Elegant Beef> And afaik it only works on ints/strings as keys unless it has a hash method |
05:11:27 | FromDiscord_ | <Elegant Beef> https://nim-lang.org/docs/tables.html#basic-usage-hashing |
05:11:27 | FromDiscord_ | <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:04 | FromDiscord_ | <Technicae Circuit> Why is Nim such a good language? |
05:17:45 | FromDiscord_ | <Elegant Beef> Well designed, nice sugar, it's not python π |
05:18:18 | * | mwbrown joined #nim |
05:18:39 | FromDiscord_ | <Technicae Circuit> :p |
05:18:47 | FromDiscord_ | <Technicae Circuit> I got the error `Error: expression 'main()' is of type 'int' and has to be discarded` |
05:18:53 | FromDiscord_ | <Elegant Beef> yep |
05:18:58 | FromDiscord_ | <Elegant Beef> You have a return type you dont handle |
05:19:05 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:19:15 | FromDiscord_ | <Elegant Beef> `discard main()` will solve it |
05:19:19 | FromDiscord_ | <Technicae Circuit> Cool |
05:19:45 | FromDiscord_ | <Technicae Circuit> I just did ```nim |
05:19:45 | FromDiscord_ | <Technicae Circuit> proc main():int = |
05:19:45 | FromDiscord_ | <Technicae Circuit> return 0 |
05:19:45 | FromDiscord_ | <Technicae Circuit> |
05:19:45 | FromDiscord_ | <Technicae Circuit> main()``` |
05:19:48 | FromDiscord_ | <Technicae Circuit> :p |
05:19:49 | FromDiscord_ | <Elegant Beef> Yea |
05:20:14 | FromDiscord_ | <Technicae Circuit> It worked |
05:20:16 | FromDiscord_ | <Technicae Circuit> Coolio |
05:20:28 | FromDiscord_ | <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:50 | FromDiscord_ | <Elegant Beef> so in python you can put `"This is totally useless"` anywhere and it still runs |
05:20:51 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:20:57 | FromDiscord_ | <Technicae Circuit> Yeah |
05:21:06 | FromDiscord_ | <Technicae Circuit> That's actually good to know |
05:21:14 | FromDiscord_ | <Elegant Beef> in nim you need to `discard "This is totally useless"`, so it's less funny |
05:21:31 | FromDiscord_ | <KingDarBoja> Arrr got it wrong, sorry |
05:21:42 | FromDiscord_ | <Technicae Circuit> So how would multiline comments work? In python you just use a multline strings |
05:21:46 | FromDiscord_ | <Technicae Circuit> So how would multiline comments work? In python you just use a multline string |
05:22:06 | FromDiscord_ | <KingDarBoja> Multiline comments? Or multiline strings |
05:22:09 | FromDiscord_ | <Elegant Beef> `#[Multiline inbetweenhere]#` |
05:22:25 | FromDiscord_ | <KingDarBoja> Use `##[]##` if you wish it to be docstring-like |
05:22:36 | FromDiscord_ | <Technicae Circuit> Thanks! |
05:22:37 | FromDiscord_ | <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:43 | FromDiscord_ | <Technicae Circuit> Yeah |
05:23:08 | FromDiscord_ | <KingDarBoja> π |
05:23:25 | FromDiscord_ | <Technicae Circuit> I like Nim alot |
05:23:49 | * | narimiran joined #nim |
05:23:51 | FromDiscord_ | <Elegant Beef> I have a feeling that's a shared feeling in these parts |
05:23:54 | FromDiscord_ | <Technicae Circuit> I need to get Syntax highlighting for Nim with nano |
05:23:58 | FromDiscord_ | <Technicae Circuit> Eheheheh |
05:24:08 | FromDiscord_ | <KingDarBoja> I use VSCode so... |
05:24:15 | FromDiscord_ | <Elegant Beef> Use vscode with nim alt |
05:24:17 | * | FromDiscord_ <KingDarBoja> I am doomed |
05:24:19 | FromDiscord_ | <Elegant Beef> Gary's done some good work on that |
05:24:20 | FromDiscord_ | <KingDarBoja> nvm |
05:24:27 | FromDiscord_ | <Technicae Circuit> I mainly use vsc, but I'm on mobile using Termux |
05:24:41 | FromDiscord_ | <Technicae Circuit> So i prefer nano |
05:24:41 | * | pbb quit (Ping timeout: 265 seconds) |
05:24:49 | * | pbb_ joined #nim |
05:24:58 | FromDiscord_ | <KingDarBoja> Gonna play a bit |
05:25:22 | skrylar[m] | kakoune here.. though i used to have a highly customized emacs+mode, though i dunno where my mode is buried atm |
05:25:54 | FromDiscord_ | <Technicae Circuit> What's kakoune? |
05:26:16 | skrylar[m] | https://github.com/mawww/kakoune |
05:26:40 | skrylar[m] | reimagined vim; based around multiple selections and composed keystrokes |
05:26:53 | * | manjaroi3 quit (Quit: leaving) |
05:27:18 | FromDiscord_ | <Technicae Circuit> Oo |
05:27:20 | FromDiscord_ | <Technicae Circuit> Cool |
05:28:21 | * | tlangir is now known as number_two |
05:30:18 | * | lritter joined #nim |
05:30:43 | FromDiscord_ | <Technicae Circuit> Why was Nim made? |
05:30:57 | FromDiscord_ | <Elegant Beef> Araq, probably knows |
05:31:03 | FromDiscord_ | <Technicae Circuit> And who were the people who developed ir |
05:31:05 | FromDiscord_ | <Technicae Circuit> It* |
05:31:07 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:31:24 | FromDiscord_ | <Elegant Beef> He's the language founder and is around here quite a bit |
05:31:35 | FromDiscord_ | <Elegant Beef> You can always look at the nim github to see the contributors |
05:31:35 | FromDiscord_ | <Technicae Circuit> O |
05:31:45 | FromDiscord_ | <Technicae Circuit> Cool |
05:32:14 | FromDiscord_ | <Technicae Circuit> Nim has a small community right now, doesn't it? |
05:32:31 | FromDiscord_ | <Elegant Beef> It was only officially released last october, so it's super new |
05:32:36 | FromDiscord_ | <Technicae Circuit> O |
05:32:46 | FromDiscord_ | <Technicae Circuit> It was released before October then? |
05:33:33 | FromDiscord_ | <Technicae Circuit> Well |
05:33:45 | FromDiscord_ | <Technicae Circuit> Was it available to the public before October is what i mean |
05:33:48 | FromDiscord_ | <Elegant Beef> It's been around since 2008, just first full release was october |
05:33:58 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:34:00 | FromDiscord_ | <Technicae Circuit> Cool |
05:34:07 | FromDiscord_ | <Elegant Beef> All your other questions can be answered here |
05:34:08 | FromDiscord_ | <Elegant Beef> https://en.wikipedia.org/wiki/Nim_(programming_language) |
05:34:13 | FromDiscord_ | <Technicae Circuit> Thanks! |
05:34:14 | skrylar[m] | probably because araq was a delphi head and delphi is kill |
05:34:27 | skrylar[m] | i should say delphi enthusiast i dont think he worked at borland |
05:34:44 | FromDiscord_ | <Technicae Circuit> O |
05:34:44 | skrylar[m] | old versions of nim were very much pythonized pascal |
05:34:45 | FromDiscord_ | <KingDarBoja> Woah |
05:34:47 | FromDiscord_ | <Elegant Beef> I mean im sorta disppointed it's not called nimrod anymore |
05:34:48 | FromDiscord_ | <KingDarBoja> 2008-2020 |
05:35:03 | FromDiscord_ | <Technicae Circuit> Why are you disappointed for? |
05:35:14 | FromDiscord_ | <KingDarBoja> That's like... 12 years under development, but glad it got it's first release |
05:35:23 | skrylar[m] | it was a capitulation to make derps happy |
05:35:25 | FromDiscord_ | <Elegant Beef> Cause nimrod is a peak language name |
05:35:35 | FromDiscord_ | <Technicae Circuit> :p |
05:35:43 | FromDiscord_ | <Elegant Beef> Well it started development in 2005 wikipedia says |
05:35:48 | FromDiscord_ | <Elegant Beef> so 15 years |
05:35:52 | skrylar[m] | then you have mozilla name a language after a literally undesirable situation that makes your metal unusable |
05:36:05 | skrylar[m] | ... which is appropriate, nevermind. :ducks: |
05:36:06 | FromDiscord_ | <Technicae Circuit> Is it older then Python? |
05:36:13 | FromDiscord_ | <KingDarBoja> I admire him for not giving up on those years |
05:36:21 | FromDiscord_ | <Technicae Circuit> Mhm |
05:36:30 | * | FromDiscord_ <KingDarBoja> Rusty Rusty |
05:36:44 | * | FromDiscord_ <KingDarBoja> Go deep, Go Haxe |
05:36:45 | FromDiscord_ | <Elegant Beef> Lol skrylar dont say that too loud the crabs will attack |
05:36:45 | skrylar[m] | some of these altlangs are pretty old actually |
05:37:02 | skrylar[m] | haxe is quite aged too, as was D1 |
05:37:03 | FromDiscord_ | <Technicae Circuit> That's very nice |
05:37:07 | FromDiscord_ | <Elegant Beef> All im going to say is what does a king crab wear on his head? |
05:37:22 | FromDiscord_ | <Technicae Circuit> Idk |
05:37:29 | FromDiscord_ | <Elegant Beef> *the answer is a crown* |
05:37:38 | * | FromDiscord_ <KingDarBoja> Crab dance |
05:37:38 | FromDiscord_ | <Elegant Beef> The icon of nim π |
05:37:43 | skrylar[m] | well "nimrod" was also a positive bible reference iirc, which a lot of tech places hate |
05:37:46 | FromDiscord_ | <Technicae Circuit> O |
05:37:57 | FromDiscord_ | <Technicae Circuit> > <skrylar[m]> well "nimrod" was also a positive bible reference iirc, which a lot of tech places hate |
05:37:57 | FromDiscord_ | <Technicae Circuit> Oof |
05:38:00 | FromDiscord_ | <KingDarBoja> https://www.youtube.com/watch?v=LDU_Txk06tM |
05:38:06 | skrylar[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:21 | FromDiscord_ | <Technicae Circuit> Haha |
05:39:00 | FromDiscord_ | <Elegant Beef> I've now lost interest in the nimrod language, i thought it was based off the insult |
05:39:14 | FromDiscord_ | <Technicae Circuit> O |
05:39:17 | skrylar[m] | the insult was itself based on the same reference |
05:39:31 | FromDiscord_ | <Technicae Circuit> ~~Don't lose interest for this amazing language~~ |
05:39:32 | FromDiscord_ | <Elegant Beef> *obviously* |
05:39:45 | FromDiscord_ | <Elegant Beef> I've already made a window manager for it, im already too deep |
05:39:48 | FromDiscord_ | <Elegant Beef> with it* |
05:40:14 | skrylar[m] | the interesting times when childrens cartoons contained heavy doses of irony and reference to classical texts :thonk: |
05:40:32 | FromDiscord_ | <Technicae Circuit> Oo |
05:41:22 | FromDiscord_ | <Elegant Beef> So after reading that hash stuff i thought, why isnt there macro that makes hash functions for objects if declared |
05:41:50 | FromDiscord_ | <Elegant Beef> Seems like hashing all the hashable members of a type is a logical thing for a proc to do |
05:41:57 | FromDiscord_ | <Elegant Beef> macro* |
05:42:13 | skrylar[m] | and now you know why skmap has a user supplied hash function :3 |
05:42:39 | FromDiscord_ | <Elegant Beef> Huh? |
05:42:51 | FromDiscord_ | <Technicae Circuit> Is there something like `import github/username/repo` |
05:43:01 | FromDiscord_ | <Elegant Beef> `nimble install repo` |
05:43:01 | skrylar[m] | no we aren't Go |
05:43:11 | FromDiscord_ | <Elegant Beef> Works if it's a nimble package |
05:43:11 | FromDiscord_ | <Technicae Circuit> Which would just be the approximate path to to the GitHub folder |
05:43:17 | FromDiscord_ | <Technicae Circuit> O |
05:43:30 | FromDiscord_ | <Elegant Beef> If it's not a nimble package you cant, cause that's silly |
05:43:48 | skrylar[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:42 | skrylar[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:41 | FromDiscord_ | <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:49 | FromDiscord_ | <Elegant Beef> Feel like something like that should be included in the tables module |
05:45:53 | skrylar[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:10 | FromDiscord_ | <Elegant Beef> Well yea nothing stops me but my laziness |
05:46:26 | skrylar[m] | laziness bad. git gud :E |
05:46:41 | FromDiscord_ | <Elegant Beef> Eh, i gotta still implement fullscreen windows into my window manager |
05:47:01 | FromDiscord_ | <Elegant Beef> *Note to self never use xlib ever agaiN* |
05:47:04 | FromDiscord_ | <Elegant Beef> *Note to self never use xlib ever again* |
05:47:10 | skrylar[m] | oof |
05:47:18 | skrylar[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:10 | FromDiscord_ | <Elegant Beef> lol |
05:48:43 | FromDiscord_ | <Elegant Beef> I do think ill try writting that function cause it seems rather useful to speed up using tables |
05:48:52 | FromDiscord_ | <Elegant Beef> but after i get fullscreen support π |
05:49:32 | skrylar[m] | https://github.com/Skrylar/skflatbuffers/blob/master/skflatbuffer.nim#L76 not sure if this macro still works |
05:49:48 | skrylar[m] | i already wrote some that iterate fields and try to emit code for it |
05:50:14 | FromDiscord_ | <Elegant Beef> ah yea |
05:50:14 | skrylar[m] | which is 90% of the job you're trying to do lol |
05:50:26 | FromDiscord_ | <Elegant Beef> I know i previously tried to automate making constructors |
05:50:57 | FromDiscord_ | <Elegant Beef> so you could do something like |
05:50:58 | FromDiscord_ | <Elegant Beef> `construct(type,"memberA","memberB")` |
05:51:02 | FromDiscord_ | <Elegant Beef> and it'd handle everything |
05:51:12 | FromDiscord_ | <Technicae Circuit> How do Nim tables work? |
05:51:15 | * | hoijui joined #nim |
05:51:35 | FromDiscord_ | <Elegant Beef> They're hashmaps but the key needs to be a int/string/type with two procs implemented |
05:51:39 | skrylar[m] | never used them. but they're supposed to be your standard key/value store |
05:51:41 | FromDiscord_ | <Elegant Beef> scroll up there is a explanation on there |
05:51:50 | FromDiscord_ | <Technicae Circuit> Okay |
05:52:06 | FromDiscord_ | <Rika> til skrylar was already working on xxhash, damn, thought that could be my next project |
05:52:30 | skrylar[m] | it still could. i haven't worked on it in a few days |
05:52:39 | skrylar[m] | i have spookyhash too but theres a bug in it |
05:52:51 | FromDiscord_ | <Rika> that's just a waste of effort aint it? |
05:52:55 | FromDiscord_ | <Rika> unless i fork your repo |
05:52:56 | skrylar[m] | blake however is tested against the official versions test vectors and works |
05:54:30 | FromDiscord_ | <Technicae Circuit> Table are basically made like `{"key":"value"}` |
05:54:36 | FromDiscord_ | <Technicae Circuit> Table are basically made like `{"key":"value"}.toTabls` |
05:54:54 | FromDiscord_ | <Technicae Circuit> `{"key":"value"}.toTable`* |
05:55:10 | FromDiscord_ | <Technicae Circuit> I forgot about editing ;-; |
05:55:12 | FromDiscord_ | <Rika> yes |
05:55:26 | FromDiscord_ | <Elegant Beef> You can also use the initTable proc, to initalize an empty table |
05:55:48 | FromDiscord_ | <Technicae Circuit> Oh okay, cool |
05:56:19 | FromDiscord_ | <Rika> `{"key": "value"}` is essentially `((key: "key", val: "value"))` (two tuples) |
05:56:44 | FromDiscord_ | <Technicae Circuit> Oh? Why is it like that? |
05:57:16 | FromDiscord_ | <Rika> tables arent imported by default |
05:57:23 | FromDiscord_ | <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:26 | FromDiscord_ | <Technicae Circuit> True |
05:57:36 | FromDiscord_ | <Elegant Beef> Flow control |
05:57:46 | FromDiscord_ | <Rika> do you know tuples? |
05:57:47 | FromDiscord_ | <Technicae Circuit> What's that? :P |
05:57:54 | FromDiscord_ | <Rika> if else elif when |
05:57:58 | FromDiscord_ | <Rika> thats flow control i assume |
05:58:05 | FromDiscord_ | <Elegant Beef> if,case,else,elif,while,for i'd consider flow control |
05:58:17 | FromDiscord_ | <Technicae Circuit> Not yet, unless tuples in nim are similar to Python's tuples |
05:58:20 | FromDiscord_ | <Technicae Circuit> Oh okay |
05:58:25 | FromDiscord_ | <Rika> they pretty much are |
05:58:38 | FromDiscord_ | <Rika> except nim tuples can have names assigned to their fields |
06:01:46 | * | hoijui quit (Quit: Leaving) |
06:02:41 | FromDiscord_ | <Technicae Circuit> Oh okay, nice |
06:02:49 | FromDiscord_ | <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:49 | FromDiscord_ | <Technicae Circuit> u0_a165@localhost ~/nim_stuff [1]> cat main.nim |
06:02:49 | FromDiscord_ | <Technicae Circuit> proc main():int = |
06:02:49 | FromDiscord_ | <Technicae Circuit> let userinput:string = string(readLine(stdin)) |
06:02:49 | FromDiscord_ | <Technicae Circuit> if userinput.toLower == "hi": |
06:02:50 | FromDiscord_ | <Technicae Circuit> echo userinput |
06:02:51 | FromDiscord_ | <Technicae Circuit> elif userinput.toLower == "hello": |
06:02:53 | FromDiscord_ | <Technicae Circuit> echo userinput |
06:02:54 | FromDiscord_ | <Technicae Circuit> else: |
06:02:56 | FromDiscord_ | <Technicae Circuit> echo "Heya" |
06:02:57 | FromDiscord_ | <Technicae Circuit> return 0 |
06:02:59 | FromDiscord_ | <Technicae Circuit> |
06:03:00 | FromDiscord_ | <Technicae Circuit> discard main()``` |
06:03:02 | FromDiscord_ | <Technicae Circuit> Any idea what thw issue is? |
06:03:05 | FromDiscord_ | <Technicae Circuit> Any idea what the issue is? |
06:03:08 | FromDiscord_ | <Technicae Circuit> Wait |
06:03:12 | FromDiscord_ | <Technicae Circuit> Lemme use a paste service |
06:04:50 | FromDiscord_ | <Technicae Circuit> https://hastebin.com/jolefumovo.bash |
06:05:10 | FromDiscord_ | <Technicae Circuit> That's my code and I'm getting an undeclared field error |
06:05:17 | FromDiscord_ | <Elegant Beef> tolower is in unicode/strutils |
06:05:17 | FromDiscord_ | <Technicae Circuit> Unless toLower is wrong |
06:05:23 | FromDiscord_ | <Technicae Circuit> Oh okay |
06:05:29 | FromDiscord_ | <Elegant Beef> You need to import strutils |
06:05:36 | FromDiscord_ | <Technicae Circuit> Oki |
06:06:17 | FromDiscord_ | <Elegant Beef> also be nice to thes irc nerds dont paste too many lines |
06:06:24 | FromDiscord_ | <Elegant Beef> a few is fine more than that is bad |
06:06:36 | FromDiscord_ | <Technicae Circuit> Yeah, i just realised :p |
06:07:06 | FromDiscord_ | <Technicae Circuit> Nim might be my favourite language soon |
06:07:17 | FromDiscord_ | <Technicae Circuit> My current favourite lang is Python |
06:07:47 | FromDiscord_ | <Elegant Beef> Well that's weird, liking python |
06:08:05 | FromDiscord_ | <Technicae Circuit> Say that to the Python discord server :p |
06:08:37 | FromDiscord_ | <Technicae Circuit> Python has alot of stuff that can be used |
06:08:53 | FromDiscord_ | <Elegant Beef> But not a sensible typing |
06:08:57 | FromDiscord_ | <Technicae Circuit> Wdym? |
06:09:16 | FromDiscord_ | <Elegant Beef> I hate dynamically typed languages |
06:09:24 | FromDiscord_ | <Technicae Circuit> Oh okay |
06:09:38 | FromDiscord_ | <Technicae Circuit> I prefer them but i know that that can reduce speed |
06:09:44 | FromDiscord_ | <Technicae Circuit> There is also Cython |
06:09:56 | FromDiscord_ | <Technicae Circuit> Which compiles Python to C or C++ |
06:10:08 | * | kenran joined #nim |
06:10:29 | FromDiscord_ | <Technicae Circuit> And it allows you to do `cpdef type var_name = value` |
06:10:53 | FromDiscord_ | <Elegant Beef> Yea that's not hideous |
06:11:14 | FromDiscord_ | <Technicae Circuit> For booleans you just use an integer since bools are just ints in Python |
06:11:20 | FromDiscord_ | <Technicae Circuit> Which i personally don't like |
06:11:32 | FromDiscord_ | <Technicae Circuit> Because `False + 1 == True` basically |
06:12:58 | FromDiscord_ | <Rika> bools in python inherit from int? |
06:13:12 | FromDiscord_ | <Elegant Beef> Bools are enums in nim, so it's not too crazy π |
06:13:17 | FromDiscord_ | <Elegant Beef> Although they're magic here |
06:13:51 | FromDiscord_ | <Technicae Circuit> |
06:13:51 | FromDiscord_ | <Technicae Circuit> https://cdn.discordapp.com/attachments/371759389889003532/703126538580918332/Screenshot_20200424_071342_com.termux.jpg |
06:14:01 | FromDiscord_ | <Technicae Circuit> > bools in python inherit from int? |
06:14:01 | FromDiscord_ | <Technicae Circuit> Yup |
06:14:05 | skrylar[m] | i like janet, but i use python :b |
06:14:29 | FromDiscord_ | <Elegant Beef> `echo bool(int(false) + 1)` |
06:14:35 | FromDiscord_ | <Elegant Beef> There you go that's how you do it in nim |
06:14:44 | FromDiscord_ | <Technicae Circuit> `>>> dir(int) |
06:14:44 | FromDiscord_ | <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:50 | FromDiscord_ | <Technicae Circuit> Specifically __bool__ |
06:14:50 | FromDiscord_ | <Rika> π |
06:15:10 | FromDiscord_ | <Rika> `__bool__` just means you can convert it to a bool aint it |
06:15:12 | FromDiscord_ | <Elegant Beef> "Yea i noticed the paste, i'll host it" procedes to attack our irc brethern |
06:15:16 | FromDiscord_ | <Technicae Circuit> Yeah |
06:15:22 | FromDiscord_ | <Technicae Circuit> Wut |
06:15:23 | FromDiscord_ | <Rika> > "Yea i noticed the paste, i'll host it" procedes to attack our irc brethern |
06:15:23 | FromDiscord_ | <Rika> @Elegant Beef its a single line |
06:15:28 | FromDiscord_ | <Elegant Beef> Ah |
06:15:28 | FromDiscord_ | <Technicae Circuit> 2 lines |
06:15:35 | FromDiscord_ | <Technicae Circuit> :p |
06:15:35 | FromDiscord_ | <Rika> yeah, that |
06:15:40 | FromDiscord_ | <Elegant Beef> Got discord on my portrait monitor |
06:15:48 | FromDiscord_ | <Elegant Beef> That's a big ol' block fo text |
06:15:53 | FromDiscord_ | <Elegant Beef> of* |
06:15:53 | FromDiscord_ | <Rika> lucky you, with two monitors |
06:15:54 | FromDiscord_ | <Technicae Circuit> Haha |
06:15:54 | skrylar[m] | matrix here o/ |
06:16:01 | FromDiscord_ | <Rika> fuck matrix |
06:16:06 | FromDiscord_ | <Rika> (im joking) |
06:16:07 | FromDiscord_ | <Technicae Circuit> There's a matrix channel for Nim? |
06:16:14 | FromDiscord_ | <Elegant Beef> You're in it right now |
06:16:17 | FromDiscord_ | <Elegant Beef> Through discord |
06:16:17 | FromDiscord_ | <Rika> no theres a matrix bridge |
06:16:21 | skrylar[m] | as a protocol matrix isn't exactly bad. |
06:16:26 | FromDiscord_ | <Technicae Circuit> Oh okay |
06:16:33 | FromDiscord_ | <Rika> hey i said i was joking |
06:16:38 | FromDiscord_ | <Elegant Beef> From my understanding video/audio is garbo |
06:16:43 | FromDiscord_ | <Elegant Beef> I havent actually ever used matrix |
06:16:54 | FromDiscord_ | <Elegant Beef> I wanted to use it over discord cause the discord linux client is spotty to me |
06:17:00 | skrylar[m] | technically yall are all bridged to said irc :p |
06:17:14 | FromDiscord_ | <Elegant Beef> And is no one going to comment that they're using comic sans as their keyboard font? |
06:17:16 | FromDiscord_ | <Technicae Circuit> Never tried video or audio do i never needed to |
06:17:24 | FromDiscord_ | <Technicae Circuit> I am |
06:17:31 | FromDiscord_ | <Technicae Circuit> So |
06:17:32 | FromDiscord_ | <Rika> oh what the fuck |
06:17:39 | FromDiscord_ | <Technicae Circuit> :p |
06:18:11 | skrylar[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:37 | FromDiscord_ | <Technicae Circuit> O |
06:18:40 | FromDiscord_ | <Technicae Circuit> Riot? |
06:18:46 | FromDiscord_ | <Rika> rest in peace nim chat |
06:18:50 | FromDiscord_ | <Rika> nothing nim related |
06:18:54 | skrylar[m] | if they added a topic field it would be a lot like zulip which is pretty nice |
06:18:55 | FromDiscord_ | <Technicae Circuit> Oof |
06:19:15 | FromDiscord_ | <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:16 | FromDiscord_ | <Elegant Beef> π |
06:19:25 | FromDiscord_ | <Technicae Circuit> Cool |
06:19:31 | skrylar[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:10 | FromGitter | <timotheecour> can someone please review and merge https://github.com/nim-lang/Nim/pull/14102 to un-break nim CI? |
06:21:13 | disbot | β₯ fix nim CI; fix local testament ; snippet at 12https://play.nim-lang.org/#ix=2jiK |
06:21:54 | FromDiscord_ | <Technicae Circuit> @gitterirc should do `.strip("<FromGitter>")`- |
06:22:10 | narimiran | @timotheecour can we fix that SSL cert? |
06:22:10 | FromDiscord_ | <Rika> not possible, we dont own the bot afaik? |
06:22:17 | FromDiscord_ | <Technicae Circuit> O |
06:23:27 | narimiran | also, your un-breaking breaks SSL CI tests |
06:23:38 | FromGitter | <timotheecour> how so? |
06:24:00 | FromGitter | <timotheecour> these test failures seem unrelated as i noted PR |
06:24:44 | * | solitudesf joined #nim |
06:24:52 | FromDiscord_ | <Technicae Circuit> Nim should add a gitlab and Codeberg repo mirror |
06:26:04 | FromDiscord_ | <Rika> why? |
06:26:17 | narimiran | btw, 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:12 | FromGitter | <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:44 | narimiran | i'm waiting for federico3's input on that problem |
06:28:35 | FromDiscord_ | <Technicae Circuit> > why? |
06:28:36 | FromDiscord_ | <Technicae Circuit> So more people can see nim |
06:29:44 | FromDiscord_ | <Rika> but it's already found on github so...? i'd understand if it was from gitlab to github mirror but |
06:31:04 | FromGitter | <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:44 | FromDiscord_ | <Elegant Beef> also i just learned that on/off are aliased to true/false |
06:32:48 | FromDiscord_ | <Elegant Beef> That's comically fantastic |
06:32:59 | FromDiscord_ | <Rika> haha, thats for switches in nimscript i think |
06:33:07 | FromDiscord_ | <Elegant Beef> ah |
06:36:45 | narimiran | you didn't understand my point.... |
06:36:59 | * | PMunch joined #nim |
06:42:36 | FromDiscord_ | <Technicae Circuit> Nim is OP |
06:42:44 | FromDiscord_ | <Technicae Circuit> I just made a python module in Nim so simply |
06:43:43 | FromDiscord_ | <Rika> it gets harder the more complex the module |
06:44:12 | FromDiscord_ | <Technicae Circuit> True |
06:44:14 | FromDiscord_ | <Technicae Circuit> But eh |
06:45:27 | PMunch | Rika, harder to integrate with Python, or harder to use Nims more powerful features? |
06:45:48 | FromDiscord_ | <Technicae Circuit> What's the best way to make a discord bot in Nim? |
06:46:01 | FromDiscord_ | <Technicae Circuit> > <PMunch> Rika, harder to integrate with Python, or harder to use Nims more powerful features? |
06:46:01 | FromDiscord_ | <Technicae Circuit> Probably both imo |
06:46:33 | PMunch | I mean sure, Nims macros can be a bit daunting at first. But once you get into it it's not that hard |
06:46:46 | PMunch | Haven't tried integrating it with Python though |
06:47:19 | PMunch | Technicae Circuit, I'd say this would be a good starting point: https://github.com/Krognol/discordnim |
06:48:28 | FromDiscord_ | <Technicae Circuit> Okay then, thanks! |
06:48:51 | PMunch | How did PR thursday go Araq? Last I checked it was 114 PRs, now it's up to 123.. |
06:51:00 | PMunch | By the way, if you're looking for a package: https://nimble.directory/search?query=discord |
06:53:42 | FromGitter | <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:15 | FromDiscord_ | <Technicae Circuit> I got this error https://hastebin.com/gododekiba.coffeescript |
06:54:27 | FromDiscord_ | <Technicae Circuit> While using discordnim |
06:56:12 | PMunch | Aha, you have a bad version of zlib |
06:56:19 | PMunch | Or rather a different one than expected |
06:56:49 | FromDiscord_ | <Technicae Circuit> Which version do i need? |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:43 | FromDiscord_ | <flywind> what do you need? streaming response or chunk response?@nhanb |
07:01:01 | FromDiscord_ | <flywind> stream response https://github.com/dom96/jester/blob/d8a03aa4c681bc8514bb7bbf4953d380d86f5bd6/jester.nim#L200 |
07:01:16 | FromDiscord_ | <flywind> chuncks response https://github.com/iocrate/netkit/blob/master/netkit/http/chunk.nim |
07:02:20 | FromDiscord_ | <flywind> chunks response https://github.com/iocrate/netkit/blob/master/netkit/http/chunk.nim |
07:02:46 | PMunch | Technicae Circuit, TBH I'm not sure.. |
07:03:53 | PMunch | It might be this thing that you've run into: https://github.com/nim-lang/zip/issues/39 |
07:03:55 | disbot | β₯ 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:02 | FromDiscord_ | <Technicae Circuit> Thanks |
07:08:08 | FromGitter | <nhanb> Thanks flywin, streaming response is what I need. I'll check out how jester does it via the stdlib then |
07:08:31 | FromDiscord_ | <flywind> no problem. |
07:10:49 | FromDiscord_ | <Technicae Circuit> I don't know what I can do because Zlib is broken |
07:13:12 | PMunch | Hmm, 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:21 | PMunch | That seems to be what I've done |
07:19:06 | FromDiscord_ | <Technicae Circuit> Okay then |
07:23:25 | FromDiscord_ | <Technicae Circuit> https://hastebin.com/ekoresojew.coffeescript |
07:23:34 | FromDiscord_ | <Technicae Circuit> I'm now getting this error |
07:25:15 | PMunch | "Exception message: key not found: .user.username" |
07:25:19 | PMunch | Well, do you have that key? |
07:25:37 | FromDiscord_ | <Technicae Circuit> What do you mean |
07:25:55 | FromDiscord_ | <Technicae Circuit> I don't even understand the error |
07:26:18 | FromDiscord_ | <Technicae Circuit> I'm just using the example |
07:26:22 | PMunch | It tries to access the field .user.username in a JSON object, but it isn't there, so it fails |
07:26:26 | FromDiscord_ | <Technicae Circuit> Hm |
07:26:42 | FromDiscord_ | <Technicae Circuit> I have no idea ;-; |
07:27:14 | PMunch | Wild guess, you haven't set the "token" environment variable it tries to use to connect to Discord |
07:27:36 | PMunch | So instead of valid messages you get an authentication error JSON response instead |
07:28:06 | FromDiscord_ | <Technicae Circuit> I thought that i just put my token in the code |
07:28:21 | PMunch | Oh, you could do that as well |
07:28:38 | FromDiscord_ | <Technicae Circuit> I've messed with the api myself so this should be right |
07:28:50 | FromDiscord_ | <Technicae Circuit> ```nim |
07:28:51 | FromDiscord_ | <Technicae Circuit> import asyncdispatch, discordnim |
07:28:51 | FromDiscord_ | <Technicae Circuit> |
07:28:51 | FromDiscord_ | <Technicae Circuit> proc messageCreate(s: Shard, m: MessageCreate) = |
07:28:51 | FromDiscord_ | <Technicae Circuit> if s.cache.me.id == m.author.id: return |
07:28:51 | FromDiscord_ | <Technicae Circuit> if m.content == "ping": |
07:28:54 | FromDiscord_ | <Technicae Circuit> asyncCheck s.channelMessageSend(m.channel_id, "pong") |
07:28:55 | FromDiscord_ | <Technicae Circuit> |
07:28:57 | FromDiscord_ | <Technicae Circuit> let d = newShard("Bot My token") |
07:28:57 | PMunch | Ugh.. |
07:28:58 | FromDiscord_ | <Technicae Circuit> |
07:29:00 | FromDiscord_ | <Technicae Circuit> proc endSession() {.noconv.} = |
07:29:01 | FromDiscord_ | <Technicae Circuit> waitFor d.disconnect() |
07:29:02 | FromDiscord_ | <Technicae Circuit> |
07:29:04 | FromDiscord_ | <Technicae Circuit> setControlCHook(endSession) |
07:29:06 | FromDiscord_ | <Technicae Circuit> d.compress = true |
07:29:07 | FromDiscord_ | <Technicae Circuit> |
07:29:09 | FromDiscord_ | <Technicae Circuit> let removeProc = d.addHandler(EventType.message_create, messageCreate) |
07:29:09 | PMunch | Please don't paste code into Discord.. |
07:29:11 | FromDiscord_ | <Technicae Circuit> waitFor d.startSession() |
07:29:12 | FromDiscord_ | <Technicae Circuit> |
07:29:13 | FromDiscord_ | <Technicae Circuit> removeProc()``` |
07:29:20 | PMunch | It comes through on IRC and looks horrible.. |
07:29:34 | FromDiscord_ | <Elegant Beef> *quick silent stab at irc* |
07:29:40 | PMunch | https://irclogs.nim-lang.org/24-04-2020.html#07:28:38 |
07:29:42 | FromDiscord_ | <Technicae Circuit> Oh sorry |
07:29:46 | FromDiscord_ | <Technicae Circuit> I completely forgot |
07:30:16 | FromDiscord_ | <Technicae Circuit> https://hastebin.com/mudawitezu.cs |
07:30:18 | FromDiscord_ | <Technicae Circuit> There |
07:30:31 | PMunch | Nothing wrong with IRC, the Discord bot is the issue.. |
07:30:58 | PMunch | Yeah, 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:52 | FromDiscord_ | <Technicae Circuit> Mhm |
07:33:13 | PMunch | This seems to be where the issue comes from: https://github.com/Krognol/discordnim/blob/master/src/ctors.nim#L139 |
07:34:15 | PMunch | Called from here: https://github.com/Krognol/discordnim/blob/master/src/discord.nim#L252 |
07:34:59 | FromDiscord_ | <Technicae Circuit> Damn |
07:35:02 | PMunch | I'm guessing that maybe the Discord API changed.. |
07:35:07 | FromDiscord_ | <Technicae Circuit> Probably |
07:35:10 | FromDiscord_ | <Technicae Circuit> Because intents |
07:35:17 | FromDiscord_ | <Technicae Circuit> And https://blog.discordapp.com/the-future-of-bots-on-discord-4e6e050ab52e |
07:38:36 | FromDiscord_ | <Technicae Circuit> I think I might have to write my own library |
07:38:38 | PMunch | https://github.com/Krognol/discordnim/issues/27 |
07:38:40 | disbot | β₯ Exception: key not found: username ; snippet at 12https://play.nim-lang.org/#ix=2jj0 |
07:39:20 | FromDiscord_ | <Technicae Circuit> Hm |
07:39:25 | PMunch | So maybe check out the develop branch |
07:39:28 | FromDiscord_ | <Technicae Circuit> Okay then |
07:39:34 | FromDiscord_ | <Technicae Circuit> That's 16 months old |
07:39:40 | PMunch | (With nimble you can do that with #develop) |
07:40:24 | FromDiscord_ | <Technicae Circuit> I might try a c++ library in Nimble if possible |
07:42:14 | * | MarderIII joined #nim |
07:42:14 | FromDiscord_ | <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:17 | FromDiscord_ | <Technicae Circuit> Would https://github.com/yourWaifu/sleepy-discord be a good library to try c2nim on? |
07:45:49 | Araq | when you try c2nim PLEASE understand its workflow |
07:45:50 | PMunch | Dunno |
07:46:05 | Araq | yes, c2nim cannot parse Y. |
07:46:28 | Araq | no, 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:06 | Araq | you tweak the header files and use enough options of c2nim so that you don't have to edit the produced Nim code |
07:47:24 | PMunch | Does nimterop work on C++? |
07:47:34 | Araq | and then you keep C header diff and reapply the patch for newer versions of the header file |
07:47:54 | Araq | PMunch, afaik no, it doesn't |
07:48:54 | PMunch | Ugh, why are some things that feel so natural to us so hard to formally describe.. |
07:49:07 | Araq | what do you mean? |
07:49:14 | PMunch | I'm back to fiddling with my no-overlap window manager |
07:49:48 | Araq | ah, these things are nice. a Window manager that actually manages your windows |
07:49:54 | PMunch | Yes |
07:50:32 | PMunch | So 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:04 | FromDiscord_ | <Technicae Circuit> > <Araq> yes, c2nim cannot parse Y. |
07:51:04 | FromDiscord_ | <Technicae Circuit> Okay |
07:53:25 | FromDiscord_ | <Technicae Circuit> I can't figure out c2nim |
07:53:42 | Araq | argh... |
07:53:44 | * | Araq dies |
07:54:17 | PMunch | Haha, you tried Araq |
07:56:48 | FromDiscord_ | <Technicae Circuit> Haha |
07:57:04 | FromDiscord_ | <Technicae Circuit> Sorry π
|
07:57:58 | FromDiscord_ | <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:03 | PMunch | I mean, getting the parts you need should be easy |
08:00:03 | FromDiscord_ | <Technicae Circuit> Welp, looks like I have to directly interact with the discord API |
08:00:17 | FromDiscord_ | <Technicae Circuit> And now I'ma also bombard everyone here with a bunch of questions |
08:01:05 | FromDiscord_ | <Technicae Circuit> So, what's a good library i should use for making post, get, pull and delete requests? |
08:01:56 | PMunch | httpclient in the stdlib should serve you well |
08:02:04 | PMunch | https://nim-lang.org/docs/httpclient.html |
08:02:11 | FromDiscord_ | <Technicae Circuit> Thanks |
08:02:33 | * | liblq-dev joined #nim |
08:03:01 | FromDiscord_ | <Technicae Circuit> So, how do i use an async proc? |
08:04:26 | PMunch | asyncdispatch |
08:05:41 | FromDiscord_ | <Technicae Circuit> Thanks |
08:05:51 | FromDiscord_ | <Technicae Circuit> I think i might just use a python lib with nimpy |
08:07:17 | PMunch | Well 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:19 | FromDiscord_ | <Technicae Circuit> I don't know nearly enough Nim to do this ;-; |
08:39:28 | FromDiscord_ | <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:02 | PMunch | That's just an opportunity to learn :) |
08:48:03 | FromDiscord_ | <Technicae Circuit> I'm going to try it anyway |
08:48:07 | FromDiscord_ | <Technicae Circuit> :p |
08:48:30 | FromDiscord_ | <Technicae Circuit> So, how do i make a package? |
08:48:42 | * | couven92 joined #nim |
08:49:23 | PMunch | nimble init |
08:49:27 | FromDiscord_ | <Technicae Circuit> Oki |
08:49:55 | FromDiscord_ | <Technicae Circuit> I'ma call it `nimcord` |
08:52:25 | FromDiscord_ | <Technicae Circuit> Should i use `C`, `C++`, or `ObjC`? |
08:52:45 | liblq-dev | C |
08:53:12 | FromDiscord_ | <Technicae Circuit> Thanks, can i ask for the reason why? |
08:53:25 | FromDiscord_ | <Recruit_main707> cuz *speed* |
08:53:31 | FromDiscord_ | <Technicae Circuit> Haha okay |
08:53:38 | PMunch | It's the default |
08:53:48 | FromDiscord_ | <Technicae Circuit> What's the most standard Nim version? |
08:53:50 | PMunch | Basically don't use the others unless you have a particular reason |
08:53:55 | PMunch | The most standard? |
08:53:58 | FromDiscord_ | <Technicae Circuit> Mhm |
08:54:03 | FromDiscord_ | <Technicae Circuit> As in the most common |
08:54:05 | PMunch | Latest stable 1.2.0 should be good |
08:54:08 | FromDiscord_ | <Technicae Circuit> Oki |
08:54:31 | PMunch | I'm not sure if choosenim does statistics |
08:54:44 | FromDiscord_ | <Technicae Circuit> :p |
08:55:36 | dom96 | it does actually |
08:57:16 | PMunch | Are they published anywhere? |
08:59:07 | * | NimBot joined #nim |
08:59:11 | dom96 | nope |
08:59:23 | dom96 | and they're probably not 100% accurate anyway |
08:59:32 | PMunch | Of course not |
08:59:38 | PMunch | But it would be interesting to see |
08:59:48 | PMunch | E.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:50 | FromDiscord_ | <Technicae Circuit> How do i make it so I can do `nimble build` to install my lib? |
09:12:18 | FromDiscord_ | <Recruit_main707> with a .nimble file iirc |
09:12:43 | * | Vladar joined #nim |
09:13:06 | FromDiscord_ | <Technicae Circuit> I have the nimble file but it'd saying nothing to build |
09:16:17 | FromDiscord_ | <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:31 | PMunch | `nimble build` is to build packages that provides tools |
09:21:35 | PMunch | So they make a binary |
09:21:42 | PMunch | What you want is `nimble install` |
09:21:44 | * | hax-scramper joined #nim |
09:21:54 | PMunch | @Technicae Circuit ^ |
09:22:04 | FromDiscord_ | <Recruit_main707> @Technicae Circuit ^ |
09:24:08 | FromDiscord_ | <clyybber> @Technicae Circuit Is this your library? https://github.com/krisppurg/dimscord/blob/master/README.md |
09:25:01 | PMunch | clyybber, I highly doubt it, he literally just started :P |
09:26:52 | FromDiscord_ | <clyybber> Oh, well. This just got submitted to the pkglist |
09:27:13 | FromDiscord_ | <clyybber> Might wonna use that instead of making another one yourself |
09:28:22 | PMunch | Yeah I was about to say |
09:29:15 | FromDiscord_ | <clyybber> @Yardanico |
09:29:50 | FromDiscord_ | <clyybber> Maybe this could be used for the bridge |
09:48:19 | * | waleee-cl joined #nim |
09:55:29 | FromDiscord_ | <Technicae Circuit> > <PMunch> What you want is `nimble install` |
09:55:29 | FromDiscord_ | <Technicae Circuit> Oh okay, thanks |
09:55:45 | PMunch | No problem :) |
09:56:00 | FromDiscord_ | <Technicae Circuit> > Oh, well. This just got submitted to the pkglist |
09:56:00 | FromDiscord_ | <Technicae Circuit> Oh cool, thanks, I'll probably make my own lib once i get more experience |
09:57:30 | PMunch | If you want a project we sorely need a better Discord bot for this channel |
09:57:45 | PMunch | One that create paste links instead of directly forwarding code.. |
09:59:55 | FromDiscord_ | <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:38 | PMunch | ix.io is your friend :) |
10:00:55 | PMunch | You can have a look at how the Nim playground does it, super simple |
10:01:46 | PMunch | https://github.com/PMunch/nim-playground/blob/master/src/nim_playground.nim#L111-L115 |
10:02:13 | PMunch | And the point was to have a project to do in Nim to learn the language :) |
10:03:58 | FromDiscord_ | <Technicae Circuit> Oo cool |
10:06:04 | FromDiscord_ | <Technicae Circuit> Now i need to figure out a command handler ;-; |
10:06:16 | PMunch | Command handler? |
10:06:18 | FromDiscord_ | <Technicae Circuit> Does Nim allow you to import local files |
10:06:25 | FromDiscord_ | <Technicae Circuit> Yeah for the discord lib |
10:06:40 | PMunch | The question to "Does Nim allow you to" is pretty much always "yes" :P |
10:06:48 | FromDiscord_ | <Technicae Circuit> Haha |
10:07:02 | FromDiscord_ | <Technicae Circuit> How do i do it? `import ./file/path`? |
10:07:19 | PMunch | Just "import file/path" works fine |
10:07:56 | * | natrys joined #nim |
10:12:36 | FromDiscord_ | <Technicae Circuit> Thanks! |
10:12:40 | FromDiscord_ | <Technicae Circuit> https://github.com/Oples/nanorc-nim/blob/master/nim.nanorc |
10:12:43 | FromDiscord_ | <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:06 | FromDiscord_ | <Technicae Circuit> Does importing a module make the variables declared available aswell? |
10:17:34 | FromDiscord_ | <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:03 | skrylar[m] | they would have to be exported with * |
10:18:10 | * | couven92 joined #nim |
10:18:41 | FromDiscord_ | <Technicae Circuit> So like `const *name ...`? |
10:19:54 | FromDiscord_ | <Recruit_main707> after the name |
10:22:18 | FromDiscord_ | <Technicae Circuit> Oki |
10:22:24 | FromDiscord_ | <Technicae Circuit> Also, how do i make arrays? |
10:22:44 | FromDiscord_ | <Recruit_main707> var array = [1, 2, 3, 4] |
10:23:00 | FromDiscord_ | <Technicae Circuit> Thanks |
10:23:13 | FromDiscord_ | <Recruit_main707> or var array: array[4, int] = [1, 2, 3, 4] |
10:25:26 | FromDiscord_ | <Technicae Circuit> So the structure would be like ```nim |
10:25:26 | FromDiscord_ | <Technicae Circuit> const |
10:25:26 | FromDiscord_ | <Technicae Circuit> name*:string = "Name" |
10:25:26 | FromDiscord_ | <Technicae Circuit> aliases*:array[amount_of_aliases] = [aliases] |
10:25:27 | FromDiscord_ | <Technicae Circuit> |
10:25:27 | FromDiscord_ | <Technicae Circuit> proc code(msg:idk_about_this_yet, args:array) = |
10:25:29 | FromDiscord_ | <Technicae Circuit> # Stuff``` |
10:25:42 | FromDiscord_ | <Technicae Circuit> Would that work? |
10:25:50 | FromDiscord_ | <Technicae Circuit> So the structure would be like ```nim |
10:25:50 | FromDiscord_ | <Technicae Circuit> const |
10:25:50 | FromDiscord_ | <Technicae Circuit> name*:string = "Name" |
10:25:50 | FromDiscord_ | <Technicae Circuit> aliases*:array[amount_of_aliases] = [aliases] |
10:25:50 | FromDiscord_ | <Technicae Circuit> |
10:25:51 | FromDiscord_ | <Technicae Circuit> proc code(msg:idk_about_this_yet, args:array)* = |
10:25:52 | FromDiscord_ | <Technicae Circuit> # Stuff``` |
10:26:05 | FromDiscord_ | <Technicae Circuit> Annd i forgot about editing... |
10:26:18 | FromDiscord_ | <Technicae Circuit> And i forgot about irc |
10:26:28 | FromDiscord_ | <Technicae Circuit> π
|
10:26:49 | FromDiscord_ | <Recruit_main707> nope, there are a few things wrong |
10:28:05 | FromDiscord_ | <Technicae Circuit> https://paste.pythondiscord.com/veroziwelu.py |
10:28:24 | FromDiscord_ | <Technicae Circuit> Does the `*` need to be after the type aswell? |
10:29:17 | FromDiscord_ | <Recruit_main707> https://play.nim-lang.org/#ix=2jjU |
10:29:27 | FromDiscord_ | <Recruit_main707> thats how it should be done |
10:30:27 | FromDiscord_ | <Recruit_main707> `["alias1", "alias2"] # etc` this would need to reach the size of your array |
10:31:20 | FromDiscord_ | <Recruit_main707> also, `const` means those variables are only available at compile time, have it in mind |
10:35:38 | FromDiscord_ | <Technicae Circuit> Oh okay |
10:35:42 | FromDiscord_ | <Technicae Circuit> Thanks |
10:36:57 | solitudesf | no, const means that value is known at compile time |
10:37:00 | FromDiscord_ | <Technicae Circuit> Thanks |
10:37:40 | * | natrys quit (Quit: natrys) |
10:38:08 | FromDiscord_ | <Technicae Circuit> I want to make sure `args` is an array but i don't know how long it'll be |
10:38:22 | FromDiscord_ | <Recruit_main707> then use seq[string] |
10:38:38 | FromDiscord_ | <Recruit_main707> they are basically python lists (if you come from python) |
10:39:00 | FromDiscord_ | <Technicae Circuit> Cool |
10:39:05 | FromDiscord_ | <Technicae Circuit> I do come from Python :p |
10:39:40 | FromDiscord_ | <Technicae Circuit> ```let |
10:39:40 | FromDiscord_ | <Technicae Circuit> number_of_aliases = 3 |
10:39:40 | FromDiscord_ | <Technicae Circuit> name*:string = "Name" |
10:39:40 | FromDiscord_ | <Technicae Circuit> aliases*:array[number_of_aliases, string] = ["alias1", "alias2"] # etc |
10:39:40 | FromDiscord_ | <Technicae Circuit> #[This part is optional ]# |
10:39:41 | FromDiscord_ | <Technicae Circuit> |
10:39:43 | FromDiscord_ | <Technicae Circuit> proc code*(msg:idk_about_this_yet, args:seq[string]) = |
10:39:44 | FromDiscord_ | <Technicae Circuit> #code``` |
10:39:46 | FromDiscord_ | <Technicae Circuit> ```nim |
10:39:48 | FromDiscord_ | <Technicae Circuit> let |
10:39:49 | FromDiscord_ | <Technicae Circuit> number_of_aliases = 3 |
10:39:51 | FromDiscord_ | <Technicae Circuit> name*:string = "Name" |
10:39:53 | FromDiscord_ | <Technicae Circuit> aliases*:array[number_of_aliases, string] = ["alias1", "alias2"] # etc |
10:39:55 | FromDiscord_ | <Technicae Circuit> #[This part is optional ]# |
10:39:56 | FromDiscord_ | <Technicae Circuit> |
10:39:58 | FromDiscord_ | <Technicae Circuit> proc code*(msg:idk_about_this_yet, args:seq[string]) = |
10:39:59 | FromDiscord_ | <Technicae Circuit> #code``` |
10:40:01 | FromDiscord_ | <Technicae Circuit> Should be alright now |
10:40:05 | FromDiscord_ | <Recruit_main707> use this web for pasting code: https://play.nim-lang.org/ |
10:40:08 | PMunch | Pleeease stop pasting.. |
10:40:11 | FromDiscord_ | <Technicae Circuit> Oh sorry |
10:40:18 | FromGitter | <sheerluck> Technicae Circuit god damn |
10:40:19 | FromDiscord_ | <Technicae Circuit> I keep forgetting ;-; |
10:40:45 | FromDiscord_ | <Recruit_main707> and when you edit messages they are sent again iirc, so try not to either |
10:41:19 | PMunch | And hurry up with creating the new Discord bot! :P |
10:41:25 | PMunch | s/bot/bridge |
10:41:29 | FromDiscord_ | <Technicae Circuit> :p |
10:41:39 | FromDiscord_ | <Technicae Circuit> I don't even know how to use irc |
10:41:44 | FromDiscord_ | <Technicae Circuit> https://play.nim-lang.org/#ix=2jk1 |
10:41:46 | FromDiscord_ | <Technicae Circuit> There |
10:41:52 | FromDiscord_ | <Technicae Circuit> Would that code be valid? |
10:42:04 | FromDiscord_ | <Technicae Circuit> (also does irc have a feature for editing messages?) |
10:42:18 | PMunch | Nope |
10:42:35 | PMunch | It's very basic text chat |
10:42:39 | FromDiscord_ | <Technicae Circuit> Damn |
10:42:50 | FromDiscord_ | <Recruit_main707> PlaygroundCode on GitHub |
10:42:50 | FromDiscord_ | <Recruit_main707> Font size: |
10:42:50 | FromDiscord_ | <Recruit_main707> 13 |
10:42:50 | FromDiscord_ | <Recruit_main707> Compilation target: Nim version: |
10:42:51 | FromDiscord_ | <Recruit_main707> 1 |
10:42:51 | FromDiscord_ | <Recruit_main707> let |
10:42:51 | FromDiscord_ | <Recruit_main707> 2 |
10:42:53 | FromDiscord_ | <Recruit_main707> number_of_aliases = 2 # You dont need this |
10:42:54 | FromDiscord_ | <Recruit_main707> 3 |
10:42:56 | FromDiscord_ | <Recruit_main707> name*:string = "Name" |
10:42:57 | FromDiscord_ | <Recruit_main707> 4 |
10:42:59 | FromDiscord_ | <Recruit_main707> aliases*:seq[string] = @["alias1", "alias2"] # @ means its a seq instead of an array |
10:43:01 | FromDiscord_ | <Recruit_main707> 5 |
10:43:02 | PMunch | Recruit_main707... |
10:43:02 | FromDiscord_ | <Recruit_main707> |
10:43:03 | FromDiscord_ | <Recruit_main707> 6 |
10:43:05 | FromDiscord_ | <Recruit_main707> proc code*(msg, args:seq[string]) = |
10:43:06 | FromDiscord_ | <Recruit_main707> 7 |
10:43:08 | FromDiscord_ | <Recruit_main707> #code |
10:43:09 | FromDiscord_ | <Recruit_main707> 8 |
10:43:10 | FromDiscord_ | <Recruit_main707> β |
10:43:12 | FromDiscord_ | <Recruit_main707> Share to ixShowing: outputRun!(ctrl-enter) |
10:43:14 | FromDiscord_ | <Recruit_main707> https://play.nim-lang.org/#ix=2jk3 |
10:43:15 | FromDiscord_ | <Recruit_main707> oh shit |
10:43:17 | FromDiscord_ | <Technicae Circuit> hahaha |
10:43:34 | * | hax-scramper quit (Ping timeout: 240 seconds) |
10:43:43 | FromDiscord_ | <Technicae Circuit> Also, why not use webhooks on discord, so the user name would be the irc username |
10:43:44 | PMunch | Did you just dit Ctrl+A Ctrl+C? :P |
10:43:50 | PMunch | Got line numbers and everything :P |
10:44:02 | FromDiscord_ | <Technicae Circuit> And if irc has webhooks do the same for irc :p |
10:44:06 | skrylar[m] | someone did a bad job |
10:44:10 | PMunch | Most people just use the old skool star fix |
10:44:12 | PMunch | school* |
10:44:16 | FromDiscord_ | <Recruit_main707> i selected with mouse, and it went a bit too high :p im so sorry |
10:44:17 | PMunch | Like that ^ |
10:44:35 | * | hax-scramper joined #nim |
10:44:41 | PMunch | Or like I do with substitution syntax |
10:44:48 | PMunch | Like I did earlier with s/bot/bridge |
10:44:50 | FromDiscord_ | <Technicae Circuit> What language is the bot written in right now? |
10:45:07 | PMunch | @FromDiscord_, help |
10:45:14 | PMunch | @FromDiscord_, version |
10:45:17 | PMunch | Hmm |
10:45:19 | PMunch | No idea |
10:45:21 | FromDiscord_ | <Technicae Circuit> Wut |
10:45:24 | PMunch | Think it's an off the shelf one |
10:45:35 | FromDiscord_ | <Technicae Circuit> @gitterirc |
10:45:39 | FromDiscord_ | <Technicae Circuit> @gitterirc help |
10:45:51 | PMunch | I know disbot has some commands like that |
10:45:56 | PMunch | !help |
10:46:00 | PMunch | Hmm |
10:46:07 | PMunch | !eval echo 3+4 |
10:46:08 | FromDiscord_ | <Technicae Circuit> Would you mind if i first rewrite the bot in Python, then rewrite it in Nim later? |
10:46:09 | NimBot | 7 |
10:46:27 | FromDiscord_ | <Technicae Circuit> !eval echo "Test" |
10:46:30 | NimBot | Test |
10:46:31 | FromDiscord_ | <Technicae Circuit> Oof |
10:46:34 | FromDiscord_ | <Technicae Circuit> Oh cool |
10:46:35 | PMunch | As long as we don't get code pastes on IRC you can rewrite it in assembler for all I care.. |
10:46:42 | FromDiscord_ | <Technicae Circuit> Haha |
10:46:52 | FromDiscord_ | <Technicae Circuit> Does irc not support newlines either? |
10:46:56 | PMunch | Huh, disbot PMs you the reply |
10:47:16 | PMunch | Don't think so |
10:47:36 | PMunch | We do have colours and italics/bold etc. |
10:48:01 | FromDiscord_ | <Technicae Circuit> Damn |
10:48:07 | PMunch | You can try IRC here if you like: https://webchat.freenode.net/ |
10:48:28 | FromDiscord_ | <Technicae Circuit> I've tried it before but I can't login again π
|
10:48:47 | * | PMunch_web joined #nim |
10:48:50 | PMunch_web | You don't need a password |
10:49:03 | FromDiscord_ | <Technicae Circuit> Don't most channels need a password? |
10:49:05 | PMunch_web | Just choose a nick no one else uses and goahead |
10:49:13 | PMunch_web | Some do, but not all |
10:49:20 | PMunch_web | This 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:07 | PMunch | Hi Technicae_Circui |
10:50:12 | Technicae_Circui | And my nim was cut off- |
10:50:15 | Technicae_Circui | Heya |
10:50:21 | Technicae_Circui | Sup? |
10:50:29 | PMunch | Haha |
10:50:38 | PMunch | So as I said it's only text |
10:50:51 | Technicae_Circui | What do you mean? |
10:50:58 | PMunch | And italics bold and underline |
10:51:04 | Technicae_Circui | Oh okay |
10:51:11 | PMunch | A12lo02ng04 w06it08h 10co12lo02ur04s! |
10:51:12 | Technicae_Circui | Test\ncool |
10:51:15 | Technicae_Circui | Oof |
10:51:19 | Technicae_Circui | Oo colours |
10:51:23 | PMunch | Haha |
10:51:24 | Technicae_Circui | Very nice |
10:51:35 | PMunch | Mostly used for bots to highlight messages and such |
10:51:43 | PMunch | !issue 42 |
10:51:45 | disbot | https://github.com/nim-lang/Nim/issues/42 -- 5illegal recursion in type 'TThread' 7& 29 more... |
10:51:48 | PMunch | Like that |
10:51:58 | Technicae_Circui | Oh cool |
10:52:34 | Technicae_Circui | Apparently new lines can be simulated by just splitting the message and sending those parts in quick succession |
10:53:09 | PMunch | Yes, that's what happens when you paste code in here |
10:53:18 | Technicae_Circui | Oh okay, is it that bad? |
10:53:38 | * | Romanson joined #nim |
10:53:40 | PMunch | You tell me: https://irclogs.nim-lang.org/24-04-2020.html#10:38:08 |
10:53:41 | Technicae_Circui | Someone from discord please send a multline message |
10:53:45 | Technicae_Circui | O |
10:54:05 | Technicae_Circui | I can't see it ;-; |
10:54:15 | PMunch | What do you mean you can't see it? |
10:54:26 | FromDiscord_ | <Recruit_main707> should i? |
10:54:26 | * | Technicae_Circui quit (Remote host closed the connection) |
10:54:41 | PMunch | Not now.. He quit the online IRC chat.. |
10:54:46 | FromDiscord_ | <Technicae Circuit> And my IRC session just got screwed while opening the link |
10:54:51 | FromDiscord_ | <Technicae Circuit> :p |
10:54:53 | * | xcm quit (Remote host closed the connection) |
10:54:56 | PMunch | Haha |
10:55:08 | FromDiscord_ | <Technicae Circuit> Oh damn |
10:55:11 | FromDiscord_ | <Technicae Circuit> That is bad |
10:55:37 | FromDiscord_ | <Technicae Circuit> I feel sorry for people who use irc |
10:56:24 | FromDiscord_ | <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:59 | FromDiscord_ | <Technicae Circuit> But does anyone else here know irc? |
10:57:04 | * | xcm joined #nim |
10:57:15 | FromDiscord_ | <Technicae Circuit> I mean |
10:57:27 | FromDiscord_ | <Technicae Circuit> Does anyone know how to make an irc bot in Python here? |
10:57:44 | FromDiscord_ | <Technicae Circuit> I'm going to use Python until i learn more Nim |
10:58:01 | FromGitter | <sheerluck> I'm going to use Python too until i learn more Nim |
10:58:08 | FromDiscord_ | <Technicae Circuit> Coolio |
10:58:19 | FromDiscord_ | <Recruit_main707> learn-by-doing |
10:58:42 | FromDiscord_ | <Technicae Circuit> Nim doesn't have a good discord lib yet |
10:58:48 | FromDiscord_ | <Rika> Discordnim? |
10:58:50 | FromDiscord_ | <Technicae Circuit> Plus I don't even know irc |
10:58:55 | FromDiscord_ | <Technicae Circuit> That's broken af |
10:59:03 | FromDiscord_ | <clyybber> it now has |
10:59:13 | FromDiscord_ | <clyybber> dimscord |
10:59:13 | FromDiscord_ | <Technicae Circuit> Discordsrm or something |
10:59:20 | FromDiscord_ | <Technicae Circuit> Yeah |
10:59:32 | FromDiscord_ | <Technicae Circuit> I don't know about irc though |
10:59:33 | FromDiscord_ | <clyybber> well, in a few minutes, ones the CI passes π |
10:59:34 | FromDiscord_ | <Rika> Who made it |
10:59:42 | FromDiscord_ | <Technicae Circuit> I'm not sure |
10:59:48 | FromDiscord_ | <clyybber> https://github.com/krisppurg/dimscord |
11:00:10 | FromDiscord_ | <Rika> Ya sure this one works better? |
11:00:32 | FromDiscord_ | <clyybber> didn't try it |
11:00:50 | FromDiscord_ | <Technicae Circuit> It works atleast |
11:00:53 | FromDiscord_ | <Technicae Circuit> I think |
11:00:58 | FromDiscord_ | <clyybber> its also maintained |
11:01:02 | FromDiscord_ | <Rika> @Technicae Circuit Yardanico is already working on a new bridge |
11:01:07 | FromDiscord_ | <clyybber> and theres plan for voice support |
11:01:15 | PMunch | Voice support? |
11:01:23 | FromDiscord_ | <Recruit_main707> hold up, voice support? |
11:01:28 | FromDiscord_ | <Recruit_main707> for a discord bot? |
11:01:42 | FromDiscord_ | <clyybber> yeag |
11:01:48 | FromDiscord_ | <Rika> Many libraries have voice support |
11:01:48 | FromDiscord_ | <clyybber> *h |
11:01:56 | FromDiscord_ | <Recruit_main707> how is that though? |
11:02:00 | FromDiscord_ | <Rika> Hm I'll switch my bot to this I guess |
11:02:10 | * | Trustable joined #nim |
11:02:41 | FromDiscord_ | <Rika> Never mind, I'm skeptical |
11:02:59 | FromDiscord_ | <clyybber> lol |
11:03:45 | FromDiscord_ | <clyybber> can't hurt trying |
11:04:08 | FromDiscord_ | <Rika> ??? Everything is a ref object |
11:04:09 | FromDiscord_ | <Rika> Why? |
11:04:14 | FromDiscord_ | <Technicae Circuit> It's not working |
11:04:30 | FromDiscord_ | <Technicae Circuit> > @Technicae Circuit Yardanico is already working on a new bridge |
11:04:30 | FromDiscord_ | <Technicae Circuit> Oh okay rhen |
11:04:33 | FromDiscord_ | <Rika> What the heck |
11:04:43 | FromDiscord_ | <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:56 | FromDiscord_ | <Technicae Circuit> I'm really tempted to write my own library |
11:05:06 | dom96 | voice support would be cool |
11:05:10 | FromDiscord_ | <Rika> Good luck with that |
11:05:15 | FromDiscord_ | <Technicae Circuit> :p |
11:05:32 | dom96 | @Technicae Circuit: do it, sounds like a good learning experience :) |
11:05:43 | FromDiscord_ | <Technicae Circuit> I've already messed with the discord API a bit ages ago |
11:05:58 | FromDiscord_ | <Technicae Circuit> So it shouldn't be too hard, right? π
|
11:06:26 | FromDiscord_ | <clyybber> Not sure where that error comes from. Clearly there *is* a lib/gateway |
11:06:27 | FromDiscord_ | <Rika> It's a lot of objects to encode |
11:06:40 | FromDiscord_ | <Technicae Circuit> Welp |
11:06:47 | FromDiscord_ | <Rika> There's a lib gateway nim not a lib gateway |
11:07:08 | FromDiscord_ | <Technicae Circuit> I'm going to try and use https://nim-lang.org/docs/httpclient.html to send a message with Nim |
11:08:05 | FromDiscord_ | <Technicae Circuit> ~~Why not make a channel where discord bots can be invited for testing purposes~~ |
11:08:21 | FromDiscord_ | <Technicae Circuit> ~~And only give bots access to that channel~~ |
11:08:27 | FromDiscord_ | <Rika> Perms aren't that granular in discord |
11:08:32 | FromDiscord_ | <Technicae Circuit> Bad idea |
11:08:34 | FromDiscord_ | <Technicae Circuit> Wdym? |
11:08:46 | FromDiscord_ | <clyybber> @Rika > There's a lib gateway nim not a lib gateway |
11:08:46 | FromDiscord_ | <clyybber> WDYM? |
11:09:07 | FromDiscord_ | <Rika> @Clyybber error didn't state an extension |
11:09:32 | FromDiscord_ | <Rika> @Technicae Circuit misunderstood |
11:09:48 | FromDiscord_ | <clyybber> @Rika Thats normal |
11:09:52 | FromDiscord_ | <Technicae Circuit> Oh |
11:09:54 | FromDiscord_ | <clyybber> When the file doesn't exist |
11:10:08 | FromDiscord_ | <clyybber> My guess is that the lib didn't get cloned/downloaded |
11:10:12 | FromDiscord_ | <Technicae Circuit> |
11:10:12 | FromDiscord_ | <Technicae Circuit> https://cdn.discordapp.com/attachments/371759389889003532/703201119169413120/Screenshot_20200424_121005_com.termux.jpg |
11:10:21 | FromDiscord_ | <clyybber> yeah |
11:10:22 | FromDiscord_ | <Technicae Circuit> I cloned it and used the devel branch |
11:10:27 | FromDiscord_ | <Technicae Circuit> Then used nimble install |
11:11:03 | FromDiscord_ | <clyybber> nimble doesn't copy it because its not specified in the .nimble file I think |
11:11:18 | FromDiscord_ | <Technicae Circuit> Should i manually move the folder then? |
11:11:25 | FromDiscord_ | <Technicae Circuit> Or would that break nimble? |
11:11:26 | FromDiscord_ | <clyybber> yeah, for now |
11:11:27 | FromDiscord_ | <clyybber> nope |
11:11:29 | FromDiscord_ | <Technicae Circuit> Oki |
11:11:30 | FromDiscord_ | <clyybber> it wouldn't |
11:12:29 | FromDiscord_ | <Technicae Circuit> Invalid indentation now apparently |
11:12:34 | FromDiscord_ | <Technicae Circuit> In their example |
11:14:08 | FromDiscord_ | <Rika> Holy shit I really don't like the look of this library |
11:14:24 | FromDiscord_ | <Rika> I'll stick to fixing discord nim I guess? |
11:15:59 | FromDiscord_ | <clyybber> what "look"??? |
11:16:12 | dom96 | make sure to post issues on that libraries github |
11:16:46 | FromDiscord_ | <clyybber> dom96: Is the solution to add lib to the srcdirs? |
11:16:59 | FromDiscord_ | <Rika> @Clyybber the code |
11:17:12 | FromDiscord_ | <Rika> Maybe I'll check what it does differently |
11:17:22 | FromDiscord_ | <clyybber> I dunno, looks ok to me |
11:17:30 | FromDiscord_ | <clyybber> And the ref objects seem to be ref on purpose |
11:17:35 | FromDiscord_ | <clyybber> since some are not |
11:17:44 | * | dadada joined #nim |
11:18:06 | * | dadada is now known as Guest28090 |
11:18:10 | FromDiscord_ | <Rika> Seem |
11:18:31 | FromDiscord_ | <Technicae Circuit> https://play.nim-lang.org/#ix=2jki |
11:18:33 | dom96 | clyybber: 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:41 | FromDiscord_ | <Technicae Circuit> Doesn't work because of indentation apparently |
11:19:00 | * | Vladar quit (Quit: Leaving) |
11:19:21 | * | Hideki_ joined #nim |
11:20:15 | FromDiscord_ | <Rika> Pass should be discard |
11:20:27 | FromDiscord_ | <Technicae Circuit> Oh okay |
11:21:25 | FromDiscord_ | <Technicae Circuit> Still invalid indentation |
11:21:40 | * | Hideki_ quit (Remote host closed the connection) |
11:21:44 | PMunch | Because it's indented with 4 spaces.. |
11:21:55 | * | Hideki_ joined #nim |
11:22:16 | FromDiscord_ | <Technicae Circuit> That's the example :p |
11:22:30 | FromDiscord_ | <Technicae Circuit> Does Nim only accept an indentation width of 2? |
11:22:34 | PMunch | Try this: https://play.nim-lang.org/#ix=2jkl |
11:22:55 | PMunch | Well 4 can work, but that's mostly by chance :P |
11:23:20 | * | Hideki_ quit (Remote host closed the connection) |
11:23:56 | FromDiscord_ | <Technicae Circuit> Oh okay |
11:23:59 | FromDiscord_ | <clyybber> huh? |
11:24:09 | FromDiscord_ | <clyybber> nim doesn't care about how many spaces you indent with |
11:24:15 | FromDiscord_ | <clyybber> as long as its correct |
11:24:18 | * | Hideki_ joined #nim |
11:24:57 | FromDiscord_ | <Technicae Circuit> Still invalid |
11:25:04 | PMunch | "As long as it's correct", which is 2 spaces :P |
11:25:09 | PMunch | What line? |
11:25:44 | FromDiscord_ | <clyybber> eh, 4 is correct too |
11:25:50 | FromDiscord_ | <clyybber> X is correct |
11:25:52 | * | Hideki_ quit (Remote host closed the connection) |
11:26:05 | * | Hideki_ joined #nim |
11:27:09 | FromDiscord_ | <clyybber> the lexer doesn't care about how many spaces you indent with |
11:27:25 | FromDiscord_ | <clyybber> he only cares about: as many as in the line before, more, less |
11:30:00 | FromDiscord_ | <Technicae Circuit> `<PMunch> What line?` line 19 |
11:32:25 | FromDiscord_ | <Technicae Circuit> I wish Nim had braces |
11:32:39 | FromDiscord_ | <Technicae Circuit> Even though I come from Python, i prefer braces |
11:32:49 | Faulander | thank god it doesn't. |
11:33:03 | FromDiscord_ | <Recruit_main707> braces π€’ |
11:33:05 | FromDiscord_ | <clyybber> braces are a longer curse |
11:33:11 | FromDiscord_ | <Technicae Circuit> Haha |
11:33:32 | FromDiscord_ | <Technicae Circuit> I like braces, idk why tho Β―\\_(γ)\_/Β― |
11:34:01 | Faulander | then use rust, go, c, c++, java, js :) |
11:34:02 | FromDiscord_ | <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:33 | FromDiscord_ | <Recruit_main707> (i call them tabs, i know they are spaces) |
11:34:38 | FromDiscord_ | <Technicae Circuit> O |
11:34:42 | Faulander | same 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:51 | FromDiscord_ | <Technicae Circuit> Haha |
11:35:10 | FromDiscord_ | <Technicae Circuit> I just think braces are nice |
11:35:21 | FromDiscord_ | <clyybber> You can use braces in nim too btw |
11:35:33 | FromDiscord_ | <clyybber> just put everything in `(` `)` |
11:36:05 | Faulander | code without is so much more readable. |
11:36:52 | FromDiscord_ | <Technicae Circuit> Wait |
11:37:11 | FromDiscord_ | <Technicae Circuit> So `(` and `)` basically removes the need for indents? |
11:37:19 | FromDiscord_ | <Technicae Circuit> Or do indents still need to be added? |
11:37:51 | Faulander | wait ... you want to write code without indentation BUT with braces? Jesus, i hope the only person looking at that code is you ;) |
11:38:41 | FromDiscord_ | <Technicae Circuit> I include indents even with braces |
11:38:49 | FromDiscord_ | <Technicae Circuit> I just don't want the indents to matter |
11:39:27 | * | Hideki_ quit (Remote host closed the connection) |
11:40:56 | FromDiscord_ | <clyybber> @Technicae Circuit No, you still cant write: |
11:41:11 | FromDiscord_ | <clyybber> ``` |
11:41:11 | FromDiscord_ | <clyybber> ( |
11:41:12 | FromDiscord_ | <clyybber> this |
11:41:12 | FromDiscord_ | <clyybber> is |
11:41:12 | FromDiscord_ | <clyybber> stipud |
11:41:12 | FromDiscord_ | <clyybber> )``` |
11:41:17 | FromDiscord_ | <Technicae Circuit> Yeah |
11:41:30 | FromDiscord_ | <Technicae Circuit> It's a shame ;-; |
11:41:33 | FromDiscord_ | <clyybber> think of it as a style check included with the compiler for your pleasure π |
11:41:47 | FromDiscord_ | <clyybber> @Technicae Circuit why do you want to write such code.... |
11:41:53 | * | Hideki_ joined #nim |
11:42:33 | FromDiscord_ | <Technicae Circuit> Because indents can get annoying, and i blame one language ***cough cough*** ~~Python~~ ***cough cough*** |
11:42:54 | FromDiscord_ | <clyybber> you know whats more annoying |
11:43:06 | FromDiscord_ | <clyybber> noone undestanding your code |
11:43:18 | FromDiscord_ | <clyybber> and it looking like poop :p |
11:43:32 | FromDiscord_ | <Technicae Circuit> True but I still include indents |
11:43:44 | FromDiscord_ | <clyybber> then you shouldn't care ? |
11:44:18 | * | Hideki_ quit (Remote host closed the connection) |
11:44:24 | FromDiscord_ | <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:34 | FromDiscord_ | <clyybber> Both are a plus in my book |
11:44:49 | FromDiscord_ | <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:56 | FromDiscord_ | <Technicae Circuit> And using tabs are bad practice |
11:45:09 | FromDiscord_ | <clyybber> Its just an editor problem |
11:45:22 | FromDiscord_ | <clyybber> Configure your editor to insert spaces instead of tabs. |
11:45:25 | FromDiscord_ | <clyybber> Or make a git hook |
11:45:28 | FromDiscord_ | <Recruit_main707> ^ |
11:45:35 | FromDiscord_ | <Technicae Circuit> What's a git hook? |
11:45:55 | FromDiscord_ | <clyybber> Something that runs when git does something |
11:46:01 | FromDiscord_ | <Technicae Circuit> O |
11:46:02 | FromDiscord_ | <clyybber> like pre-commit, post-commit |
11:46:20 | FromDiscord_ | <Technicae Circuit> So i can just turn all tabs to spaces |
11:46:27 | FromDiscord_ | <clyybber> yeah |
11:46:29 | FromDiscord_ | <Recruit_main707> yep |
11:46:33 | FromDiscord_ | <Technicae Circuit> Coolio |
11:46:44 | FromDiscord_ | <Technicae Circuit> ~~I still want braces~~ |
11:46:44 | FromDiscord_ | <clyybber> coders paradise |
11:46:53 | FromDiscord_ | <Technicae Circuit> :p |
11:47:19 | FromDiscord_ | <clyybber> if I want to write shitty code, I write perl : ) |
11:47:48 | FromDiscord_ | <sealegs> @Technicae Circuit install dimscord via git |
11:48:05 | FromDiscord_ | <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:07 | FromDiscord_ | <Technicae Circuit> Haha |
11:49:09 | FromDiscord_ | <Technicae Circuit> I did |
11:49:19 | FromDiscord_ | <clyybber> @Technicae Circuit maybe this will cure you: https://github.com/belamenso/v |
11:49:40 | FromDiscord_ | <Technicae Circuit> I did `git clone library_url` then nimble install |
11:49:42 | FromDiscord_ | <Technicae Circuit> What's that |
11:49:43 | FromDiscord_ | <clyybber> @Technicae Circuit Oh btw when you clone via git, you don't have to nimble install. You can nimble develop too |
11:49:53 | FromDiscord_ | <clyybber> @Technicae Circuit It is cursed. |
11:50:23 | FromDiscord_ | <Technicae Circuit> Omfg |
11:50:30 | FromDiscord_ | <Technicae Circuit> ***This is amazing*** |
11:51:08 | FromDiscord_ | <clyybber> @Yardanico <- this fella here created an unholy abonimation fork of the above: https://github.com/Yardanico/nim-emojify/commit/dae1893a3e25d97f9c9078491b399c29f27e7184 |
11:51:49 | FromDiscord_ | <Technicae Circuit> Hahahaha |
11:51:59 | FromDiscord_ | <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:59 | FromDiscord_ | <Technicae Circuit> I might actually troll my friends with this |
11:52:14 | FromDiscord_ | <Technicae Circuit> Oh okay |
11:52:19 | FromDiscord_ | <clyybber> @sealegs Might wonna ask dom96 about how to fix that issue |
11:52:31 | FromDiscord_ | <clyybber> with lib not being copied/installed by nimble |
11:53:11 | FromDiscord_ | <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:11 | FromDiscord_ | <Technicae Circuit> Can we make a discord bot for this server? |
11:57:13 | FromDiscord_ | <Technicae Circuit> In Nim |
11:57:44 | FromDiscord_ | <Technicae Circuit> And then make it so commands are generated from files :p |
11:57:48 | * | Hideki_ joined #nim |
11:58:56 | FromDiscord_ | <sealegs> Just like @gitterirc? |
11:59:00 | FromDiscord_ | <Technicae Circuit> Mhm |
11:59:08 | FromDiscord_ | <Technicae Circuit> But actually make the bot cool and useful |
11:59:19 | FromDiscord_ | <sealegs> I was thinking of that before when I was working on the lib |
11:59:25 | FromDiscord_ | <Technicae Circuit> Oh? |
11:59:35 | FromDiscord_ | <sealegs> It actually took me 4 or 5 months |
11:59:36 | FromDiscord_ | <Technicae Circuit> I think it'd be cool |
11:59:39 | FromDiscord_ | <Technicae Circuit> Oo |
12:00:29 | * | Hideki_ quit (Remote host closed the connection) |
12:00:43 | * | Hideki_ joined #nim |
12:01:03 | FromDiscord_ | <Technicae Circuit> I'd like the commands would be generated from files |
12:01:08 | FromDiscord_ | <Technicae Circuit> Let me write an example |
12:01:19 | FromDiscord_ | <sealegs> hmm ok |
12:01:41 | FromDiscord_ | <Technicae Circuit> Generating the commands from files can clean everything up alot |
12:01:46 | FromDiscord_ | <clyybber> ? |
12:01:58 | FromDiscord_ | <clyybber> oh, you mean discord commands |
12:02:00 | * | Hideki_ quit (Remote host closed the connection) |
12:02:03 | FromDiscord_ | <Technicae Circuit> Because having one massive file is hideous |
12:02:04 | FromDiscord_ | <Technicae Circuit> Yeah |
12:02:29 | FromDiscord_ | <clyybber> thats out of dimsord's scope I suppose |
12:02:39 | FromDiscord_ | <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:30 | FromDiscord_ | <Technicae Circuit> The bot |
12:04:35 | FromDiscord_ | <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:53 | PMunch | Sorry, I had to go there for a sec |
12:10:58 | PMunch | Technicae 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:59 | FromDiscord_ | <Technicae Circuit> I had to go too :p |
12:24:21 | FromDiscord_ | <Technicae Circuit> But https://play.nim-lang.org/#ix=2jkN is how i think the structure should be like |
12:24:24 | FromDiscord_ | <Technicae Circuit> @KrispPurg |
12:25:08 | FromDiscord_ | <Rika> Per file sounds insane imo |
12:25:23 | FromDiscord_ | <Rika> Maybe commands can be split into modules |
12:25:47 | FromDiscord_ | <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:25 | FromDiscord_ | <Technicae Circuit> Haha |
12:29:30 | FromDiscord_ | <Technicae Circuit> Sure |
12:29:45 | FromDiscord_ | <Technicae Circuit> Or a class based command system |
12:29:46 | rockcavera | This pull (https://github.com/nim-lang/Nim/pull/14004) broke old code. Example: https://play.nim-lang.org/#ix=2jkQ |
12:29:48 | disbot | β₯ fixes #14001 |
12:30:40 | FromDiscord_ | <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:16 | rockcavera | Now it remains to be seen whether it was deliberate, since previous behavior was inappropriate. |
12:31:49 | FromDiscord_ | <Rika> then you can also just `include` files |
12:33:48 | * | Hideki_ quit (Ping timeout: 256 seconds) |
12:39:10 | solitudesf | pretty sure it was delibarete |
12:39:37 | solitudesf | 4raq is aware of that breakage, at least |
12:50:46 | FromGitter | <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:56 | FromDiscord_ | <Technicae Circuit> Are giu able to Include C files? |
12:51:22 | FromDiscord_ | <Technicae Circuit> Are you able to include header files? |
12:51:34 | * | Hideki_ joined #nim |
12:52:11 | PMunch | Yes |
12:54:41 | rockcavera | solitudesf, thanks. I believe too. |
12:55:24 | * | Vladar quit (Quit: Leaving) |
12:58:33 | rockcavera | I 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:51 | dom96 | You can use FutureVar |
12:59:56 | Araq | rockcavera: it wasn't the PR, it was a different PR |
13:00:14 | Araq | and the code isn't supported |
13:00:44 | dom96 | (if you're adventurous you can modify the async macro to transform `var string` into `FutureVar[string]` and make a PR :)) |
13:01:22 | rockcavera | thanks |
13:01:23 | Araq | nah, people should use FutureVar[string] explicitly and learn about the stack vs heap |
13:01:24 | rockcavera | :) |
13:02:35 | dom96 | Araq, why? :) |
13:02:40 | PMunch | Is 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:52 | dom96 | ideally {.async.} should support the language's features transparently |
13:02:53 | PMunch | Or would I need to do array[50, char]? |
13:03:17 | Araq | PMunch: use array[50, char] |
13:04:33 | PMunch | But then it's a pain to assign string data or echo the contents.. |
13:05:10 | dom96 | write procs that make those operations easier then |
13:05:48 | PMunch | Oh, I'm not needing this for anything in particular |
13:05:58 | PMunch | I'm just writing up an article on Nim/C interop |
13:06:04 | * | Hideki_ quit (Remote host closed the connection) |
13:06:04 | PMunch | And wondered if there was a better way of doing it |
13:07:16 | Araq | in your tutorial also show template toCstring(x): cstring = unsafeAddr(x[0]) |
13:08:07 | PMunch | Is that template defined anywhere? Or just show off that it's possible to do it? |
13:08:38 | FromDiscord_ | <Technicae Circuit> So how would i use a C++ library in Nim? |
13:11:34 | PMunch | Like this: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
13:11:46 | Araq | dom96: "less magic" is en vogue |
13:11:53 | FromDiscord_ | <Technicae Circuit> Thanks! |
13:12:05 | Araq | PMunch: that template doesn't exist |
13:12:22 | PMunch | (except for the fact that the code example literally says "Horrible example of how to interface with a C++ engine" :P) |
13:12:27 | PMunch | Araq, okay thanks |
13:13:36 | Araq | anybody around with experience on this algorithm https://en.wikipedia.org/wiki/Path-based_strong_component_algorithm ? |
13:13:44 | Araq | clyybber? |
13:14:10 | PMunch | Is there a way to limit a template to only string literals? |
13:15:18 | dom96 | Araq, okay, at the very least, someone should suggest FutureVar when `var` is attempted in an async macro :) |
13:15:35 | dom96 | alehander42: maybe you'd be interested in this improvement also? |
13:16:23 | PMunch | Ah, can be done with {lit} like in term rewriting macros |
13:18:14 | shashlick | Do templates work for simple substitutions - #define MyCoolUint32 uint32 |
13:18:42 | disruptek | sure. |
13:20:28 | FromGitter | <alehander92> dom96 i agree this should be at least hinted |
13:20:35 | FromGitter | <alehander92> i think i didnt know i can use FutureVar as well ... |
13:22:35 | PMunch | So something like this helps deal with the situation: https://play.nim-lang.org/#ix=2jlg |
13:22:45 | PMunch | To 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:39 | dom96 | btw 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:55 | dom96 | Araq, would you accept patches to implement them using JS-native APIs |
13:31:56 | dom96 | ? |
13:32:37 | Araq | if the patch is clear enough |
13:33:09 | Araq | for example, one solution is to make intsets.nim contain |
13:33:20 | Araq | when defined(js): include intsets_js |
13:33:23 | dom96 | yep |
13:33:27 | Araq | else: include insets_native |
13:33:28 | FromDiscord_ | <Rika> wait would that mean that ES3 compatibility is no longer guaranteed? |
13:33:55 | FromDiscord_ | <Rika> wait, was nim the one that guaranteed ES3 compatibility? i forgot |
13:34:17 | dom96 | Set has pretty good browser support from what I checked |
13:34:21 | Araq | Rika: in the worst case it means 'when defined(js) and not defined(nimArchaneJs): ...' |
13:34:46 | dom96 | https://gist.github.com/dom96/d5cdd3c2406992aae4173b9e47ae5249 |
13:34:53 | dom96 | my hack from last night |
13:35:06 | dom96 | awesome 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:13 | disruptek | right? |
13:36:22 | disruptek | Araq: i'm blocked by stupid shit. |
13:36:33 | Araq | shoot |
13:36:41 | disruptek | see stream late yesterday or i will demo in a few; lemme get some coffee. |
13:37:05 | disruptek | Rope != ref object Rope |
13:37:12 | disruptek | dafuq |
13:37:19 | FromDiscord_ | <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:36 | FromGitter | <alehander92> hm, i should start using sets |
13:37:44 | dom96 | Araq, I wonder how much effort it'd be to reimplement the nim stdlib to use native JS strings |
13:37:44 | FromGitter | <alehander92> i constantly use JsAssoc[stuff, bool] |
13:37:47 | FromGitter | <alehander92> to immitate that |
13:37:59 | FromGitter | <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:09 | FromGitter | <alehander92> but the problem is the mutability thing |
13:38:22 | * | tane joined #nim |
13:38:27 | Araq | disruptek: simple, there are two different ropes modules |
13:38:27 | dom96 | hm. I see. |
13:38:50 | dom96 | tbh I'm not sure strings are the bottleneck for my game |
13:38:54 | Araq | the compiler doesn't use the stdlib's ropes module, watch out |
13:39:12 | Araq | dom96: IME karax with its 'kstring' does it best |
13:39:20 | FromGitter | <alehander92> we can have something like kstring |
13:39:44 | * | xcm joined #nim |
13:39:47 | Araq | sometimes a library solutions patching over language problems work best |
13:39:53 | dom96 | spent a while optimising things last night and while I improved certain timings, Edge was still stuck at 9fps :( |
13:40:44 | dom96 | might 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:20 | Araq | holy shit... my cycle collector works for 'hamming.nim' |
13:53:24 | FromDiscord_ | <Recruit_main707> thats probably really good! congrats! :p |
13:58:05 | Araq | it's suprising as the collector is incomplete :-) |
13:58:10 | FromDiscord_ | <clyybber> Araq: Regarding the algorithm, nope. |
13:58:18 | FromDiscord_ | <clyybber> Araq: Also \o/ |
13:58:21 | FromDiscord_ | <clyybber> π |
13:58:37 | Araq | well now I have the proof that my architecture is correct |
13:58:50 | Araq | and the other algorithm is broken |
13:58:57 | Araq | because my new one works |
13:59:09 | Araq | no errors according to valgrind |
13:59:24 | disruptek | Araq: you're blowing my mind right now. also, thanks. |
14:03:01 | FromDiscord_ | <Technicae Circuit> > Is therr a way to get the C++ code and not just the compiled binary? |
14:03:04 | FromDiscord_ | <Technicae Circuit> :p |
14:03:25 | disruptek | look in your nimcache. |
14:03:30 | disruptek | ~nimcache |
14:03:31 | disbot | nimcache: 11the best way to figure out where it is located is to specify that location with --nimcache -- disruptek |
14:03:50 | FromDiscord_ | <Technicae Circuit> Thanks |
14:03:53 | FromDiscord_ | <Recruit_main707> you can do `--nimcache:./cache` or something like that |
14:04:23 | FromDiscord_ | <Technicae Circuit> So just specify a path for the cache to go? |
14:04:43 | FromDiscord_ | <Recruit_main707> yep |
14:04:56 | FromDiscord_ | <Recruit_main707> there is a default one somewhere |
14:05:02 | FromDiscord_ | <Technicae Circuit> Oki |
14:07:42 | FromGitter | <alehander92> it should be in `~/.cache/nim/<somenameofyourproject>` |
14:07:44 | FromGitter | <alehander92> by default IIRC |
14:08:02 | FromGitter | <alehander92> you can also `--nimcache: ` to `/dev/shm/` or `/tmp/` location |
14:08:21 | PMunch | _d for debug and _r for release |
14:08:38 | FromDiscord_ | <Technicae Circuit> Thanks, but when i do `nim --nimcache:path` it says i need a command |
14:09:02 | FromGitter | <zetashift> still need to add c/cpp and a nim file probably |
14:09:29 | FromGitter | <zetashift> like `nim c --nimcache:path main.nim` |
14:09:59 | FromDiscord_ | <Technicae Circuit> Oh okay, thanks |
14:10:04 | FromGitter | <alehander92> of course this is for linux, i am not so experienced in nim with other platforms |
14:10:15 | PMunch | Should wrapped types have importc on them? Why/why not? |
14:10:21 | FromDiscord_ | <Technicae Circuit> I am a linux user too :) |
14:10:25 | FromGitter | <alehander92> ok |
14:10:45 | FromDiscord_ | <Technicae Circuit> Is there an option in my nim.cfg to set a default path for cache,m |
14:10:50 | FromDiscord_ | <Technicae Circuit> Is there an option in my nim.cfg to set a default path for cache? |
14:11:11 | disruptek | hold it closer to the screen. |
14:11:16 | disruptek | can't quite read it from here. |
14:11:21 | zacharycarter | Hackathon went well btw - I have no idea if we won, but our project elicited the most ooos and ahhhs |
14:11:33 | FromDiscord_ | <Technicae Circuit> Cool |
14:11:46 | * | Hideki_ joined #nim |
14:11:52 | PMunch | Oh nice zacharycarter! |
14:11:55 | disruptek | which hackathon? |
14:11:55 | zacharycarter | and I wrote the AWS lambda in Nim |
14:11:57 | PMunch | What did you make? |
14:12:11 | FromGitter | <alehander92> Technicae yeah you can just write your flags there |
14:12:14 | FromGitter | <alehander92> e.g. `--nimcache:..` |
14:12:19 | zacharycarter | we made a chat bot / did NLP stuff |
14:12:35 | FromGitter | <alehander92> https://github.com/nim-lang/Nim/issues/7402#issuecomment-376153970 |
14:12:36 | FromDiscord_ | <Technicae Circuit> Thanks |
14:12:37 | disbot | β₯ [TODO] could nimcache be generated out-of-source (in /tmp) like rdmd does in D? |
14:13:00 | zacharycarter | so 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:08 | FromDiscord_ | <Technicae Circuit> There should also be a `transpile` option |
14:13:13 | FromGitter | <alehander92> ? why |
14:13:23 | FromDiscord_ | <Technicae Circuit> So it outputs the converted code |
14:13:37 | FromGitter | <alehander92> but it does output it |
14:13:39 | zacharycarter | Nim doesn't do transpilation though |
14:14:00 | FromGitter | <alehander92> and outputting it on the screen would be confusing as you generate a lot of boilerplate |
14:14:01 | FromDiscord_ | <Technicae Circuit> Does it not? How else does it generate C, C++ and JS? |
14:14:07 | zacharycarter | compilation |
14:14:09 | FromGitter | <alehander92> and different files |
14:14:17 | FromDiscord_ | <Technicae Circuit> Welp |
14:14:29 | disruptek | syntax. |
14:14:30 | FromGitter | <alehander92> Technicae this is like a flamewar topic "is transpilation useful term or not" |
14:14:46 | FromDiscord_ | <Technicae Circuit> Oh okay :p |
14:15:09 | * | Hideki_ quit (Remote host closed the connection) |
14:15:24 | disruptek | transpilation usually suggests no change to semantics. |
14:15:27 | FromGitter | <alehander92> you can use the `debug` options to get line directives inside your c/javascript files |
14:15:32 | FromGitter | <alehander92> or `--lineDir:on` |
14:15:42 | * | Romanson quit (Quit: Connection closed for inactivity) |
14:16:01 | * | Hideki_ joined #nim |
14:16:29 | FromDiscord_ | <Technicae Circuit> Hm |
14:16:33 | FromGitter | <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:23 | FromDiscord_ | <Technicae Circuit> Are files compiled by Nim decompilable? |
14:17:59 | zacharycarter | Can you do that in any other language? |
14:18:01 | disruptek | no less so than any other c file. |
14:18:07 | Zevv | up to a certain level, sure |
14:18:25 | zacharycarter | I mean c2nim can generate nim code from parsing C |
14:18:26 | zacharycarter | and C++ |
14:18:33 | Araq | it's all decompilable unless you convert it to 'move'-only code |
14:19:03 | Zevv | even then. just given enough time and patience |
14:19:13 | FromDiscord_ | <Technicae Circuit> Hm |
14:19:16 | Araq | https://github.com/xoreaxeaxeax/movfuscator use this on your code |
14:19:20 | FromDiscord_ | <Technicae Circuit> That's a plus fot me then |
14:19:27 | FromDiscord_ | <Technicae Circuit> That's a plus for me then |
14:20:03 | Araq | Zevv: nobody has enough time to deal with mov-only code ;-) |
14:20:57 | FromGitter | <alehander92> Technicae code is always reverse engineerable |
14:21:01 | * | Hideki_ quit (Ping timeout: 265 seconds) |
14:21:27 | FromDiscord_ | <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:01 | FromGitter | <alehander92> what do you call decompile |
14:23:05 | FromDiscord_ | <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:27 | FromDiscord_ | <Technicae Circuit> Messy or unreadable* |
14:24:32 | PMunch | So you just want the C code from Nim code? |
14:24:40 | PMunch | That's compiling, not decompiling.. |
14:25:02 | FromDiscord_ | <Technicae Circuit> If I'm using the binary to get the C code? |
14:25:10 | PMunch | Decompiling would be to go the other way, from binary to C/Nim or from C to Nim. |
14:25:47 | PMunch | But 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:53 | FromGitter | <alehander92> yeah :P |
14:26:14 | FromDiscord_ | <Technicae Circuit> But doesn't the cache generate a bunch of files? |
14:26:20 | FromDiscord_ | <Technicae Circuit> I only want to get one file |
14:26:35 | FromGitter | <alehander92> but still it's much much much easier to just postprocess them somehow |
14:26:40 | FromGitter | <alehander92> than to decompile a binary |
14:26:48 | FromGitter | <alehander92> and why do you need just a single file? |
14:26:51 | PMunch | find ./nimcache -name *.nim.c -exec cat {}; |
14:27:01 | FromGitter | <alehander92> this shouldn't matter in general |
14:27:26 | FromDiscord_ | <Technicae Circuit> I want a single file so i can just give the setup.py one file to compile in C |
14:27:40 | PMunch | I guess just `cat nimcache/*.nim.c` would work as well |
14:28:02 | FromGitter | <alehander92> but why would you give that to setup.py at all |
14:28:13 | FromGitter | <alehander92> if nim can already compile the c files |
14:28:17 | PMunch | You have the --genscript switch which creates a script to compile your C sources |
14:28:22 | PMunch | Provided that it still works |
14:28:32 | FromGitter | <alehander92> can you explain a bit more what exactly does your python program do |
14:29:25 | * | kenran quit (Quit: leaving) |
14:29:52 | FromGitter | <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:54 | FromGitter | <alehander92> IIRC |
14:29:59 | * | PMunch quit (Quit: leaving) |
14:31:56 | FromDiscord_ | <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:43 | FromGitter | <bung87> `+ (id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask β β ``` handler:(NSEvent * _Nullable (^)(NSEvent *))block;```` [https://gitter.im/nim-lang/Nim?at=5ea2f88b2bf9ef12699fdcc8] |
14:32:45 | FromGitter | <alehander92> well you can just have subdirectories |
14:32:55 | FromGitter | <bung87> how to write this in c using objc runtime? |
14:33:21 | FromGitter | <bung87> `objc_msgSend(objc_getClass('NSEvent'), sel_registerName('addLocalMonitorForEventsMatchingMask:handler:'),1 << 14,(IMP)KeyboardEventHandler,"v@:@");` |
14:33:28 | FromGitter | <bung87> this not work |
14:34:13 | FromGitter | <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:41 | FromDiscord_ | <Technicae Circuit> How would i do that then? :P |
14:35:17 | FromGitter | <alehander92> well, does a subdirectory not work? |
14:37:04 | FromGitter | <alehander92> if not, https://github.com/cil-project/cil is one option |
14:39:18 | FromGitter | <alehander92> http://cil-project.github.io/cil/doc/html/cil/ |
14:39:30 | FromGitter | <alehander92> => Using the merger |
14:46:58 | FromDiscord_ | <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:24 | FromDiscord_ | <Technicae Circuit> > <FromGitter> <alehander92> well, does a subdirectory not work? |
14:47:24 | FromDiscord_ | <Technicae Circuit> Yeah it does, so i guess a subdir should be fine :p |
14:48:57 | FromGitter | <alehander92> good! |
14:50:47 | disruptek | ~stream |
14:50:48 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:50:50 | disruptek | gamer tool today. |
14:51:54 | FromGitter | <alehander92> technicae the iteration should work if not ask |
14:51:58 | FromGitter | <alehander92> disruptek oo |
14:54:34 | FromDiscord_ | <Technicae Circuit> I can only iterate through one type which is sad |
14:54:54 | FromDiscord_ | <Technicae Circuit> But i need to iterate through a list with multiple data types |
14:55:07 | FromDiscord_ | <Technicae Circuit> ~help |
14:55:15 | FromDiscord_ | <Technicae Circuit> !help |
14:55:29 | FromDiscord_ | <Technicae Circuit> Oof |
14:55:36 | * | FromDiscord_ <Recruit_main707> **there is no help** |
14:55:57 | FromGitter | <alehander92> :) |
14:56:09 | FromGitter | <alehander92> can't you collect them |
14:56:19 | FromDiscord_ | <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:15 | FromDiscord_ | <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:26 | FromGitter | <alehander92> ahhh ! |
15:02:39 | FromGitter | <alehander92> sorry, i didnt realize what you need |
15:02:44 | FromGitter | <alehander92> can't you pass it as a tuple somehow |
15:03:14 | FromGitter | <alehander92> or can't you work with them as some kind of general objects, not too familiar with nimpy tho |
15:03:47 | FromDiscord_ | <Technicae Circuit> It's basically using Nim |
15:04:13 | FromGitter | <alehander92> but can you directly introspect PyObjects |
15:04:19 | FromDiscord_ | <Technicae Circuit> And the limitation is that sequences (Python lists get turned into sequences) can only have one type |
15:04:21 | FromDiscord_ | <Technicae Circuit> Oh? |
15:04:23 | FromDiscord_ | <Technicae Circuit> How? |
15:04:32 | FromGitter | <alehander92> sorry its a ? :D |
15:17:05 | companion_cube | what's the tech behind FromGitter/FromDiscord? is it free? |
15:17:30 | * | liblq-dev quit (Ping timeout: 256 seconds) |
15:18:16 | dom96 | FromGitter is written in Crystal by oprypin |
15:18:37 | dom96 | FromDiscord is whatever the most popular relay written in Go is, can't remember the name |
15:18:42 | * | natrys joined #nim |
15:19:08 | companion_cube | oh really? :o |
15:19:13 | * | liblq-dev joined #nim |
15:19:39 | FromDiscord_ | <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:22 | FromDiscord_ | <Technicae Circuit> Oh, nice! |
15:26:43 | FromDiscord_ | <Technicae Circuit> I recommend making the library simpler though since the current version isn't the best |
15:28:05 | FromDiscord_ | <clyybber> ? |
15:30:19 | FromDiscord_ | <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:45 | Yardanico | FromDiscord in this channel is matterbridge |
15:31:49 | dom96 | Yardanico, how often do crashes happen |
15:31:50 | dom96 | ? |
15:32:03 | companion_cube | ahhh cool, thanks Yardanico |
15:32:07 | dom96 | if they're not too frequent it shouldn't be a problem, just restart the program |
15:32:26 | Yardanico | @dom96 well the worst thing is that there's no such reliable way to detect that |
15:32:36 | Yardanico | it just stops handling discord events |
15:32:39 | Yardanico | without any exceptions |
15:32:45 | dom96 | ahh, that's really bad |
15:33:11 | dom96 | does the library do something silly like catch exceptions and then ignore them or something? |
15:33:29 | dom96 | My guess is that discord is timing out the connection and it cannot reconnect |
15:33:39 | Yardanico | well discord has that well documented |
15:34:03 | Yardanico | and there are "try" statements but they echo stuff if they catch an exceptions |
15:35:10 | dom96 | might be worth just getting rid of those |
15:35:11 | FromDiscord_ | <codic> Does Nim have anything like a Python list? |
15:35:11 | FromDiscord_ | <codic> Dynamic, can hold elements of any type |
15:35:14 | dom96 | it's always better to crash early |
15:35:20 | FromDiscord_ | <codic> Does Nim have anything like a Python list? |
15:35:20 | FromDiscord_ | <codic> Dynamically sized, can hold elements of any type |
15:35:21 | dom96 | if the crash happens to often then fix the crash |
15:35:25 | dom96 | if it's rare you can always restart |
15:35:27 | Yardanico | @codic no, you'll have to use stuff like variant objects |
15:35:38 | Yardanico | @dom96 usually it happens in less than a day |
15:35:54 | Yardanico | I'll try using dimscord :P |
15:36:19 | dom96 | sometimes you gotta get your hands dirty |
15:36:41 | dom96 | libraries won't be fixed unless you help the process along |
15:36:59 | Yardanico | i know, I tried looking why discordnim crashes, but didn't get any meaningful info |
15:37:04 | FromDiscord_ | <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:10 | Yardanico | yeah, object variants |
15:37:19 | FromDiscord_ | <codic> haha |
15:37:21 | Yardanico | since discordnim is pretty much unmaintained it's bundled in ircord |
15:37:45 | FromDiscord_ | <codic> is it? |
15:37:46 | FromDiscord_ | <codic> |
15:37:46 | FromDiscord_ | <codic> https://cdn.discordapp.com/attachments/371759389889003532/703268456845410434/unknown.png |
15:37:50 | FromDiscord_ | <codic> last commit on jan 16 |
15:38:11 | FromDiscord_ | <codic> ;P |
15:38:23 | Yardanico | well if you look at it it doesn't really do any meaningful changes |
15:38:25 | Yardanico | just some styling |
15:38:30 | FromDiscord_ | <codic> oh |
15:38:39 | FromDiscord_ | <codic> Let's see |
15:38:45 | FromDiscord_ | <codic> Commit a day before it |
15:38:50 | FromDiscord_ | <codic> https://github.com/Krognol/discordnim/commit/e3b7223ff726d12295dfdacdf78f2ab6abae8774 |
15:39:13 | FromDiscord_ | <codic> although that seems to be mainly removing whitespace? |
15:39:25 | FromDiscord_ | <codic> Why was that whitespace there in the first place? |
15:40:07 | FromDiscord_ | <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:01 | Yardanico | well whitespace can be there if you do <Space><enter> |
15:41:23 | Yardanico | in my projects I sometimes have a space after "=" in proc definition or after ":" (in if/when/etc) |
15:41:34 | FromDiscord_ | <codic> true, but why would that affect the compiler? |
15:41:39 | Yardanico | it won't? |
15:41:40 | dom96 | codic: I wouldn't call it 15 years old, 12 at most |
15:41:59 | Yardanico | well, except the whitespace before the code |
15:42:03 | FromDiscord_ | <codic> Then there's no need to remove it, that whole commit is about that except for an import change |
15:42:06 | Yardanico | because nim is whitespace significant :) |
15:42:17 | FromDiscord_ | <codic> wasn't nim created in 2005? |
15:42:20 | Yardanico | @codic that comment also replaces some procs with templates, although I'm not really sure that it's neccessary either |
15:42:25 | Yardanico | @codic first public release in 2008 |
15:42:31 | FromDiscord_ | <codic> Yeah, but I think that's for whitespace at the end, not at the beginning |
15:42:33 | FromDiscord_ | <codic> Ahh, okay |
15:43:06 | FromDiscord_ | <codic> Still |
15:43:11 | * | hax-scramper quit (Ping timeout: 265 seconds) |
15:43:11 | FromDiscord_ | <codic> A 12 year old language is pretty old |
15:43:17 | Yardanico | no big corporate backing |
15:43:29 | FromDiscord_ | <codic> True I guess |
15:43:36 | * | hax-scramper joined #nim |
15:43:50 | FromDiscord_ | <Rika> then also many people dont seem to like some of the features |
15:44:00 | FromDiscord_ | <codic> like which ones? |
15:44:09 | FromDiscord_ | <Rika> whitespace instead of braces, semi case-insensitivity |
15:44:53 | Yardanico | well you can write pRoC a = echo "hi" but no one does that :P |
15:45:05 | FromDiscord_ | <codic> That's cool |
15:45:09 | FromDiscord_ | <codic> I should now write |
15:45:20 | Yardanico | mostly case insensitivity is used for snake_case vs camelCase |
15:45:27 | Yardanico | so if someone has a lib in snake_case you can use it as camelCase |
15:45:56 | FromDiscord_ | <codic> ```nim |
15:45:56 | FromDiscord_ | <codic> pROc a(b: INT, c: INT) = |
15:45:57 | FromDiscord_ | <codic> return b + c |
15:45:57 | FromDiscord_ | <codic> ECHO "TEST" |
15:45:57 | FromDiscord_ | <codic> ``` |
15:46:02 | Yardanico | pls don't paste stuff in discord |
15:46:06 | dom96 | two main criticisms are always: style insensitivity and how module imports work by default |
15:46:08 | Yardanico | currently in IRC it looks bad :( |
15:46:11 | FromDiscord_ | <codic> Am I allowed to go that far? |
15:46:14 | FromDiscord_ | <codic> I didn't paste anything |
15:46:20 | Yardanico | @dom96 the latter is probably because these people are coming from python |
15:46:29 | dom96 | three lines is fine, just don't paste 50 |
15:46:45 | FromDiscord_ | <codic> Erm.... |
15:46:51 | FromDiscord_ | <codic> Okay |
15:46:56 | FromDiscord_ | <codic> Ohhh I see what you mean hahha |
15:46:59 | FromDiscord_ | <codic> Ohhh I see what you mean haha |
15:47:13 | Yardanico | don't edit either :P really need to get that ircord done |
15:47:32 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
15:48:29 | FromDiscord_ | <Rika> tfw discord too modern for irc |
15:48:31 | FromDiscord_ | <Rika> smh smh |
15:48:45 | dom96 | IRC is too cool for Discord :P |
15:48:52 | Faulander | hey 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:00 | Yardanico | yeah, discord doesn't even support colored messages smh |
15:49:35 | FromDiscord_ | <Rika> does it have to be epub? does your e-reader not work with pdf? |
15:49:43 | FromDiscord_ | <sealegs> @Yardanico I'll answer your question later because im gonna have a shower |
15:49:46 | FromDiscord_ | <Rika> it'd be a pretty shitty e-reader to not work with pdf |
15:50:27 | Faulander | it works with pdf, but epubs are WAY better. i won't go into details here, but pdf doesn't scale well. |
15:50:42 | Yardanico | find some html -> epub tool I guess? |
15:51:03 | Faulander | haha, i can do it no problem. i just wanted to know if someone already did :) |
15:51:30 | Faulander | (and maybe make a lib out of it, practising my nim knowledge) |
15:51:52 | dom96 | search around, this was done before IIRC |
15:51:58 | Faulander | kk |
15:52:20 | * | xcm quit (Remote host closed the connection) |
15:52:34 | Faulander | bzw. just wrote my 1000 line of nim code (yay!) and only one program left to convert from python to nim. |
15:53:12 | Faulander | and i bought your book dom, its pretty good. |
15:54:19 | * | xcm joined #nim |
15:54:38 | dom96 | yay, thanks for getting a copy :) |
15:55:56 | FromDiscord_ | <codic> > <dom96> IRC is too cool for Discord :P |
15:55:58 | FromDiscord_ | <codic> nope, matrix best |
15:56:14 | Yardanico | too much centralization, people talked about this in nim-offtopic I think |
15:56:26 | Yardanico | the most popular matrix server is matrix.org and it's really overloaded |
15:56:28 | Yardanico | so it's not that fast |
15:56:30 | dom96 | lol Matrix sucks |
15:56:39 | FromDiscord_ | <codic> matrix.org sucks |
15:56:44 | FromDiscord_ | <codic> but there are other nice servers |
15:56:45 | dom96 | All I see is netsplits from it |
15:56:48 | FromDiscord_ | <codic> like privacytools.io |
15:56:57 | Yardanico | @dom96 that's thanks for the JS-powered matrix bridge bot |
15:57:00 | dom96 | Although to be fair, I never actually used it |
15:57:03 | FromDiscord_ | <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:05 | FromDiscord_ | <codic> ll |
15:57:06 | FromDiscord_ | <codic> Lol |
15:57:20 | Yardanico | @codic that's not really possible |
15:57:25 | FromDiscord_ | <codic> Aww |
15:57:31 | dom96 | codic: seq[RootObject] but then you need to use inheritance which sucks |
15:57:45 | FromDiscord_ | <codic> What do you mean, I have to use inheritance? |
15:57:46 | dom96 | what are you trying to do? |
15:57:59 | dom96 | FooBar = object of RootObject |
15:58:03 | FromDiscord_ | <codic> create a dynamic array which can hold any sort of type (ik, I'm stupid) |
15:58:13 | dom96 | and then you can store FooBar in that seq or any other type that inherits from RootObject |
15:58:26 | FromDiscord_ | <codic> in this case, i'm trying to use a sequence |
15:58:30 | FromGitter | <alehander92> codic i dont really think you can do that |
15:58:33 | FromDiscord_ | <codic> ah |
15:58:33 | dom96 | right, but why do you need this? |
15:58:36 | FromGitter | <alehander92> because e.g. ints are not boxed |
15:58:39 | FromDiscord_ | <codic> for being stupid |
15:58:42 | dom96 | what is your concrete use case? |
15:59:09 | FromDiscord_ | <codic> Let's assume that I have an array of user input from a website or something |
15:59:29 | FromGitter | <alehander92> is it like json |
15:59:30 | FromDiscord_ | <codic> Some of the input may be ints, others may be strings, so on |
15:59:31 | Yardanico | it's just that different languages have different ways of dealing with problems |
15:59:37 | Yardanico | @codic use object variants |
15:59:40 | FromGitter | <alehander92> you can use case objects `codic` |
15:59:42 | FromGitter | <alehander92> yeah , the same |
15:59:43 | FromDiscord_ | <codic> true, i agree |
15:59:54 | Yardanico | or json module (it can be used for boxing different kinds of variables) |
15:59:54 | FromDiscord_ | <codic> I have no idea how to use object variants, the docs don't explain much |
16:00:01 | FromGitter | <alehander92> which languages have you used before |
16:00:05 | FromDiscord_ | <codic> oh, json does seem like a good idea |
16:00:09 | Yardanico | and unless you convert it to string the inner representation won't be json at all |
16:00:13 | FromDiscord_ | <codic> python, ruby, go, and kotlin |
16:00:16 | Yardanico | json in nim is implemented using object variants too |
16:00:28 | Yardanico | https://nim-lang.org/docs/json.html#JsonNodeObj |
16:00:38 | FromDiscord_ | <codic> that's actually a good idea |
16:01:19 | FromGitter | <alehander92> ok they are something like sealed classes in kotlin from what i read |
16:01:22 | dom96 | yeah, json is a good example |
16:01:40 | dom96 | you can copy the object variant used there as an example |
16:01:46 | dom96 | or just use JsonNode directly |
16:01:50 | FromGitter | <alehander92> i really want to add something like patty's variant constructor |
16:01:53 | FromGitter | <alehander92> to stdlib or fusion |
16:02:01 | FromGitter | <alehander92> now with type pragmas |
16:04:16 | FromGitter | <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:11 | Faulander | codic is missing pythons list i think. i used that extensively aswell, slow but comfortable. |
16:06:34 | FromGitter | <alehander92> yeah, but no |
16:06:51 | FromGitter | <alehander92> `seq` is list, he is missing isinstance and duck typing imho |
16:06:59 | FromGitter | <alehander92> but one usually doesnt really need that |
16:07:10 | Faulander | seq is one type only, lists are not |
16:07:19 | FromGitter | <alehander92> but this isnt about seq ;) |
16:07:27 | FromGitter | <alehander92> its about all nim collections |
16:07:27 | Yardanico | Faulander: seq *is* a list |
16:07:29 | FromGitter | <alehander92> they all are typed |
16:07:38 | FromGitter | <alehander92> but you usually use just several kinds of values, so you can just wrap them in case objects |
16:07:58 | FromGitter | <alehander92> its about `any` vs sum type/case objects vs traditional typed value |
16:08:02 | FromGitter | <alehander92> not about seq vs list |
16:08:34 | FromGitter | <alehander92> you can also use two types only in Table and many in dict, one in set and many in python set |
16:08:38 | Faulander | i am way too pragmatic, i just converted everything to json if i needed it :) |
16:08:45 | Yardanico | it's fine |
16:08:49 | FromGitter | <alehander92> that works sometimes too :P |
16:08:58 | Yardanico | unless you convert a JsonNode to string it won't be stored as JSON inside of memory |
16:09:09 | Yardanico | it'll be just stored as object variants |
16:09:47 | FromDiscord_ | <Technicae Circuit> So uh, anyone figured out how to have any type in a sequence? :P |
16:09:56 | Yardanico | as we said, use object variants instead |
16:10:01 | Yardanico | or inheritance |
16:10:34 | FromDiscord_ | <Technicae Circuit> Which way would be better suited for being passed a Python list? |
16:10:50 | FromGitter | <alehander92> probably variants imho |
16:11:12 | FromGitter | <alehander92> but you really have to look inside nimpy a bit |
16:11:31 | FromGitter | <alehander92> i am sure internally it should be able to work with a more general type somehow |
16:12:38 | FromDiscord_ | <Technicae Circuit> Okay then |
16:12:42 | FromDiscord_ | <Technicae Circuit> Thanks |
16:13:16 | madpata | Good 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:36 | FromGitter | <alehander92> ok man i looked |
16:14:44 | FromGitter | <alehander92> `toJson` can help you maybe Technicae |
16:14:53 | FromGitter | <alehander92> https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L1176 |
16:15:01 | solitudesf | object fields have priority, but idk if its specified in manual |
16:15:07 | FromGitter | <alehander92> it does https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L725 |
16:15:38 | * | Vladar quit (Quit: Leaving) |
16:19:13 | madpata | It 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:04 | FromDiscord_ | <codic> yup I'm missing python's list |
16:21:11 | FromDiscord_ | <codic> i found a solution: to not be stupid |
16:21:21 | FromDiscord_ | <codic> (aka convert everything to a string before making a seq) |
16:21:45 | shashlick | use json |
16:22:06 | Faulander | i knew it, i came over from python also a week ago, been there, done that ;) |
16:22:32 | Faulander | covert to str and use seq if type doesn't matter, or use json (as i did) |
16:23:10 | codic | Lol |
16:23:21 | codic | Yeah, I can always convert the types back, that seems like the easiest solution |
16:23:25 | shashlick | won't last for long |
16:23:34 | codic | why? |
16:23:44 | shashlick | better to be disciplined about types, I transitioned and code is a lot cleaner |
16:23:48 | FromDiscord_ | <Rika> small brain: use object variants |
16:23:48 | FromDiscord_ | <Rika> big brain: serialize to string, deserialize when needed |
16:24:03 | codic | π€ |
16:24:04 | shashlick | i don't miss random failures due to python types |
16:24:05 | FromDiscord_ | <Rika> (i am joking) |
16:24:15 | codic | oh |
16:24:17 | FromDiscord_ | <Rika> please do not do what i jsut said |
16:24:21 | codic | Yeah, but I don't get how I would use object variants |
16:24:23 | codic | lol |
16:24:44 | codic | ~~i'm doing it~~ |
16:24:50 | FromDiscord_ | <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:06 | Faulander | yeah, 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:50 | codic | No, I literally don't understand how to use em haha |
16:26:30 | Faulander | yeah, i still have the problem all the time: i do understand it conceptually, but cannot implement it :) |
16:27:21 | Faulander | nim-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:23 | Yardanico | codic: 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:48 | Yardanico | with case statements usually (if also works but case statements are better since they check for exhaustion) |
16:29:09 | madpata | @codic @Faulander The Nim manual has a section on object variants (https://nim-lang.org/docs/manual.html) |
16:29:21 | Yardanico | https://nim-lang.org/docs/manual.html#types-object-variants |
16:31:24 | * | silvernode joined #nim |
16:35:09 | FromDiscord_ | <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:33 | Yardanico | well I'm asking for ircord |
16:35:40 | Yardanico | which 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:07 | codic | i saw the manual, it doesn't explain it |
16:40:07 | codic | Could anyone show an example? |
16:40:10 | * | rockcavera quit (Read error: Connection reset by peer) |
16:40:23 | codic | (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:55 | Yardanico | codic: example of what? |
16:40:59 | Faulander | ok, i came so far as to create this: https://play.nim-lang.org/#ix=2jmX |
16:41:00 | Yardanico | JSON itself uses object variants for example |
16:41:47 | codic | Of object variants |
16:41:47 | codic | Ah, thanks Faulander! |
16:41:49 | Faulander | how do i group different nodes together? |
16:41:56 | Yardanico | Faulander: just create a normal seq |
16:41:58 | Yardanico | seq[Node] |
16:42:21 | Yardanico | nim compiler itself uses object variants for AST |
16:42:41 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L723 |
16:42:50 | codic | alright. 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:56 | Yardanico | codic: not really |
16:43:13 | Yardanico | it's an object with a special field for determining the object kind |
16:43:15 | * | hax-scramper joined #nim |
16:43:22 | Yardanico | and depending on that kind the object might have different fields "activated" |
16:43:40 | Yardanico | you can google "tagged union" |
16:44:05 | Yardanico | https://en.wikipedia.org/wiki/Tagged_union there's a nim example here too |
16:44:20 | codic | ah. could it not also be used for key val? |
16:44:30 | Yardanico | codic: not for arbitrary key/val |
16:44:45 | Yardanico | it's declared in your source code |
16:44:57 | Yardanico | for arbitrary key/val just use "json" module or something like that I guess |
16:45:00 | codic | that's true |
16:45:12 | codic | Why not tables? |
16:45:13 | Yardanico | or just do TableRef[string, MyObj] where string is the key and MyObj is your object variant |
16:45:51 | codic | Why not a regular table, without any object variants? |
16:46:18 | codic | π |
16:46:31 | Yardanico | if you need string->string mapping, ok |
16:46:36 | Yardanico | if you need actual types - object variants |
16:46:50 | codic | ah k, thanks |
16:47:05 | Yardanico | there's also "strtabs" module for string tables specifically |
16:47:09 | codic | I really think that I should understand other concepts of Nim before going into object variants... π
|
16:47:14 | codic | ah |
16:47:16 | Faulander | codic: this should get you going: https://play.nim-lang.org/#ix=2jmX |
16:47:44 | codic | Yeah, I saw that |
16:47:58 | Yardanico | https://github.com/nim-lang/irc/blob/master/src/irc.nim#L85 for another example |
16:47:58 | Faulander | oops, my code vanished |
16:48:04 | Faulander | i wrote a complete example :) |
16:48:16 | codic | oh haha |
16:49:03 | * | codic sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/CYlaZCYIEJfNwPaNHPRtXAFn > |
16:49:12 | codic | Oof, "long message" |
16:49:17 | Yardanico | it's fine |
16:49:22 | codic | But why double ticks? |
16:49:26 | Yardanico | for documentation |
16:49:27 | codic | For comments |
16:49:36 | Faulander | now: https://play.nim-lang.org/#ix=2jmZ |
16:49:37 | Yardanico | nim has automatic documentation generator |
16:49:38 | Yardanico | and it's RST |
16:49:49 | codic | For example: "the ``kind`` field is the discriminator" |
16:49:58 | FromDiscord_ | <codic> π that's great |
16:50:02 | Yardanico | see https://nim-lang.org/docs/tables.html#%5B%5D%2CTable%5BA%2CB%5D%2CA_2 |
16:50:06 | Yardanico | t[key] here is in a different font |
16:50:15 | Yardanico | and 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:34 | codic | Ohhhhh |
16:50:44 | codic | Why not follow single backticks, like the markdown convention? |
16:50:56 | Yardanico | RST is not markdown |
16:51:05 | codic | oh rst |
16:51:07 | codic | Ignore me |
16:51:13 | codic | i'm stupid, sorry π
|
16:51:36 | Yardanico | also see https://forum.nim-lang.org/t/4280 |
16:51:46 | Yardanico | the main problem is that literally all nim documentation already uses RST |
16:51:49 | Faulander | its so funny, you are where i was a week ago. |
16:51:57 | Faulander | i asked almost the same questions |
16:53:53 | companion_cube | I think pandoc can convert from rst to markdown |
16:53:57 | companion_cube | but it might be lossy :( |
16:54:44 | Faulander | i use mddoc |
16:55:39 | Faulander | https://github.com/faulander/nimQBittorrent (this is done with mddoc) |
16:55:41 | * | natrys quit (Ping timeout: 265 seconds) |
16:55:58 | Yardanico | "METHODS" ? |
16:56:01 | Yardanico | they're procs :P |
16:56:43 | Faulander | remember: one week! ;) |
16:57:05 | Faulander | and methods is understood no matter what language you're used to! :) |
16:58:01 | codic | but functions |
16:58:04 | codic | func = proc |
16:58:07 | codic | lol |
16:58:07 | Yardanico | codic: |
16:58:08 | Yardanico | no |
16:58:13 | Yardanico | func in nim is different from proc |
16:58:19 | codic | Oh? |
16:58:22 | Yardanico | and it's actually the better meaning than in most other languages |
16:58:24 | codic | Someone said it was an alias for proc |
16:58:29 | Yardanico | it's not |
16:58:33 | Yardanico | https://nim-lang.org/docs/manual.html#procedures-func |
16:58:39 | Yardanico | it's an alias for proc with {.noSideEffects.} pragma |
16:59:00 | Yardanico | *noSideEffect |
16:59:07 | Yardanico | and about this pragma - https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma |
16:59:09 | codic | ah, what does that pragma do? |
16:59:24 | Faulander | thats 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:27 | FromDiscord_ | <Technicae Circuit> Is proc better then func? |
16:59:34 | Yardanico | it's not "better" |
16:59:37 | Yardanico | they're just different |
16:59:49 | Yardanico | "func" is just an alias for proc with noSideEffect pragma so you can have less verbosity in your code :P |
16:59:55 | codic | so if you had `func a() = echo 'test'` |
16:59:56 | codic | That'd be the same as |
17:00:00 | Yardanico | that won't work |
17:00:03 | Yardanico | echo has side effects |
17:00:12 | FromDiscord_ | <Technicae Circuit> Oh? |
17:00:18 | Yardanico | read https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma again :P |
17:00:25 | Yardanico | "echo" has an IO side effect |
17:00:37 | Yardanico | debugEcho is the one which can be used in "func" routines, but only for debugging really |
17:00:38 | codic | `proc a(): {.noSideEffects.} = echo 'test'` |
17:00:39 | FromDiscord_ | <Technicae Circuit> So proc would be a bit better for general use cases? |
17:00:47 | Yardanico | codic: yeah that would be around the same |
17:00:52 | codic | Ah, so func isn't really needed? |
17:00:58 | Yardanico | codic: it's just sugar |
17:01:09 | Yardanico | @Technicae Circuit if you don't modify global variables or stuff you can use func to explicitly state so |
17:01:13 | nisstyre | it adds some optimization opportunities right? |
17:01:24 | Yardanico | nim also has stuff like effects/tags tracking |
17:01:27 | nisstyre | like you can safely assume that f(1) == f(1) always |
17:01:27 | solitudesf | no, its just more static checks |
17:01:32 | codic | So there wouldn't be a need for it for an average usecase |
17:01:36 | Yardanico | https://nim-lang.org/docs/manual.html#effect-system |
17:02:10 | codic | ah |
17:02:11 | solitudesf | you cant really assume that, since you can override sideeffect tracking |
17:02:23 | nisstyre | then what's the point of having pure functions? |
17:02:27 | codic | well, for most use cases |
17:02:29 | Yardanico | nisstyre: if you want to :P |
17:02:49 | nisstyre | Yardanico: I know but what's the point of indicating to the compiler that they're pure? |
17:02:51 | Yardanico | I 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:54 | solitudesf | to ensure thay your code is side effect free |
17:02:58 | Yardanico | nisstyre: they're not "pure" in the mathematical sense either |
17:03:04 | nisstyre | ok, side effect free |
17:03:05 | solitudesf | to accidentally not introduce side effect? |
17:03:10 | Yardanico | yeah that |
17:03:11 | nisstyre | I guess that's fair |
17:03:51 | codic | import sugar, sequtils |
17:03:51 | codic | echo @[1,2,3].map((t)=>t*2) # ==> [2,4,6]?? |
17:04:02 | Yardanico | ? |
17:04:05 | FromGitter | <alehander92> it can still help you check you havent used globals or IO or stuff like that |
17:04:07 | codic | lol |
17:04:10 | FromDiscord_ | <codic> Would that work? |
17:04:16 | FromGitter | <alehander92> basically if you can use func, use func, if not proc |
17:04:20 | * | natrys joined #nim |
17:04:20 | Yardanico | !eval import sugar, sequtils; echo @[1,2,3].map((t)=>t*2) |
17:04:21 | FromGitter | <alehander92> similar with let and var |
17:04:22 | FromGitter | <alehander92> i think |
17:04:22 | NimBot | @[2, 4, 6] |
17:04:27 | Yardanico | there's also mapIt though |
17:04:34 | FromGitter | <alehander92> not that i do it .. but it seems as a good practice |
17:04:35 | FromDiscord_ | <codic> yeah, yay |
17:04:38 | Yardanico | !eval import sequtils; echo @[1, 2, 3].mapIt(it * 2) |
17:04:40 | NimBot | @[2, 4, 6] |
17:04:43 | codic | !eval echo "TEST HELLO WORLD" |
17:04:45 | NimBot | TEST HELLO WORLD |
17:04:52 | Yardanico | !lag |
17:04:52 | NimBot | 16ms between me and the server. |
17:04:53 | FromDiscord_ | <codic> Pretty cool |
17:04:56 | FromDiscord_ | <codic> Let's see if it works from discord |
17:05:00 | FromDiscord_ | <codic> !eval echo "TEST" |
17:05:00 | Yardanico | it does |
17:05:02 | NimBot | TEST |
17:05:06 | FromDiscord_ | <codic> oh, nice |
17:05:08 | Yardanico | it just uses play.nim-lang.org for code compilation btw |
17:05:12 | FromDiscord_ | <codic> but less latency with matrix |
17:05:17 | FromDiscord_ | <codic> ah, good way to sandbox |
17:05:25 | Yardanico | well nim doesn't have a real "eval" anyway |
17:05:30 | Yardanico | at runtime I mean |
17:05:38 | FromDiscord_ | <codic> yeah, it's a compiled language, makes sense |
17:05:41 | * | xcm quit (Remote host closed the connection) |
17:05:50 | Yardanico | although you can use compiler as a library xd |
17:05:59 | FromGitter | <alehander92> it kinda can have it if you import the nimscript |
17:06:00 | FromGitter | <alehander92> yeah |
17:06:07 | FromGitter | <alehander92> but its limited |
17:06:08 | FromDiscord_ | <codic> !eval write(stdout, "Does this support input? "); echo(readLine(stdin)) |
17:06:10 | NimBot | /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:19 | FromDiscord_ | <codic> Welp |
17:06:33 | FromDiscord_ | <codic> ") |
17:06:35 | FromDiscord_ | <codic> :( |
17:06:47 | Yardanico | how would it though? |
17:06:53 | Yardanico | there's also nim on https://godbolt.org/ |
17:06:59 | Yardanico | and on a few other "online repl" websites |
17:07:56 | * | xcm joined #nim |
17:08:51 | FromDiscord_ | <codic> yeah, like repl.it |
17:08:55 | FromDiscord_ | <codic> I dont know |
17:09:07 | Yardanico | on other note, nim really has A LOT of different features and modules in stdlib, and some of them are underused but cool |
17:09:13 | Yardanico | like https://github.com/Yardanico/nim-strenc uses term-rewriting macros |
17:09:29 | Yardanico | https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim |
17:09:46 | FromDiscord_ | <codic> I hqve never understood why macros qre needed, tbh |
17:09:57 | Yardanico | macros are needed to create DSLs and stuff |
17:10:02 | Yardanico | nim async itself is done via macros |
17:10:07 | Yardanico | async in nim* |
17:11:07 | FromDiscord_ | <codic> Ah,ok |
17:11:19 | Yardanico | you can really do a lot of stuff with macros, A LOT :P |
17:11:52 | Yardanico | as long as some code is valid nim syntax you can use handle it in macros |
17:12:43 | FromDiscord_ | <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:43 | FromGitter | <alehander92> if you want to make random syntax does stuff |
17:18:46 | FromGitter | <alehander92> you can use macros |
17:19:01 | FromGitter | <alehander92> makes syntax go brrr |
17:19:18 | FromGitter | <alehander92> probably not a good meme.. |
17:21:26 | FromDiscord_ | <Rika> its a good meme |
17:21:33 | FromDiscord_ | <Rika> i rate it an 8/10 |
17:22:00 | FromDiscord_ | <Rika> "NOO YOU CANT JUST CHANGE SYNTAX ALL WILLY NILLY LIKE THAT" |
17:22:01 | FromDiscord_ | <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:04 | FromDiscord_ | <Venator> how do I represent a C void* in Nim? |
17:27:20 | * | oculux joined #nim |
17:33:20 | Yardanico | "pointer" |
17:33:45 | Yardanico | @Rika well you can't really change "syntax" |
17:34:22 | Yardanico | "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:39 | Yardanico | because if some code isn't valid nim syntax you wouldn't be able to make AST for it |
17:38:00 | Yardanico | but 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:08 | disruptek | should default() behave static? |
17:50:16 | FromDiscord_ | <Rika> Yardanico: its just a meme, and in other languages, macros can change syntax |
17:50:25 | Yardanico | what languages? |
17:50:32 | Yardanico | lisp family languages don't really have syntax |
17:50:40 | FromDiscord_ | <Rika> i dont know, i heard lisp can |
17:50:41 | Yardanico | and in other languages you can't really change syntax |
17:50:42 | FromDiscord_ | <Rika> i mean |
17:50:46 | FromDiscord_ | <Rika> thats a technicality |
17:55:41 | * | lritter joined #nim |
18:05:14 | * | dddddd joined #nim |
18:05:54 | Faulander | i 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:54 | Yardanico | Faulander: 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:33 | FromDiscord_ | <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:51 | Faulander | it was more than 30 years ago, back then i was more interested in assembler than anything else. |
18:28:46 | FromDiscord_ | <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:54 | Faulander | assembler 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:32 | Faulander | at least back then, assembler was put to good use in my *cough* not so legal activities *cough* |
18:29:40 | Yardanico | hacks? |
18:29:53 | FromGitter | <bung87> I thought higher language is more easier to understand ,right? |
18:29:56 | Faulander | replace the h with a cr ;) |
18:30:05 | Yardanico | well the same mostly :P |
18:30:10 | Yardanico | @bung87 well it depends really |
18:30:38 | FromDiscord_ | <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:43 | FromGitter | <bung87> I starting programming from js |
18:30:48 | Faulander | it depends on the wiring of your mind ... for me assembler - at least the old 8bit ones - is much, much easier to understand. |
18:30:55 | Yardanico | well yeah |
18:31:05 | Yardanico | but x86 and x86_64 literally have hundreds of instructions |
18:31:05 | FromDiscord_ | <Rika> oh man i used to hack mobile games so i had to understand arm assembly |
18:31:21 | Faulander | thats why i clearly said "8bit" :D |
18:31:34 | FromGitter | <bung87> hmm I got your point. |
18:31:37 | FromDiscord_ | <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:10 | FromDiscord_ | <Rika> its not really a focus i dont think, i rarely see questions about it here |
18:32:16 | Yardanico | well the company which created godot-nim use it for their in-house game |
18:32:32 | Yardanico | they've made UE4 bindings before but then decided that Godot was a better fit for their 2D game |
18:32:53 | Yardanico | there's a simple example here https://github.com/pragmagic/godot-nim-stub |
18:33:00 | FromDiscord_ | <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:07 | FromDiscord_ | <Joshua S. Grant> Also, cool will check that out |
18:34:09 | FromDiscord_ | <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:13 | FromDiscord_ | <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:02 | Yardanico | wdym "godot-nim is still not working"? |
18:36:39 | FromDiscord_ | <Recruit_main707> last time i tried using it it didnt work |
18:36:48 | Yardanico | well maybe you did something wrong :P |
18:36:54 | Yardanico | and we have SFML bindings too |
18:36:58 | Araq | fork it, make it work, create a PR so that it's an "important package" |
18:37:07 | FromGitter | <awr1> hello |
18:37:11 | FromDiscord_ | <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:12 | Yardanico | https://github.com/search?o=desc&q=language%3Anim+game&s=stars&type=Repositories |
18:37:14 | * | narimiran joined #nim |
18:37:23 | FromGitter | <awr1> RE first languages: TI-BASIC was my first |
18:37:25 | * | martinium joined #nim |
18:37:28 | Yardanico | also see https://github.com/Vladar4/nimgame2 |
18:37:31 | FromDiscord_ | <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:09 | FromDiscord_ | <Joshua S. Grant> The name, it pains me lol |
18:38:12 | FromDiscord_ | <Joshua S. Grant> 'nimgame2' |
18:38:18 | Yardanico | seems okay for me |
18:38:22 | FromDiscord_ | <Recruit_main707> about SFML, cant we make nim appear in here? https://www.sfml-dev.org/download/bindings.php |
18:38:27 | Yardanico | not really |
18:38:34 | Yardanico | ah wait |
18:38:35 | martinium | Hello everyone |
18:38:36 | Yardanico | it's already there |
18:38:37 | martinium | Happy Friday |
18:38:54 | * | FromDiscord_ <Joshua S. Grant> waits for someone to make the arguably more painful -- nimtendo |
18:38:55 | FromDiscord_ | <Recruit_main707> Yardanico: good call, im so blind |
18:38:56 | kungtotte | My 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:13 | FromDiscord_ | <Recruit_main707> martinium hi |
18:39:27 | Yardanico | it 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:28 | FromDiscord_ | <Rika> kungtotte, ouch |
18:39:34 | Araq | hmm 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:47 | Araq | *recursive algorithm |
18:40:01 | Araq | I think I'm a bad compiler writer. |
18:40:16 | FromDiscord_ | <Recruit_main707> facts say you are not though |
18:40:48 | martinium | great compiler devs always think they are terrible compiler devs |
18:40:58 | Yardanico | i always think that all compiler devs are great :P |
18:41:02 | * | liblq-dev joined #nim |
18:41:14 | FromDiscord_ | <Rika> great (insert skill 1) people think they are terrible (insert skill 1) people |
18:41:25 | martinium | Araq, where you get started with compiler dev stuff? College? |
18:41:43 | Yardanico | university maybe? |
18:42:10 | kungtotte | Rika, yeah it was Good Times(tm). You wrote code like ? (somecondition) : goto "true_label" |
18:42:12 | FromGitter | <bung87> guess TI-BASIC and flash guys are not young |
18:42:29 | Yardanico | kungtotte: that's still not the worst I guess |
18:42:41 | kungtotte | Oh it's not the worst, but it was pretty terrible |
18:43:13 | kungtotte | You made "blocks" by beginning with a label, then write your code, and end with a goto "continue" |
18:43:18 | Araq | university but I wrote interpreters with 18 fwiw |
18:43:25 | kungtotte | If you missed that last goto it would just keep going |
18:43:30 | kungtotte | Also no looping constructs |
18:43:43 | kungtotte | So loops were written like #loop; code here; sleep 0.1; goto "loop" |
18:43:50 | companion_cube | Araq: derecursification is a thing, but ugly af |
18:43:57 | FromDiscord_ | <Rika> isnt "goto firstlabel" essentially a looping construct |
18:44:05 | companion_cube | (sorry, I imagineyou know it better than me) |
18:44:14 | kungtotte | The 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:38 | kungtotte | Rika, right, I meant it had no for/while or anything like that. You rolled your own loops |
18:44:41 | Araq | well I can translate it into push/pop opcodes and a virtual machine, companion_cube ;-) |
18:44:42 | FromDiscord_ | <Rika> man that legit sounds awful |
18:44:51 | FromGitter | <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:26 | kungtotte | People 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:45 | FromGitter | <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:50 | Araq | kungtotte: 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:37 | kungtotte | Araq: 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:24 | Araq | after 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:19 | FromDiscord_ | <Recruit_main707> Yaradinco: `Invalid GODOT_BIN path: C:\Users\porra\OneDrive\Escritorio\Godot_v3.1.2-stable_win64.exe` |
18:54:49 | Yardanico | try not to use OneDrive I guess |
18:54:54 | Yardanico | and try to remove _ :P |
18:55:08 | FromDiscord_ | <Recruit_main707> that came by default |
18:57:16 | Araq | fix the damn build so that it doesn't use environment variables, so annoying |
18:57:39 | disruptek | is enum position variant for enums with holes? |
18:58:14 | disruptek | enum.sym.position ... |
19:00:20 | Yardanico | Araq: well it uses that to generate API |
19:00:32 | Yardanico | https://github.com/pragmagic/godot-nim/blob/master/godot/godotapigen.nim |
19:00:43 | Araq | disruptek: e.position it its ordinal value |
19:00:55 | Yardanico | it gets JSON api description from that godot binary and uses it |
19:01:38 | Araq | oh not that again |
19:02:07 | Araq | don't generate Nim code on the user's machine, it makes QA impossible... |
19:02:32 | Araq | generate it on your machine and push the Nim code to github. ffs... |
19:03:19 | disruptek | thanks. |
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:13 | FromDiscord_ | <Recruit_main707> https://play.nim-lang.org/#ix=2jon how is this looking? |
19:50:34 | FromDiscord_ | <Recruit_main707> im not sure if i got generics & shit correctly |
19:50:46 | FromDiscord_ | <Recruit_main707> hol up |
19:51:01 | FromDiscord_ | <Recruit_main707> nvm |
19:51:28 | FromDiscord_ | <Recruit_main707> (the question is still up) :P |
19:53:15 | leorize | I'm seeing capitalized proc names |
19:53:33 | leorize | and non type-safe conversions? |
19:53:37 | leorize | casting* |
19:54:05 | FromDiscord_ | <Recruit_main707> about capitalized, im just transpiling as 1:1 as i can :p |
19:54:14 | FromDiscord_ | <Recruit_main707> about casting, how would you? |
19:54:19 | narimiran | don't. |
19:54:21 | Yardanico | it depends on what you want to do |
19:54:33 | FromDiscord_ | <Recruit_main707> this are flatbuffers |
19:55:03 | * | xcm quit (Killed (card.freenode.net (Nickname regained by services))) |
19:55:12 | leorize | without seeing the original code, I can't comment on this |
19:55:23 | leorize | but I'm pretty sure that some casts here are just plain wrong |
19:55:34 | leorize | at least with the unconstrained generics |
19:56:53 | * | xcm joined #nim |
19:57:39 | FromDiscord_ | <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:03 | FromDiscord_ | <Recruit_main707> also, i was told byte operations are not efficient. |
19:59:24 | leorize | yea this is completely wrong, sorry |
19:59:31 | leorize | wdym by bytes operations not efficient? |
19:59:59 | FromDiscord_ | <Recruit_main707> shl and shr |
20:00:07 | FromDiscord_ | <Recruit_main707> whats wrong though? |
20:00:11 | leorize | they are efficient? |
20:00:24 | leorize | but shl works on bits, not bytes |
20:00:33 | FromDiscord_ | <Recruit_main707> bits sorry :P |
20:00:40 | leorize | what do you expect WriteVal to do? |
20:00:42 | Yardanico | operations on bits are as efficient as they can be |
20:00:44 | Yardanico | also see https://github.com/Skrylar/skflatbuffers |
20:00:49 | Yardanico | https://github.com/Skrylar/skflatbuffers/blob/master/skflatbuffer.nim |
20:01:50 | leorize | skrylar[m] cracked this long ago? damn :P |
20:01:56 | FromDiscord_ | <Recruit_main707> this is what the flatbuffers for c creator told me: |
20:01:57 | FromDiscord_ | <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:48 | narimiran | leorize: while you're here, maybe you know: how do i escape `'` in init.vim? |
20:03:01 | leorize | byte shift is definitely not the same as bit shifts |
20:03:07 | * | hax-scramper joined #nim |
20:03:17 | leorize | narimiran: wdym by escape? |
20:03:20 | leorize | in a string? |
20:03:23 | leorize | then you don't have to? |
20:03:42 | FromDiscord_ | <Recruit_main707> i know very little about them, forgive my ignorance |
20:04:22 | narimiran | leorize: i have something like `'foo': 'bar'`, and i want to have `'foo': '\'bar'` |
20:04:23 | leorize | I don't know much either |
20:04:39 | leorize | Recruit_main707: though I think he was talking about bit shifts |
20:04:45 | leorize | gotta look up real quick |
20:04:55 | leorize | narimiran: "'bar"? |
20:05:06 | leorize | or if you like it the pascal way: '''bar' |
20:05:26 | narimiran | wait, are you telling me that double quotes just work?? why didn't i try that?? |
20:05:34 | FromDiscord_ | <Recruit_main707> '\'bar' shouldnt this also work though? |
20:05:48 | narimiran | (is that a 3x single quote in the second example?) |
20:05:50 | FromDiscord_ | <Recruit_main707> damm it discord |
20:06:07 | leorize | narimiran: yes |
20:06:08 | narimiran | `'\'bar'` doesn't work |
20:06:42 | narimiran | thanks, let me try if i can make it work.... |
20:07:16 | liblq-dev | leorize: nim.nvim is highlighting NPeg's fail() both as an error and as a template⦠lol |
20:07:19 | leorize | Recruit_main707: idk, bitshifting is as efficent as it can be |
20:07:35 | leorize | liblq-dev: don't blame me :P blame the compiler |
20:07:48 | liblq-dev | not blaming you ofc, it's nimsuggest |
20:08:01 | FromDiscord_ | <Recruit_main707> leorize: its not a viable solution for generics though :P |
20:08:24 | leorize | wdym? :P |
20:09:10 | FromDiscord_ | <Recruit_main707> if you want the lame question: |
20:09:10 | FromDiscord_ | <Recruit_main707> how can i make all of those Write... functions in Nim (with generics) |
20:11:06 | leorize | ah, I get what that guy mean now |
20:11:35 | narimiran | leorize: yep, that will work! thanks!! |
20:13:15 | * | couven92 quit (Ping timeout: 250 seconds) |
20:15:56 | FromDiscord_ | <Disciple> Is there a way to get the compiler to print warnings for exceptions that aren't handled? |
20:16:13 | Yardanico | yes |
20:16:22 | Yardanico | but it will error instead though :P |
20:16:30 | Yardanico | add {.raises: [].} to a proc definition or something else |
20:16:36 | dom96 | how's everybody doing? |
20:16:40 | Yardanico | and compiler will error if some exception can be raised |
20:16:47 | dom96 | After 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:03 | FromDiscord_ | <Recruit_main707> leorize: u there? |
20:22:27 | leorize | yea I figured out an efficient way but it's not pretty, mind you |
20:22:27 | Yardanico | you can use |
20:22:29 | Yardanico | !seen leorize |
20:22:30 | disbot | leorize spoke in 12#nim 2 seconds ago |
20:22:36 | Yardanico | hm |
20:22:37 | Yardanico | !help |
20:23:29 | FromDiscord_ | <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:43 | leorize | to be fair, "slow" is an overstatement |
20:25:58 | leorize | in typical usage, you'd not even notice |
20:26:13 | leorize | you gotta do actual benchmarks to see how "slow" or "fast" this is |
20:26:55 | * | couven92 quit (Ping timeout: 260 seconds) |
20:27:09 | FromDiscord_ | <Disciple> Raises works well, but what about standard library functions? Ie writing to a file |
20:27:14 | FromDiscord_ | <Rika> Ah yes, premature optimization |
20:27:15 | * | letto_ joined #nim |
20:28:06 | * | abm quit (Ping timeout: 256 seconds) |
20:28:16 | FromDiscord_ | <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:56 | leorize | Recruit_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:18 | leorize | without comparision this might just be an overcomplicated way to implement this |
20:30:34 | FromDiscord_ | <Recruit_main707> it does look ugly, but seems pretty good if we ignore that |
20:31:09 | leorize | this is as efficient as I can think of in theory |
20:31:20 | FromDiscord_ | <Rika> Might not be worth the maintenance cost for the performance if gains |
20:31:30 | FromDiscord_ | <Rika> It* |
20:31:37 | leorize | if you want "super micro optimization", you gotta pull out the profiler and instrument the individual instructions themselves |
20:31:52 | FromDiscord_ | <Recruit_main707> Rika: this wont be changed in a long time |
20:32:12 | * | exigirl joined #nim |
20:33:37 | leorize | that's just writeval |
20:33:43 | leorize | you gotta implement getval yourself |
20:34:02 | FromDiscord_ | <Recruit_main707> get val wont work already?? |
20:34:13 | leorize | nope |
20:34:19 | leorize | you implemented it wrong :P |
20:34:35 | * | sagax joined #nim |
20:34:45 | FromDiscord_ | <Recruit_main707> gimme a little clue pls |
20:34:57 | * | exigirl quit (Client Quit) |
20:35:02 | leorize | you don't `cast` a `seq` |
20:35:10 | leorize | it's not a byte buffer |
20:35:11 | * | letto_ is now known as letto |
20:35:30 | FromDiscord_ | <Recruit_main707> and an openArray? |
20:35:30 | leorize | the seq contains more than just the byte buffer I mean |
20:35:40 | leorize | same thing applies here |
20:35:48 | leorize | just see how I implemented WriteVal |
20:35:59 | FromDiscord_ | <Recruit_main707> hmmm, so its not gonna be that easy :P |
20:37:49 | FromDiscord_ | <Recruit_main707> yeah, its basically applying the same but as getter |
20:37:54 | FromDiscord_ | <Recruit_main707> thank you |
20:38:33 | leorize[m] | https://godbolt.org/z/zedYJO |
20:38:43 | leorize[m] | yep, this really is as efficient as it gets, on an x86 |
20:39:05 | FromDiscord_ | <Recruit_main707> nice |
20:39:22 | * | narimiran quit (Quit: leaving) |
20:39:44 | Yardanico | leorize[m]: seems like it got inlined? |
20:39:45 | Yardanico | nice |
20:39:52 | Yardanico | ah |
20:39:54 | Yardanico | {.inline.} |
20:40:32 | leorize | took literally 0 instructions :) |
20:41:32 | * | abm joined #nim |
20:41:32 | Yardanico | no code - most performant code |
20:44:18 | * | a_b_m quit (Ping timeout: 265 seconds) |
20:45:13 | dom96 | Researching 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:17 | FromDiscord_ | <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:27 | leorize | in the "options" menu it has the button to make it generate executable |
21:29:25 | FromDiscord_ | <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:36 | leorize | well I activated "compile to binary" and I see `call` all over the place :P |
21:32:01 | FromDiscord_ | <Varriount> Yeah, but do you see any calls to things like `echo`? |
21:34:36 | leorize | I do see calls, but it calls some arbritary address instead |
21:35:34 | leorize | also we don't have line correspondance with the asm here |
21:36:09 | FromDiscord_ | <Varriount> If you use --linedir:on --debugger:native you get a (fairly inaccurate) asseembly map |
21:36:43 | FromDiscord_ | <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:10 | FromDiscord_ | <Varriount> Anyone know what needs to be passed to the compiler to dump the generated code of async procedures? |
21:47:33 | disruptek | expandMacros |
21:53:55 | * | dchem joined #nim |
21:55:10 | shashlick | disruptek: wanted to discuss the plugins issue with nimterop |
21:57:16 | disruptek | what? |
21:57:20 | disruptek | plugins? |
21:57:54 | shashlick | the nimph issue where nimcache / nimblePath / path don't get passed to the plugin compile step |
21:58:06 | disruptek | what do you propose? |
21:58:09 | shashlick | so i was thinking about the design |
21:58:36 | shashlick | we have std/compilesettings from which I can get nimcache, nimblePaths and lazyPaths |
21:59:05 | shashlick | but i have no way to know if this is default values or if they are custom for that call |
21:59:25 | disruptek | what does that mean? |
21:59:37 | disruptek | what's the difference? |
21:59:57 | disruptek | these are values set by the configuration, wherever it may occur, right? |
22:00:20 | shashlick | it 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:37 | disruptek | i guess maybe you load the nim.cfg from the compiler to determine the "defaults", but it's hacky. |
22:00:58 | shashlick | i can run nim dump in json and get all the info i need but will have to do that diff |
22:01:15 | disruptek | i dunno what you mean by "propogate what i got" |
22:01:20 | shashlick | another thing is that if you use the cImport() method, I know the nim flags received and can forward it to toast |
22:01:39 | disruptek | you are trying to reuse the cache if no settings changed? |
22:02:02 | shashlick | so when you call nim c wrapper.nim, it picks up the flags |
22:02:17 | shashlick | then the wrapper calls toast behind the scenes with CLI arguments |
22:02:28 | shashlick | toast now might need to compile a plugin behind the scens |
22:02:29 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/getters.nim#L720 |
22:02:55 | shashlick | that's the step that breaks since toast just runs nim as if no local deps were detected |
22:03:09 | shashlick | and since it is in nimcache, there's no nim.cfg in effect |
22:03:29 | shashlick | so I need to detect the correct flags in wrapper.nim, forward to toast who will forward it back to nim |
22:03:43 | shashlick | but this design does not solve the issue when you just run toast directly |
22:03:53 | shashlick | that will still fail unless toast is made smart enough to figure this out |
22:04:15 | shashlick | considering you have nim.cfg functionality within nimph, was wondering what your thoughts were around this |
22:04:19 | disruptek | toast could learn how to parse the config too, i guess. |
22:04:26 | disruptek | i mean, this is what tools do. |
22:04:58 | shashlick | note 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:12 | shashlick | so we have to pass projectDir context all the way even in that case |
22:05:15 | disruptek | i understand your wrapper.nim solution. that sounds workable to me, but still pretty brittle compared to including the code post-generation. |
22:05:59 | disruptek | the projectDir context gets picked up fine toast is local to it -- inside it. |
22:06:02 | shashlick | and nim doesn't make currentDir reliable to know projectDir settings i should be referring to |
22:06:25 | shashlick | in localdeps mode yes, but the same design has to work in ~/.nimble/pkgs mode as well |
22:06:31 | FromDiscord_ | <Varriount> rayman22201: Are you around? |
22:07:11 | disruptek | it already works in pkgs mode, right? |
22:07:36 | shashlick | ya but how does toast know it isn't in localdeps mode |
22:07:40 | disruptek | pkgs mode is that same mode. what matters is where you are located; nim picks up env settings from the env. |
22:07:43 | shashlick | or in some $NIMBLE_DIR or other nim.cfg mode |
22:08:09 | disruptek | localdeps mode /is/ nimble mode as far as the compiler is concerned. |
22:08:22 | disruptek | they are all the same. |
22:08:32 | disruptek | to pretend otherwise is to make life hard. |
22:08:38 | * | Hexeratops joined #nim |
22:09:54 | shashlick | how about this - when toast runs, it checks where it is - if it is in ~/.nimble/pkgs then it runs per usual |
22:10:28 | disruptek | i'm trying to tell you that your model doesn't match reality. |
22:10:37 | disruptek | you're asking me to choose how to cover my eyes. |
22:10:41 | shashlick | what do you propose |
22:10:46 | shashlick | i'm telling you the challenges |
22:10:53 | disruptek | can you think of a good reason not to do it the way i do it? |
22:10:59 | disruptek | because i chose my design for a reason. |
22:11:10 | shashlick | i don't know your design which is why i'm asking you |
22:11:24 | disruptek | my design is to emulate the compiler in all evaluations of the env. |
22:11:31 | disruptek | thus, whatever works in the compiler, works in nimph. |
22:11:35 | shashlick | a) I need to know what $projectdir is and b) evaluate it |
22:11:40 | disruptek | nim dump |
22:12:03 | disruptek | to find the project dir itself, i search cwd and up. |
22:12:14 | disruptek | i try to find one and only one .nimble file. |
22:12:28 | disruptek | first one found, bam, that's my project dir. |
22:12:59 | shashlick | if 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:03 | shashlick | do you need main.nim? |
22:13:12 | disruptek | nah. |
22:13:25 | disruptek | do you need main.nim? |
22:13:27 | shashlick | cause i noticed `nim dump .` does something different from `nim dump main.nim` |
22:13:40 | shashlick | i don't for toast, it is operating on C headers |
22:13:42 | disruptek | nim dump some.nim will also eval some.nim.cfg |
22:13:58 | disruptek | it may set other paths. |
22:13:58 | * | a_b_m quit (Quit: Leaving) |
22:14:03 | shashlick | you run just `nim dump .`? |
22:14:12 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:14:30 | disruptek | see `findPrefixDir` in src/nimph/config.nim |
22:14:44 | disruptek | i dump it in json with a dummy target file. |
22:15:51 | shashlick | okay 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:59 | rayman22201 | Varriount what's up? |
22:16:00 | disruptek | it's annoying, right? |
22:16:24 | shashlick | on 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:45 | shashlick | when run through cImport, i can pass the project directory to toast as a CLI param so it knows the context |
22:16:56 | shashlick | do you have code detecting .nimble as well? |
22:17:06 | disruptek | yeah; from bump. |
22:17:24 | disruptek | nimph is a little smarter because it knows how to follow link files. |
22:18:06 | shashlick | i'd rather have just depended on nimph for this but considering nimph is depending on nimterop, not possible |
22:18:26 | disruptek | maybe we make a pmtools lib. |
22:19:02 | shashlick | that'll be awesome |
22:19:30 | shashlick | get nimble to use it as well eventually |
22:19:47 | FromDiscord_ | <Varriount> dom96: In code generated from async procedures, what is the purpose of the AsynCcontinue closure? |
22:19:53 | disruptek | probably nimterop /could/ depend on nimph. |
22:19:53 | shashlick | anyway, 2 things i need - figure out where .nimble is for project dir and the nim dump parsing which you pointed to already |
22:20:30 | dom96 | Varriount: to continue the async iterator AFAIK |
22:20:33 | dom96 | *IIRC |
22:21:15 | disruptek | the .nimble finder is bump.findTarget("some directory", target = "optional package name") |
22:21:39 | disruptek | returns tuple[message: string; found: Option[Target]] |
22:21:48 | dom96 | shashlick, disruptek: pretty sure Nimble has functionality, why aren't you depending on it? |
22:21:56 | disruptek | Target is a repo, package, ext: string tuple. |
22:22:15 | disruptek | because i'm a comedian and not a clown. |
22:23:56 | shashlick | dom96: 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:18 | shashlick | now i'm wondering why i added compilesettings if nim dump is the solution anyway |
22:24:33 | dom96 | sure, but it can find the .nimble file for you |
22:24:46 | disruptek | i doubt it works from any subdirectory. |
22:25:42 | dom96 | *shrug* |
22:26:06 | dom96 | The 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:23 | disruptek | you're right; they both sound like silly ideas. |
22:34:23 | shashlick | what does nimph use from bump? |
22:34:37 | disruptek | the target stuff, the version stuff. |
22:36:21 | shashlick | so you created linkedFindTarget in nimph that uses findTarget from bump? |
22:36:32 | disruptek | yeah, probably. |
22:36:36 | shashlick | would you consider moving it to bump? |
22:36:47 | disruptek | bump doesn't need to know about it, but, i dunno, maybe. |
22:36:54 | disruptek | can it be moved? |
22:37:05 | shashlick | on the flip side, does even nimterop? |
22:37:15 | shashlick | what's the case for searching through link files? |
22:37:17 | disruptek | nimterop can just import from nimph. |
22:37:37 | disruptek | because it helps me find the actual repo for a package. |
22:37:47 | disruptek | this is something that the compiler does, so i do it too. |
22:38:09 | disruptek | i think i was gonna use the compiler code for it by my stuff was simpler. |
22:38:40 | shashlick | i import compiler into toast anyway, where is this in compiler? it doesn't look for nimble files does it |
22:38:53 | disruptek | it has to follow link files. |
22:39:01 | shashlick | ah |
22:39:34 | FromDiscord_ | <Recruit_main707> whats the process behind cast? |
22:39:57 | disruptek | treat memory like the dirty memory it is. |
22:40:26 | disruptek | load the bullets into your foot-shooter and go to town. |
22:41:13 | FromDiscord_ | <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:21 | FromDiscord_ | <Recruit_main707> seq* |
22:44:20 | FromDiscord_ | <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:44 | shashlick | what do you want to cast to what |
22:47:00 | * | xcm joined #nim |
22:47:47 | martinium | is there a Nim equivalent to python's selenium? |
22:48:47 | FromDiscord_ | <Recruit_main707> shshlick, ive already been told this is wrong, but it explains the problem: https://play.nim-lang.org/#ix=2jpu |
22:49:24 | shashlick | disruptek: did you consider just using loadConfig() from compiler instead of nim dump? |
22:49:56 | disruptek | i cannot find the compiler without running it because choosenim. |
22:50:01 | disruptek | shims. |
22:50:05 | disruptek | this is the problem. |
22:50:13 | disruptek | stupid designs. |
22:51:14 | shashlick | how does that affect you when nimconf.nim is compiled into nimph? |
22:51:20 | leorize | Recruit_main707: cast basically tell the compiler how to interpret a glob of data as |
22:51:35 | disruptek | i need to know how to set the prefixdir. |
22:52:18 | disruptek | it's not available in nim-1.0, fwiw. |
22:52:28 | shashlick | wish i had a better memory |
22:53:11 | leorize | disruptek: set the prefixdir? |
22:53:41 | leorize | ah I see :P didn't pay enough attention to the conversation |
22:53:45 | FromDiscord_ | <Technicae Circuit> What module is `getTime()` defined in? |
22:54:09 | disruptek | https://github.com/disruptek/nimph/issues/127 |
22:54:10 | disbot | β₯ Path error when using choosenim ; snippet at 12https://play.nim-lang.org/#ix=2gK1 |
22:54:43 | leorize | @Technicae Circuit: times |
22:55:27 | FromDiscord_ | <Technicae Circuit> Thanks |
22:56:03 | shashlick | thanks, that rang the bell |
22:56:26 | disruptek | but eventually, we could maybe determine prefixDir this way. |
22:57:00 | FromDiscord_ | <Recruit_main707> leorize, i surrender for today, will try tomorrow :p |
22:57:14 | FromDiscord_ | <Technicae Circuit> So, what's the built-in http client Nim has? |
22:57:28 | FromDiscord_ | <Technicae Circuit> I'm going to make my own simple library now |
22:57:34 | leorize | HTTP/1.1 support, inefficient download/upload |
22:57:35 | disruptek | it's the built-in http client. |
22:58:30 | shashlick | i 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:36 | FromDiscord_ | <Technicae Circuit> What's it called? And is there a better alternative? |
22:59:03 | shashlick | what 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:08 | leorize | it's called httpclient. You should take a look at https://nim-lang.org/docs/lib.html |
22:59:24 | disruptek | shashlick: i do. you cannot make sense of loadConfig() without a valid prefixDir. |
22:59:31 | FromDiscord_ | <Technicae Circuit> Oh okay, thanks! |
23:00:16 | disruptek | i 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:30 | disruptek | when we can rely upon prefixDir in the config, then we can deprecate some of this. |
23:01:47 | shashlick | Ok |
23:02:12 | disruptek | it would be good to know how to do that. i haven't even looked. |
23:02:34 | disruptek | i'm waiting for it to be backported and a new 1.0 patch. then i will bump reqs, etc. |
23:07:59 | shashlick | You mean the nimExe addition? |
23:20:30 | FromDiscord_ | <Technicae Circuit> Is the name `nimcord` taken in the package list? |
23:20:39 | FromDiscord_ | <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:42 | FromDiscord_ | <KingDarBoja> What's up boys |
23:58:22 | * | xet7 quit (Quit: Leaving) |