00:00:01 | FromDiscord | <Elegant Beef> Speaking of leorize i dont know how to include the execve as when i try to include it says it's already included |
00:00:19 | leorize[m] | execve is in posix.nim |
00:00:25 | FromDiscord | <Elegant Beef> ah |
00:02:18 | Prestige | Hm it looks like the xlib wrappers aren't using the importc or header pragmas, just cdecl |
00:03:48 | FromDiscord | <Elegant Beef> So correct me if im wrong leo, but seems it's↵openpt ->grantPt->unlockPt->openSlave... then magic |
00:03:51 | Prestige | or libx11.. need to figure out how to find pragma definitions and see what they are doing |
00:04:20 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/manual.html#pragmas |
00:04:29 | Prestige | ah they have a file for it, found it |
00:07:50 | FromDiscord | <Elegant Beef> I wonder if i now have the knowledge i can make sense of ST |
00:19:11 | * | couven92 quit (Ping timeout: 265 seconds) |
00:23:13 | FromDiscord | <lex> hi |
00:23:16 | FromDiscord | <lex> how do I format this correctly |
00:23:19 | FromDiscord | <lex> ```nim↵ let f = open("connctl.json", fmWrite)↵ write(f, fmt"{\n\t"name": {name},\n\t"author": {author}\n}")``` |
00:23:24 | FromDiscord | <lex> the uhm |
00:23:25 | FromDiscord | <lex> linter |
00:23:26 | FromDiscord | <lex> isnt very happy |
00:23:28 | skrylar[m] | are we keeping effects tracking around? |
00:23:47 | FromDiscord | <lex> wait what |
00:25:22 | skrylar[m] | someone was talking about how low level languages "can't be sandboxed" and i was pointing out with the effects system you actually kind of can, by just having the compiler deny the use of functions not marked as safe |
00:26:19 | FromDiscord | <lex> ah sorry |
00:27:05 | FromDiscord | <Elegant Beef> I mean i dont even see what you're trying to od |
00:27:34 | FromDiscord | <Elegant Beef> You know the json module has nice operators to convert from json to string |
00:29:39 | FromDiscord | <Elegant Beef> @lex https://play.nim-lang.org/#ix=2oe2 |
00:30:36 | FromDiscord | <lex> oh cheers |
00:33:28 | FromDiscord | <lex> anyway I can get coloured terminal output? |
00:33:58 | * | FromDiscord quit (Remote host closed the connection) |
00:34:14 | * | FromDiscord joined #nim |
00:41:51 | FromDiscord | <lex> what if i only want part of the text to be coloured? |
00:42:17 | FromDiscord | <Zed> then have 2 different print calls |
00:42:27 | FromDiscord | <lex> should i use stdout |
00:42:32 | FromDiscord | <lex> instead of echo |
00:42:34 | FromDiscord | <Zed> yes |
00:42:36 | FromDiscord | <lex> ok thank |
00:42:45 | FromDiscord | <Zed> stdout.writeLine(string here) |
00:42:46 | FromDiscord | <lex> sorry im new to nim |
00:43:26 | FromDiscord | <Zed> no problem, enjoy! |
00:43:32 | FromDiscord | <lex> aye, I am haha |
00:43:42 | FromDiscord | <lex> I used to write typescript before, nowadays idk |
00:43:53 | FromDiscord | <lex> I wanna get away from interpreted languages. finding nim a bit difficult because i dont know where anything is |
00:43:56 | FromDiscord | <lex> but im getting there |
00:44:30 | FromDiscord | <Elegant Beef> I mean you can use echo just do it line by line |
00:44:36 | FromDiscord | <Zed> make sure you read through the nim tutorials on the website, it explains a lot of things |
00:44:54 | FromDiscord | <lex> proc writeStyled(txt: string; style: set[Style] = {styleBright}) {...} |
00:44:59 | FromDiscord | <lex> is this what i use for the colours |
00:45:02 | FromDiscord | <lex> or is that styles |
00:45:10 | FromDiscord | <Elegant Beef> That's styles |
00:45:20 | FromDiscord | <Elegant Beef> Dim/bold/ what ever in ansiC |
00:45:46 | FromDiscord | <Elegant Beef> I'd bodge it so i dont know the best way to suggest what you want |
00:46:08 | FromDiscord | <lex> my string is sometihng along the lines of |
00:46:15 | FromDiscord | <lex> ERROR: Blah blah... |
00:46:26 | FromDiscord | <lex> ERROR: I want to be bold and in red |
00:46:26 | FromDiscord | <Elegant Beef> And you just want error red? |
00:46:41 | FromDiscord | <lex> yeup |
00:47:21 | FromDiscord | <Zed> maybe write a function that takes your normal string and adds error onto it in whatever colour you want |
00:47:59 | FromDiscord | <lex> yeah could do |
00:48:17 | FromDiscord | <Zed> eg: `proc printInfo(input: string, infoType:int) ` |
00:48:25 | FromDiscord | <Zed> and have a case for infoType |
00:51:20 | * | krux02_ quit (Remote host closed the connection) |
00:52:01 | FromDiscord | <Elegant Beef> If you want the exact same behaviour everywhere i'd just do this↵https://play.nim-lang.org/#ix=2oe4 |
00:52:09 | FromDiscord | <Elegant Beef> writeStyled nicely doesnt newline |
00:52:16 | FromDiscord | <Elegant Beef> So echo is positioned where it needs to |
00:53:11 | FromDiscord | <Elegant Beef> Ah |
00:53:15 | * | tiorock joined #nim |
00:53:15 | * | tiorock quit (Changing host) |
00:53:15 | * | tiorock joined #nim |
00:53:15 | * | rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
00:53:15 | * | tiorock is now known as rockcavera |
00:53:16 | FromDiscord | <Elegant Beef> Actually the defaullt style is bold |
00:53:24 | FromDiscord | <Elegant Beef> Forgot that bright = bold |
00:54:04 | FromDiscord | <lex> lmao |
00:54:05 | FromDiscord | <lex> yeah |
00:54:07 | FromDiscord | <lex> cheers man |
01:04:49 | * | theelous3 quit (Read error: Connection reset by peer) |
01:06:27 | * | konvertex quit (Ping timeout: 256 seconds) |
01:12:22 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:14:12 | * | chemist69 joined #nim |
01:28:06 | * | tiorock joined #nim |
01:28:06 | * | rockcavera is now known as Guest81196 |
01:28:06 | * | Guest81196 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
01:28:06 | * | tiorock is now known as rockcavera |
01:49:17 | * | Tlanger joined #nim |
01:51:59 | * | Tongir quit (Ping timeout: 265 seconds) |
02:21:56 | * | muffindrake quit (Ping timeout: 256 seconds) |
02:24:01 | * | muffindrake joined #nim |
02:26:56 | * | pbb quit (Remote host closed the connection) |
02:28:13 | * | pbb joined #nim |
02:39:46 | * | Tongir joined #nim |
02:40:20 | * | FromDiscord quit (Remote host closed the connection) |
02:40:37 | * | FromDiscord joined #nim |
02:41:54 | * | Tlanger quit (Ping timeout: 240 seconds) |
03:10:58 | * | rockcavera quit (Remote host closed the connection) |
03:12:23 | * | chemist69 quit (Ping timeout: 246 seconds) |
03:13:36 | * | chemist69 joined #nim |
03:23:37 | * | pbb quit (Remote host closed the connection) |
03:24:15 | FromDiscord | <Elegant Beef> This is interesting↵https://play.nim-lang.org/#ix=2oel |
03:24:48 | FromDiscord | <Rika> what the heck is that indent tho |
03:24:52 | * | pbb joined #nim |
03:25:12 | FromDiscord | <Elegant Beef> Didnt copy properly from my ide |
03:27:04 | FromDiscord | <Elegant Beef> Im just trying to figure out how it can call forking only once but then can call both of the following echos |
03:27:54 | FromDiscord | <Elegant Beef> I guess it's probably the dup2 causing that behaviour |
03:40:25 | * | zacharycarter quit (Ping timeout: 264 seconds) |
04:02:19 | * | sz0 quit (Quit: Connection closed for inactivity) |
04:05:43 | * | opal quit (Ping timeout: 240 seconds) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:43 | * | supakeen joined #nim |
04:11:25 | Prestige | hm I don't know enough c to create this xft wrapper lol. I'm kind of surprised there isn't a tool to create wrappers from header files |
04:12:04 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:16:19 | bung | c2nim doesnot work for you? |
04:20:08 | Prestige | Didn't know about it, trying it now.. looks like I'll have to do some tweaking |
04:20:44 | * | opal joined #nim |
04:23:40 | Prestige | Yeah it's complaining about an expected ; but I'm not sure why. Hm |
04:24:09 | * | narimiran joined #nim |
04:28:24 | FromDiscord | <Elegant Beef> What header file are you wrapping? |
04:28:28 | Prestige | Xft.h |
04:29:11 | FromDiscord | <Elegant Beef> Interestingly i dont have that one |
04:29:47 | FromDiscord | <Elegant Beef> ah |
04:29:50 | Prestige | I think it doesnt come with xlib |
04:29:56 | FromDiscord | <Elegant Beef> Yea it doesnt |
04:30:00 | FromDiscord | <Elegant Beef> it's from libxft-dev |
04:30:06 | FromDiscord | <Elegant Beef> atleast on ubuntu |
04:31:33 | FromDiscord | <Elegant Beef> Ah that seems like it'll be rather simple to wrap |
04:32:01 | Prestige | yeah? I don't know C, so yeah |
04:32:08 | FromDiscord | <Elegant Beef> I dont either |
04:32:11 | FromDiscord | <Elegant Beef> :p |
04:32:38 | Prestige | what will you do about FcCharSet? |
04:32:45 | FromDiscord | <Elegant Beef> "will" |
04:33:53 | Prestige | since it's part of another lib |
04:33:58 | Prestige | appears to just be a typedef |
04:34:30 | FromDiscord | <Elegant Beef> Like i said i dont know C but i'd assume you either import that as a nim type |
04:34:40 | FromDiscord | <Elegant Beef> or just make it have the same fields |
04:34:48 | FromDiscord | <Elegant Beef> Depending on what it needs |
04:36:17 | FromDiscord | <Elegant Beef> My extent of making a wrapper is <https://github.com/beef331/nim_pty/blob/master/src/nim_pty.nim> |
04:36:40 | FromDiscord | <Elegant Beef> Not exactly a super difficult thing there |
04:55:18 | Prestige | I was hesitant to just drop in dummy types since they belong to another lib but I'll see what they say when I submit a pr I suppose |
05:30:05 | * | lritter joined #nim |
05:44:09 | * | silvernode joined #nim |
06:04:39 | * | kenran joined #nim |
06:08:27 | * | endragor quit (Remote host closed the connection) |
06:23:03 | FromDiscord | <willyboar> good morning everyone! |
06:24:03 | FromDiscord | <Elegant Beef> Hello |
06:24:45 | * | letto quit (Quit: Konversation terminated!) |
06:26:39 | * | letto joined #nim |
06:27:00 | * | adnan338 quit (Read error: Connection reset by peer) |
06:31:02 | silvernode | So I am trying to create a proc that generates a menu list of options based on a set of strings which are passed as parameters but I am not entirely sure how to go about it. |
06:31:14 | silvernode | I'll send an example in a sec |
06:31:35 | Prestige | Menu list? |
06:37:11 | silvernode | Finishing my example and you'll see |
06:40:26 | silvernode | Prestige, https://play.nim-lang.org/#ix=2oeJ |
06:40:56 | * | PMunch joined #nim |
06:41:58 | * | endragor joined #nim |
06:42:03 | Prestige | Oh, that kind of menu |
06:42:47 | silvernode | That example code is just one way I thought of doing it. I might want to use a seq instead of an array in the params of the proc but I figured I should make an array since the options won't need to be changed after created |
06:44:05 | * | terps joined #nim |
06:44:35 | Prestige | https://play.nim-lang.org/#ix=2oeK |
06:45:03 | Prestige | You don't need to populate another array or sequence if you're passing one into the proc |
06:45:44 | Prestige | Then you'll need to read a number from stdin and use that to get an element from the array |
06:46:10 | silvernode | Prestige, yeah that was another thing I thought about. So now I just need to list the index number and the items |
06:46:46 | Prestige | For that you can just for i, e in opts: I believe |
06:46:46 | silvernode | well the menu won't be created by the user, it's just for internal use |
06:47:35 | silvernode | damn, I'm out of time. Gotta clock into work. |
06:47:43 | silvernode | Prestige, thanks for the help! |
06:47:54 | Prestige | No problem, have a good one |
06:47:58 | silvernode | cheers! |
06:50:36 | FromDiscord | <Elegant Beef> Then there is me that'd do something silly like↵https://play.nim-lang.org/#ix=2oeJ |
06:52:27 | * | silvernode quit (Ping timeout: 260 seconds) |
06:52:37 | FromDiscord | <Elegant Beef> ll it didnt save |
06:52:55 | FromDiscord | <Zed> or this↵https://play.nim-lang.org/#ix=2oeO |
06:55:21 | FromDiscord | <Zed> PMunch: is there anyway we can change nim-playgrounds to change the id tag after there has been an edit on a different device? |
06:55:51 | PMunch | On a different device? |
06:57:49 | PMunch | But I doubt it, the playground uses ix.io for storing the snippets, and it has an explicit rule against automated pastes. TBH I wasn't completely sure if having it as a button was allowed, but I figured it was fine as it was a user-triggered action. |
06:57:56 | FromDiscord | <Zed> using cookies or something, like my post above with the playground, more times then i can count i've opened up a playground made an edit only for it to not have saved and reverted back to the old edit |
06:58:21 | PMunch | By the way you don't need repr to turn an int into a string. Just use $ which is the toString operator |
06:58:44 | FromDiscord | <Zed> yeah i know, just habit |
06:58:57 | FromDiscord | <Elegant Beef> There we go |
06:58:58 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2oeP |
06:59:02 | FromDiscord | <Elegant Beef> Rewrote it cause why not |
06:59:32 | PMunch | Zed, and instead of stdout.writeLine you can just use echo |
06:59:42 | FromDiscord | <Zed> Beef have you got some beef with red?? |
06:59:48 | FromDiscord | <Zed> yeah i know |
06:59:51 | FromDiscord | <Elegant Beef> Totally not |
07:00:54 | FromDiscord | <Zed> ok... |
07:03:30 | * | dddddd quit (Ping timeout: 260 seconds) |
07:04:20 | Prestige | Beef yeah that's what i was saying to do |
07:04:31 | Prestige | On phone atm though |
07:06:00 | FromDiscord | <Elegant Beef> You didnt once do the event based stuff 😛 |
07:06:07 | FromDiscord | <Elegant Beef> (edit) 'You didnt once ... do' => 'You didnt oncesay to' |
07:07:09 | FromDiscord | <Shucks> Got another magic challenge. Now im trying to split a type (int, float, string) into its bytes |
07:07:54 | Prestige | Meant your earlier paste, didn't see your event stuff |
07:08:15 | Prestige | Don't know what he's building, didn't want to recommend an architecture |
07:08:26 | FromDiscord | <Elegant Beef> Hey i always say event based 😄 |
07:08:40 | FromDiscord | <Elegant Beef> For a string you'll want a string stream |
07:08:46 | PMunch | @Yardanico, I've found a bug in the IRC bot edit stuff |
07:09:19 | FromDiscord | <Elegant Beef> For an int you can use bit wise ops |
07:09:21 | FromDiscord | <Shucks> Im still wondering why https://forum.nim-lang.org/t/4594 doesn't works for a int32 for example |
07:11:48 | FromDiscord | <Elegant Beef> Which one? |
07:11:59 | PMunch | Shucks, what do you mean? Should work just fine for an int32 |
07:12:10 | PMunch | Assuming you change it from 0..7 to 0..3 of course |
07:12:50 | FromDiscord | <Elegant Beef> Yea it does work |
07:12:53 | FromDiscord | <Elegant Beef> Just tested it |
07:13:05 | FromDiscord | <Shucks> Yea, I guess its the reason because im not using arrays. |
07:14:23 | Araq | use more arrays, they are nice |
07:14:43 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2oeQ |
07:14:55 | FromDiscord | <Elegant Beef> There's the issue you're facing |
07:21:27 | FromDiscord | <Shucks> I see. Im basically trying to read bytes from a process. But I guess I can't use arrays here since the size isn't known at the compile time. |
07:21:27 | FromDiscord | <Shucks> https://play.nim-lang.org/#ix=2oeR |
07:26:01 | * | Kaivo quit (Ping timeout: 264 seconds) |
07:27:39 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2oeS |
07:27:45 | FromDiscord | <Elegant Beef> If you want to read each byte from a string |
07:28:15 | * | Kaivo joined #nim |
07:29:30 | PMunch | @Shucks, what is the & here: cast[pointer](&data[0]) |
07:32:04 | PMunch | I mean this should work fine: https://play.nim-lang.org/#ix=2oeW |
07:36:56 | FromDiscord | <Shucks> Yea it works fine already. I just want to convert that bytes into its "real" types using cast which requires a array |
07:40:23 | PMunch | I mean you can do this: https://play.nim-lang.org/#ix=2oeY |
07:41:50 | PMunch | Not quite sure how you're planning on using ReadBytes, but there might be other ways of doing it |
07:43:24 | PMunch | Something like this for example might suit your needs: https://play.nim-lang.org/#ix=2oeZ |
07:44:34 | * | Vladar joined #nim |
07:45:06 | FromDiscord | <Shucks> that looks perfect. Gonna try it once i got the chance. Thanks you |
07:47:40 | PMunch | Oh wait, you still need the address to read from :P |
07:47:49 | PMunch | But you get the point |
08:09:30 | * | Trustable joined #nim |
08:32:40 | PMunch | federico3, how simple do you think it would be to modify nimfmt to remove document comments? |
08:33:23 | PMunch | And related, how simple would it be to evaluate "when" statements and only include the ones that hold true? |
08:33:38 | * | Senketsu joined #nim |
08:40:02 | FromDiscord | <Shucks> Your function didn't returned the expected integers. ReadProcessMemory just returns 1/0 btw. it needs a pointer to save the read bytes. My current solution: https://play.nim-lang.org/#ix=2ofh |
08:47:00 | PMunch | Oh, I didn't realise that ReadProcessMemory returned anything :P Just put a discard in front of it and it should work fine |
08:47:20 | PMunch | That `result` variable is implicitly returned at the end of the procedure if nothing else is returned. But if ReadProcessMemory returns anything that will be returned instead |
08:48:03 | PMunch | Typically you'd have to explicitly `discard` any return value that you're not using, but I'm guessing that ReadProcessMemory is annotated with {.discardable.} |
08:48:11 | PMunch | @Shucks ^ |
08:53:01 | PMunch | And I am supplying a pointer to `result`, which is the memory location of the implicit return variable. If I remember my C calling convention correctly this means that it will write it directly to the stack frame of the caller without any indirection. |
08:54:17 | PMunch | https://play.nim-lang.org/#ix=2ofo |
08:54:43 | PMunch | https://play.nim-lang.org/#ix=2ofq <- fixed example |
08:55:39 | * | Jjp137 quit (Ping timeout: 256 seconds) |
09:05:47 | * | NimBot joined #nim |
09:09:09 | FromDiscord | <Shucks> That seems to work |
09:09:10 | FromDiscord | <Shucks> awesome |
09:09:35 | FromDiscord | <Shucks> Sorry in brand new to nim btw |
09:10:23 | * | terps quit (Ping timeout: 252 seconds) |
09:11:08 | PMunch | No worries, what you were doing wasn't really wrong (well apart possible from the &data[0] part which I'm still not quite sure what you expect to do) |
09:11:53 | PMunch | I just wanted to share a more "royale" snippet that leverages the type system and some other neat Nim features. |
09:13:14 | * | konvertex joined #nim |
09:13:51 | FromDiscord | <Shucks> To be honest I just tried to recode that golang snippet: https://play.golang.org/p/flWFK8lRVZA |
09:14:10 | PMunch | By the way, the reason it doesn't work the same with sequences as it does with arrays is that arrays are essentially just a memory region big enough to hold your items a sequence is an object that consists of the size, the capacity, and a pointer to your data buffer. That's why cast[ptr int](data[0].addr)[] works, as the address of the first element in the buffer is the same as a pointer to the entire buffer. |
09:15:28 | FromDiscord | <Shucks> Oh |
09:16:39 | FromDiscord | <Shucks> So im trying to code something similar for WriteProcessMemory now 🙂 |
09:17:11 | PMunch | Doing it the same way as in Go isn't really "wrong" in Nim, but by just sprinkling on a little type magic and Nim niceties it makes it a lot more ergonomic :) |
09:18:12 | PMunch | And with that read procedure you can of course do `let myArr = process.read(array[0..10, byte], addressToReadFrom)` if you want to read a specific amount of bytes. |
09:19:06 | PMunch | Only thing you can't do is read a dynamic amount, because all this type stuff happens on compile-time. But you could easily have one that returns a sequence of bytes as well if you need that. |
09:20:51 | FromDiscord | <Shucks> > And with that read procedure you can of course do `let myArr = process.read(array[0..10, byte], addressToReadFrom)` if you want to read a specific amount of bytes.↵wow thats awesome |
09:27:50 | federico3 | PMunch: why do you want to remove them? |
09:28:40 | PMunch | federico3, I want to make a minimal stdlib for shipping with a program that integrates NimScript |
09:29:46 | * | Vladar quit (Quit: Leaving) |
09:29:55 | PMunch | I already have some code that you feed a script and it generates a stdlib based on which modules it needs. But I'd like to strip out any `when not defined(nimscript)` for example, and remove all the document comments. |
09:29:58 | federico3 | it should be relatively simple, look at https://github.com/FedericoCeratto/nimfmt/blob/master/nimfmt.nim#L154 |
09:32:11 | PMunch | Yeah that's what I was looking at earlier |
09:37:55 | * | disruptek quit (Ping timeout: 265 seconds) |
09:37:56 | * | terps joined #nim |
09:38:35 | * | disbot quit (Ping timeout: 260 seconds) |
09:41:17 | * | disruptek joined #nim |
09:41:44 | * | disbot joined #nim |
09:55:48 | * | mal`` quit (Ping timeout: 265 seconds) |
09:56:33 | * | mal`` joined #nim |
09:57:15 | * | supakeen quit (Ping timeout: 265 seconds) |
09:57:15 | * | nisstyre quit (Ping timeout: 265 seconds) |
09:58:58 | * | nisstyre joined #nim |
09:59:14 | * | supakeen joined #nim |
10:07:17 | * | Senketsu quit (Ping timeout: 260 seconds) |
10:14:02 | endragor | Does Nim's GC actually use acyclic pragma and try to determine whether types may produce ref cycle in general? I'd think it would iterate only through types whose children may produce cycles in mark and sweep phase, but it seems to iterate everything. |
10:20:05 | endragor | Yeah I guess vanilla mark and sweep just requires to iterate through everything and there is no way around it |
10:32:54 | * | Senketsu joined #nim |
10:34:42 | * | terps quit (Ping timeout: 260 seconds) |
10:35:11 | * | terps joined #nim |
10:40:16 | * | krux02 joined #nim |
10:57:40 | * | Senketsu quit (Ping timeout: 265 seconds) |
11:08:15 | * | dadada quit (Ping timeout: 256 seconds) |
11:09:10 | * | dadada joined #nim |
11:09:34 | * | dadada is now known as Guest94642 |
11:14:35 | * | sz0 joined #nim |
11:14:59 | * | krux02 quit (Remote host closed the connection) |
11:21:18 | * | haxscramper joined #nim |
11:23:42 | * | tane joined #nim |
11:40:56 | * | rockcavera joined #nim |
11:43:32 | * | terps quit (Ping timeout: 260 seconds) |
11:44:17 | * | terps joined #nim |
11:53:15 | * | dddddd joined #nim |
11:53:53 | * | zedeus quit (Ping timeout: 246 seconds) |
11:59:37 | PMunch | https://play.nim-lang.org/#ix=2ogb |
11:59:53 | PMunch | Little command line parser I threw together ^ |
12:03:14 | alehander92 | col! |
12:03:16 | alehander92 | cool* |
12:04:44 | PMunch | It was inspired by exelotls post here: https://forum.nim-lang.org/t/6396 |
12:05:52 | * | Vladar joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:34 | * | supakeen joined #nim |
12:07:48 | alehander92 | i dont know man |
12:07:59 | alehander92 | maybe: but if we look at programming languages as tools |
12:08:11 | alehander92 | it sounds a bit to me like lets have just one database |
12:08:16 | alehander92 | or just one other thing |
12:08:35 | alehander92 | it seems normal to have many syntaxes/languages |
12:11:33 | PMunch | Oh yeah, I wasn't really all that interested in the argument :P I just thought the idea behind the parser was cool, and writing a macro that parsed the string on compile-time was fairly trivial |
12:18:53 | FromDiscord | <Shucks> Any idea how WriteProcessMemory could be used? Currently it fails with error code 299. https://play.nim-lang.org/#ix=2ogj |
12:21:57 | PMunch | Hmm, I think you'd need `cast[pointer](data.unsafeAddr)` |
12:22:36 | PMunch | Is that error code defined anywhere? |
12:23:35 | alehander92 | wow |
12:23:40 | alehander92 | i can't believe windows works like this |
12:23:49 | alehander92 | https://superuser.com/questions/1522335/why-does-windows-allow-you-to-read-and-write-another-process-memory |
12:24:08 | alehander92 | i mean, it makes sense, but maybe i didn't realize that |
12:24:12 | FromDiscord | <Shucks> sent a code paste, see http://ix.io/2ogo |
12:25:35 | Zevv | alehander92, how is that different from other OS's, like, you know, linux, for example? |
12:25:59 | PMunch | Hmm, I'm guessing that the place you're writing to is too small. What type are you actually trying to write? |
12:26:32 | alehander92 | zevv, well, can i just read/write from memory of other process-es on linux? |
12:26:35 | Zevv | sure |
12:26:43 | Zevv | how do you think gdb works? |
12:26:52 | alehander92 | by starting it |
12:27:05 | FromDiscord | <Shucks> At the moment just a float32 `p.write(glowIndexPointer + 4, 255.0.float32)` |
12:27:20 | alehander92 | i probably assume if a process starts another process, it can have more rights for it |
12:27:25 | PMunch | And are you sure that SIZE_T is int32 on your system? If you're on a 64bit machine it should be int64 |
12:27:27 | alehander92 | not sure tho |
12:27:40 | alehander92 | but yeah gdb can attach to an existing one |
12:27:41 | PMunch | @Shucks, what is that +4? |
12:27:41 | Zevv | no, you can attach: gdb -p <pid> |
12:27:47 | Zevv | it does a ptrace call |
12:27:49 | alehander92 | using ptrace |
12:27:55 | alehander92 | yeah strace can also attach |
12:28:02 | Zevv | strace uses ptrace as well |
12:28:05 | alehander92 | yeah |
12:28:07 | Zevv | it's the same mechanism |
12:28:17 | alehander92 | so, all right |
12:28:36 | FromDiscord | <Shucks> Just a offset to get the right address. Size_t is int32 yea |
12:29:02 | alehander92 | that puts "any random script might be a hack" in more real terms |
12:29:20 | alehander92 | so why dont we all use sandbox-ed systems with different permission models |
12:30:06 | alehander92 | one can block many of those syscalls on theory , right |
12:31:53 | * | tiorock joined #nim |
12:31:53 | * | tiorock quit (Changing host) |
12:31:53 | * | tiorock joined #nim |
12:31:53 | * | rockcavera quit (Killed (card.freenode.net (Nickname regained by services))) |
12:31:53 | * | tiorock is now known as rockcavera |
12:31:56 | PMunch | @Shucks, did you try the .unsafeAddr thing I suggested? You should also be able to use "csize_t" as the type by the way |
12:32:14 | alehander92 | ok, so it seems that's what `firejail` does |
12:32:23 | alehander92 | still a bit weird it's not more common place |
12:32:29 | * | lbart_ joined #nim |
12:33:00 | alehander92 | i cant understand all that focus on https/etc when we just run all of your programs together without much protection |
12:33:04 | * | haxscram` joined #nim |
12:33:24 | alehander92 | *alehander92 finds out how os-es work ep.7" |
12:33:31 | * | disruptek_ joined #nim |
12:35:07 | * | njoseph_ joined #nim |
12:35:39 | * | lbart quit (Disconnected by services) |
12:36:07 | * | lbart_ is now known as lbart |
12:36:40 | * | tribly quit (Ping timeout: 246 seconds) |
12:36:40 | * | njoseph quit (Ping timeout: 246 seconds) |
12:36:40 | * | dv^_^ quit (Ping timeout: 246 seconds) |
12:36:40 | * | Guest94642 quit (Ping timeout: 246 seconds) |
12:36:40 | * | FromDiscord quit (Ping timeout: 246 seconds) |
12:36:41 | * | Lord_Nightmare quit (Ping timeout: 246 seconds) |
12:36:46 | * | disruptek quit (Ping timeout: 264 seconds) |
12:36:46 | * | Zevv quit (Ping timeout: 264 seconds) |
12:36:46 | * | tane quit (Ping timeout: 264 seconds) |
12:36:46 | * | haxscramper quit (Ping timeout: 264 seconds) |
12:36:46 | * | Trustable quit (Ping timeout: 264 seconds) |
12:36:47 | * | so quit (Ping timeout: 264 seconds) |
12:36:47 | * | Amun_Ra quit (Ping timeout: 264 seconds) |
12:36:47 | * | Zevv joined #nim |
12:36:47 | * | dv^_^_ joined #nim |
12:36:53 | * | dadada joined #nim |
12:36:54 | * | Zevv quit (Changing host) |
12:36:54 | * | Zevv joined #nim |
12:37:06 | * | FromDiscord joined #nim |
12:37:07 | alehander92 | ok so /proc/sys/kernel/yama/ptrace_scope |
12:37:10 | alehander92 | is what i want |
12:37:11 | * | Trustable joined #nim |
12:37:21 | * | tribly joined #nim |
12:37:21 | * | so joined #nim |
12:37:29 | * | tane joined #nim |
12:37:31 | * | Lord_Nightmare joined #nim |
12:37:32 | * | dadada is now known as Guest42240 |
12:37:38 | * | zedeus joined #nim |
12:38:23 | * | Amun_Ra joined #nim |
12:38:45 | Zevv | you use yama? |
12:38:46 | * | PMunch quit (Ping timeout: 256 seconds) |
12:39:20 | alehander92 | no idea? |
12:39:31 | alehander92 | i just copy pasted it and it seems to exist on my system |
12:45:04 | * | dcmertens joined #nim |
12:45:15 | dcmertens | I have a question that arose using c2nim |
12:45:15 | * | kungtotte quit (Read error: Connection reset by peer) |
12:45:38 | dcmertens | It creates new type definitions for me, which is great |
12:45:58 | dcmertens | Problem is, the C code defines structs, but refers to the structs by pointers always |
12:46:14 | * | kungtotte joined #nim |
12:46:19 | dcmertens | so I feel as though my Nim types should be ref types |
12:46:37 | dcmertens | Instead I get value types, with the {.bycopy.} pragma |
12:46:50 | dcmertens | my question is: what do I do with these types? |
12:46:57 | * | neceve_ joined #nim |
12:47:02 | dcmertens | is there a good tutorial for using the output of c2nim? |
12:47:21 | dcmertens | Another question: how do I create Nim typedefs for function pointers? |
12:47:44 | dcmertens | scratch that last question |
12:48:17 | dcmertens | I'll come back to that later |
12:50:05 | * | filcuc joined #nim |
12:50:10 | * | neceve joined #nim |
12:52:20 | * | Vladar quit (Quit: Leaving) |
12:52:39 | * | PMunch joined #nim |
12:52:40 | dcmertens | Having found and read the manual's discussion of bycopy and byref pragmas, I think I need to see these in action |
12:53:50 | dcmertens | Is there any way to search the Nim playground for code examples? |
12:57:57 | dcmertens | OK, the SDL2 wrapper gives me something to work with: https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L66 |
12:59:50 | dcmertens | and here is the corresponding C header: https://github.com/emscripten-ports/SDL2/blob/master/include/SDL_events.h#L509 |
12:59:51 | FromGitter | <kaushalmodi> dcmertens: ⏎ ⏎ > Is there any way to search the Nim playground for code examples? ⏎ ⏎ Playground runs and renders snippets from ix.io links. So I doubt that those are searchable [https://gitter.im/nim-lang/Nim?at=5ed8f047a3a1b13679c85dff] |
12:59:57 | FromGitter | <kaushalmodi> But you can always search GitHub |
13:00:10 | * | filcuc quit (Quit: Konversation terminated!) |
13:00:53 | dcmertens | kaushalmodi, thanks. I am trying to figure out what is (at least somewhat) idiomatic, and my findings above for SDL2 show that neither the byvalue or byref pragmas are really needed |
13:01:21 | * | dcmertens wonders if any of this kind of thing is in the c2nim docs |
13:01:57 | dcmertens | aha, c2nim doesn't have a man page |
13:02:02 | dcmertens | what is nim's equivalent of perldoc? |
13:02:05 | * | naught-fowl joined #nim |
13:02:36 | FromGitter | <kaushalmodi> https://nim-lang.github.io/Nim/theindex.html ? |
13:02:51 | FromGitter | <kaushalmodi> It's helpful to bookmark that and just Ctrl+F in there |
13:03:09 | FromGitter | <kaushalmodi> or use the Search from any of the manual/stdlib pages |
13:06:04 | * | zacharycarter joined #nim |
13:06:44 | * | dcmertens checks it out |
13:06:58 | dcmertens | oh my |
13:10:36 | FromGitter | <sheerluck> This is why Araq uses Windows 10 -- https://www.youtube.com/watch?v=cZN5n6C9gM4 |
13:15:39 | Zevv | do you have a summary that does not cost me 1:13:06 of my life? |
13:15:59 | FromGitter | <kaushalmodi> dcmertens: That theindex.html is mentioned as Searchable Index on https://nim-lang.org/documentation.html |
13:16:14 | dcmertens | Zevv++ |
13:16:22 | FromDiscord | <Shucks> > Hmm, I think you'd need `cast[pointer](data.unsafeAddr)`↵@PMunch[IRC]#0000 fixed it btw. |
13:16:22 | FromGitter | <sheerluck> Zevv I still only 49 min in :( |
13:16:45 | PMunch | Zevv, haven't you seen any of Bryans earlier talks? |
13:17:12 | * | couven92 joined #nim |
13:18:39 | Zevv | I don't know the guy, but I can see where he's going :) |
13:18:50 | * | couven92 is now known as fredrikhr |
13:19:51 | * | naught-fowl quit (Remote host closed the connection) |
13:20:22 | PMunch | He has videos back to like 2013 about this. Basically listing reasons that Linux sucks, and then ending by explaining why it is actually awesome |
13:21:19 | dcmertens | I moused through the video and read the slides. It feels a lot more like a subversive call to action. I like it. :-) |
13:21:51 | FromDiscord | <Rika> how do i return an async function early? |
13:21:59 | FromDiscord | <Rika> im not sure what im doing lmao |
13:23:21 | PMunch | @Rika, what do you mean? |
13:23:40 | alehander92 | it should just work |
13:23:47 | FromDiscord | <Rika> a bare return? |
13:24:07 | alehander92 | iirc yes |
13:24:07 | FromDiscord | <Rika> its giving me that it yielded nil |
13:24:17 | alehander92 | ok are you using a template! |
13:24:26 | FromDiscord | <Rika> is it not possible with a template? |
13:24:49 | alehander92 | its .. complicated |
13:24:55 | PMunch | Nope.. The current implementation looks through the AST and replaces "return" with whatever it needs to return |
13:25:01 | alehander92 | try `return result` |
13:25:06 | alehander92 | yeah i am not sure how to fix |
13:25:20 | alehander92 | i think i added `earlyReturn` in my own patch |
13:26:05 | PMunch | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/asyncmacro.nim#L110 |
13:26:21 | PMunch | This is basically what it does, replace "return" with some stuff |
13:26:28 | alehander92 | maybe some kind for `for ` with break works? |
13:26:44 | PMunch | What you can do is wrap your body in a block and then break that block from within the template, that should work. |
13:26:47 | alehander92 | but yeah hard to do from another template |
13:27:56 | FromDiscord | <Rika> pain. |
13:28:23 | alehander92 | it's annoying, sorry |
13:29:09 | PMunch | https://play.nim-lang.org/#ix=2ogK |
13:29:15 | PMunch | Something like that ^ |
13:31:06 | alehander92 | thats smart |
13:31:15 | alehander92 | maybe async should generate a block |
13:31:17 | alehander92 | always |
13:31:23 | alehander92 | and name it with some kind of reserved name |
13:31:33 | alehander92 | like nimAsyncBlock |
13:31:42 | PMunch | I think I added something like that to Jester |
13:31:45 | PMunch | It had the same issue |
13:32:00 | alehander92 | so one can write a template which directly does it .. but a template cant return just `break stuff` |
13:32:09 | alehander92 | which is strange |
13:32:15 | alehander92 | maybe a macro can |
13:32:43 | PMunch | Something like this works: https://play.nim-lang.org/#ix=2ogN |
13:32:47 | alehander92 | we should RFC this somewhere |
13:33:08 | PMunch | What do you mean it can't just return that? It works jut fine.. |
13:33:30 | alehander92 | ah ok |
13:33:32 | alehander92 | i thought it cant |
13:38:01 | FromDiscord | <Shucks> Me again. What do I have to do if I want to make the data param flexible to accept arrays and single data types aswell? https://play.nim-lang.org/#ix=2ogP |
13:39:44 | PMunch | Uhm, that doesn't look right.. |
13:39:49 | PMunch | The array part in particular |
13:39:57 | PMunch | It shouldn't even need special handling.. |
13:41:51 | FromDiscord | <Shucks> ugh yea. |
13:42:03 | FromDiscord | <Shucks> p.write(glowIndexPointer + 4, [255.0.float32, 0.0, 0.0, 1.3]) |
13:42:07 | FromDiscord | <Shucks> that works already. Thanks lol |
14:01:03 | * | rockcavera quit (Remote host closed the connection) |
14:12:25 | * | waleee-cl joined #nim |
14:42:35 | * | terps quit (Ping timeout: 246 seconds) |
14:45:39 | * | theelous3 joined #nim |
14:46:33 | * | dcmertens quit (Remote host closed the connection) |
14:48:55 | * | brainproxy quit (Quit: WeeChat 2.8) |
14:59:39 | * | bung quit (Ping timeout: 260 seconds) |
15:10:08 | * | Vladar joined #nim |
15:18:10 | * | aeverr quit (Quit: Konversation terminated!) |
15:25:25 | * | endragor quit (Remote host closed the connection) |
15:25:53 | * | endragor joined #nim |
15:30:18 | * | PMunch quit (Quit: leaving) |
15:36:11 | * | dcmertens joined #nim |
15:36:30 | * | endragor quit (Ping timeout: 244 seconds) |
15:36:50 | dcmertens | when declaring an object type layout, can I specify two elements on the same line |
15:37:05 | dcmertens | for example, if X and Y are coordinates, both of type double |
15:37:41 | dcmertens | er, sorry, both of type float |
15:41:48 | * | kenran quit (Ping timeout: 256 seconds) |
15:46:53 | * | bung joined #nim |
15:50:19 | * | terps joined #nim |
15:57:17 | * | terps quit (Quit: WeeChat 2.8) |
16:00:44 | FromDiscord | <Recruit_main707> can you wrap a cpp class in nim? |
16:00:59 | FromDiscord | <Recruit_main707> and if thats a yes, can you use it in the c backend? |
16:07:58 | * | bung quit (Ping timeout: 265 seconds) |
16:08:10 | FromDiscord | <Rika> dcmertens: uh, what? |
16:08:36 | FromDiscord | <Rika> so like `type X = object\n x, y: float`? |
16:08:36 | FromDiscord | <Rika> yes |
16:11:20 | dcmertens | Rika, yes, and thank you! |
16:11:40 | dcmertens | I apologize for being lazy and not just trying it. :-/ |
16:12:01 | FromDiscord | <Rika> lol i mean thats fine |
16:25:37 | * | endragor joined #nim |
16:34:12 | * | endragor quit (Ping timeout: 256 seconds) |
16:50:55 | * | endragor joined #nim |
16:55:28 | * | endragor quit (Ping timeout: 256 seconds) |
16:58:57 | * | Jjp137 joined #nim |
17:01:53 | * | endragor joined #nim |
17:01:57 | * | bung joined #nim |
17:03:17 | arecaceae | what's best again to allocate a bytebuffer of dynamical size for use with io.readBuffer ? |
17:06:03 | FromDiscord | <zetashift> If I have a `Character` which has, for example, 2 states defined as an Enum, and a `Player` type which inherits from `Character` but needs to have 4 states, am I better off maybe moving possible `State`s in a seperate file and then building a `Player` from a a few of those `State`s? |
17:06:51 | FromDiscord | <zetashift> Basically what would be the Nim way to model the Character and Player that inherits states from it, I'm using Godot so I'm kind of forced to use single inheritance |
17:07:11 | * | silvernode joined #nim |
17:07:17 | * | endragor quit (Ping timeout: 260 seconds) |
17:09:35 | * | endragor joined #nim |
17:14:38 | * | Jjp137 quit (Read error: Connection reset by peer) |
17:16:23 | * | endragor quit (Ping timeout: 260 seconds) |
17:17:01 | disruptek_ | ~experimental is Features of Nim that are to be considered experimental are documented at https://nim-lang.org/docs/manual_experimental.html |
17:17:02 | disbot | experimental: 11Features of Nim that are to be considered experimental are documented at https://nim-lang.org/docs/manual_experimental.html |
17:19:28 | * | Jjp137 joined #nim |
17:21:43 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
17:21:45 | * | endragor joined #nim |
17:28:37 | * | endragor quit (Ping timeout: 258 seconds) |
17:31:40 | * | bung quit (Ping timeout: 256 seconds) |
17:32:15 | * | endragor joined #nim |
17:32:27 | * | rockcavera joined #nim |
17:42:30 | * | endragor quit (Ping timeout: 256 seconds) |
17:51:19 | * | letto quit (Quit: Konversation terminated!) |
17:51:54 | * | Trustable quit (Remote host closed the connection) |
17:53:09 | * | lritter quit (Ping timeout: 258 seconds) |
17:54:16 | * | Zevv quit (Quit: leaving) |
17:54:26 | * | Zevv joined #nim |
17:54:26 | * | Zevv quit (Changing host) |
17:54:26 | * | Zevv joined #nim |
17:56:43 | * | Jesin quit (Quit: Leaving) |
17:58:17 | * | Jesin joined #nim |
18:01:54 | FromDiscord | <Shucks> Are there some real nim ide's yet? vsc feels laggy and weird tbh |
18:03:13 | FromDiscord | <Recruit_main707> visual studio support could be easily updated to work with latest version i think, and intellij has lsp support so *theorically* (because i havent been able to do it) it could also work |
18:03:36 | FromDiscord | <Recruit_main707> but currently working, vscode is the best |
18:04:16 | FromDiscord | <Shucks> Alright |
18:04:48 | * | PMunch joined #nim |
18:06:43 | FromDiscord | <Recruit_main707> can i easily change the types of a function from inside a macro so that it converts them into their compatible representation (if existent)?↵So that for example: `proc function(a: int): string`↵is converted to `proc function(a: cint): cstring` |
18:07:24 | FromDiscord | <Recruit_main707> by easily i mean substituting them in the proc's ast directly |
18:07:35 | disruptek_ | of course. |
18:07:37 | disruptek_ | but why? |
18:08:19 | FromDiscord | <Recruit_main707> my lazyness has no limit |
18:08:49 | FromDiscord | <Recruit_main707> (and i want to gain some experience with macros) |
18:10:27 | * | Jjp137 quit (Read error: Connection reset by peer) |
18:13:03 | * | Jjp137 joined #nim |
18:17:39 | FromDiscord | <zetashift> Vim with leorize's nvim plugin also works excellent, couldn't get it to work on Windows tho |
18:17:49 | FromDiscord | <Rika> i dont think you even need to do that recruit |
18:18:51 | * | endragor joined #nim |
18:24:09 | * | letto joined #nim |
18:29:10 | FromDiscord | <waghanza> hi,↵could someone help me on https://github.com/the-benchmarker/web-frameworks/pull/2857#issuecomment-639022118↵I can compile, but I have `could not load: libpcre.so(.3|.1|)` on **alpine** |
18:29:10 | disbot | ➥ [Nim] Add akane |
18:32:14 | * | endragor quit (Ping timeout: 240 seconds) |
18:33:00 | FromDiscord | <Rika> do you have pcre installed |
18:34:07 | * | D_ quit (Ping timeout: 240 seconds) |
18:36:55 | * | disruptek_ is now known as disruptek |
18:37:42 | FromDiscord | <KrispPurg> sent a code paste, see http://ix.io/2oi8 |
18:38:00 | * | D_ joined #nim |
18:40:47 | * | tiorock joined #nim |
18:40:47 | * | rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
18:40:47 | * | tiorock is now known as rockcavera |
18:41:01 | FromDiscord | <waghanza> @Rika yes↵@KrispPurg I have the same thing |
18:41:11 | FromDiscord | <waghanza> I'm trying to test https://github.com/Ethosa/akane |
18:42:07 | * | kenran joined #nim |
18:42:50 | * | D_ quit (Ping timeout: 256 seconds) |
18:44:26 | * | fredrikhr quit (Ping timeout: 246 seconds) |
18:44:39 | FromDiscord | <Rika> @KrispPurg ive observed that to only happen on windows |
18:45:25 | FromDiscord | <KrispPurg> huh. |
18:46:05 | * | D_ joined #nim |
18:47:45 | * | silvernode quit (Quit: Leaving) |
18:47:52 | FromDiscord | <Kiloneie> Has noone noticed how badly this search looks on dark mode ? https://media.discordapp.net/attachments/371759389889003532/718174195397427331/unknown.png |
18:49:08 | PMunch | Ouch.. |
18:49:51 | FromDiscord | <Rika> i have |
18:49:57 | FromDiscord | <Rika> but i dont use search that often anymore |
18:49:59 | FromDiscord | <Rika> so yeah |
18:50:39 | FromDiscord | <willyboar> @waghanza this example don't work neither on mac |
18:52:07 | FromDiscord | <willyboar> @Kiloneie looks awful |
18:54:06 | FromDiscord | <waghanza> I've tested on `linux` and `osx` |
18:54:33 | FromDiscord | <KrispPurg> you still got the same error from linux and osx? |
18:54:49 | FromDiscord | <KrispPurg> @waghanza |
18:55:09 | FromDiscord | <Kiloneie> this will burn people's eyes on my next video... oh well |
18:55:19 | FromDiscord | <waghanza> the `SIGSEGV: Illegal storage access.` yes |
18:55:26 | FromDiscord | <KrispPurg> I use ctrl+f anyways |
18:55:35 | FromDiscord | <KrispPurg> I see. |
18:56:21 | FromDiscord | <Kiloneie> il show both, go away from search box quickly |
18:56:48 | FromDiscord | <Kiloneie> how does it look on other oses ? |
18:57:33 | FromDiscord | <willyboar> I remember.... probably is the asynchttpserver bug |
18:57:58 | FromDiscord | <KrispPurg> I wonder if anyone has made an issue about this in the Nim github. |
18:58:15 | FromDiscord | <willyboar> it is fixed already in the devel |
18:58:36 | FromDiscord | <willyboar> it is included in the 1.2.2 |
18:58:50 | FromDiscord | <willyboar> let me try with 1.0.4 to be sure |
18:59:51 | FromDiscord | <KrispPurg> I hope it's either fixed in all OSs. |
19:00:41 | * | neceve_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:01:15 | * | neceve_ joined #nim |
19:03:04 | FromDiscord | <willyboar> yeap it works on 1.0.4 except of the post i think |
19:04:14 | FromDiscord | <KrispPurg> wdym by post? |
19:06:03 | FromDiscord | <willyboar> I am talking for the akane example @waghanza posts. Ethosa's example with sendPlaintext don't work at all |
19:06:09 | FromDiscord | <Kiloneie> I have a question, would it be okay to use my current thumbnail i use for my nim video series, change the name and change the birghtness or color slightly for another series for nim ? I didn't make my thumbnail, can't make another one of a whip D:... |
19:06:16 | FromDiscord | <KrispPurg> ah. |
19:07:13 | * | waleee-cl joined #nim |
19:15:11 | * | kenran quit (Ping timeout: 258 seconds) |
19:15:49 | FromDiscord | <Yardanico> @Kiloneie search is fixed in devel |
19:16:52 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/13972 |
19:16:53 | disbot | ➥ Docs Search `Results` box styling is not Dark Mode Friendly |
19:17:35 | FromDiscord | <Yardanico> And will be fixed in 1.2.2 |
19:18:18 | PMunch | @Yardanico, did you see that I found a bug in the edit thing in the bot earlier? |
19:19:36 | FromDiscord | <Yardanico> Sorry, missed it. You mean with context? I know the edit diffing is broken when you insert in the middle or something like that |
19:19:39 | FromDiscord | <Yardanico> Like this |
19:19:45 | FromDiscord | <Yardanico> (edit) 'Like ... this' => 'Likeedit' |
19:20:44 | FromDiscord | <KrispPurg> Is it a bug in the module? |
19:20:53 | FromDiscord | <KrispPurg> (edit) 'module?' => 'module you are using?' |
19:20:55 | FromDiscord | <Yardanico> ? |
19:20:56 | FromDiscord | <Yardanico> No |
19:21:07 | FromDiscord | <Yardanico> It's a bug in my edit diffing |
19:21:29 | FromDiscord | <Yardanico> Because it's not an obvious thing to do, there are different slices and stuff |
19:21:36 | FromDiscord | <willyboar> @KrispPurg the bug with asynchttpserver i think is backported |
19:22:02 | FromDiscord | <KrispPurg> I see. |
19:24:19 | FromDiscord | <Yardanico> Yes it is |
19:25:19 | FromDiscord | <waghanza> > I am talking for the akane example @waghanza posts. Ethosa's example with sendPlaintext don't work at all↵@willyboar yes, I've seen that, so I use `post` |
19:25:31 | FromDiscord | <waghanza> (edit) '`post`' => '`send` macro' |
19:30:15 | FromDiscord | <willyboar> @waghanza you must edit the yaml file. 😛 |
19:31:18 | FromDiscord | <waghanza> ? |
19:31:38 | FromDiscord | <willyboar> you are still have jester in the yaml file |
19:31:50 | * | Vladar quit (Quit: Leaving) |
19:31:52 | FromDiscord | <waghanza> ah, thx good catch 🎉 |
19:42:41 | * | Jesin quit (Quit: Leaving) |
19:47:44 | PMunch | Is there a way to nest iterators and yield the outer one from the inner one? |
19:47:49 | * | Jesin joined #nim |
19:52:54 | * | dcmertens quit (Ping timeout: 240 seconds) |
19:52:57 | Zevv | you keep trying, eh |
19:53:08 | PMunch | You know it |
19:53:15 | Zevv | I've been there, but I gave up |
19:53:21 | PMunch | I realised that this Fiber idea is actually pretty neat |
19:53:31 | Zevv | dump my your url again |
19:53:55 | PMunch | http://ix.io/2oby |
19:53:59 | Zevv | I might follow up on this because I'm on a motivation rollercoaster with this CPS stuff |
19:54:53 | PMunch | I realised that you can implement producer/consumer patterns with it as well |
20:06:54 | Zevv | I think the 'pool of parallel things' is not the use case that people are looking for, other patterns make more sense indeed |
20:07:03 | Zevv | produced/consumer, async IO |
20:08:23 | PMunch | That's the nice thing with Fibers, since you have more control over the flow you can do different things with them |
20:08:31 | Zevv | right |
20:08:42 | PMunch | Still not 100% sure how I'd do async IO though |
20:09:51 | Zevv | start with that :) |
20:10:44 | Zevv | you can borrow my tiny event loop: https://github.com/zevv/nimcoro/blob/master/eventqueue.nim :) |
20:13:12 | PMunch | I've already looked at that :) |
20:13:31 | PMunch | Basically it would be up to the event loop to support it |
20:13:37 | PMunch | It wouldn't be a feature of Fibers itself |
20:13:44 | Zevv | surely not |
20:13:45 | PMunch | itself/themselves |
20:13:49 | Prestige | o/ |
20:14:37 | Zevv | you don't want anything entwined with anything pumping your fibers |
20:14:42 | Zevv | just the building blocks |
20:14:43 | Araq | Zevv, do you need assistance for CPS? |
20:15:12 | Zevv | Araq: I'm not sure, but I'm not making large steps |
20:15:16 | PMunch | I mean you could always register a Fiber that did a poll to see if it was done and yielded otherwise. |
20:15:39 | Araq | tried .partial objects and .liftlocals? |
20:15:58 | Zevv | My plan was to make a proof of concept in macros, just for the sake of easier development then going into the compiler straight away. Can only transform a subset of nim from there, but should be good enough to get the hang of it. |
20:16:29 | Araq | compiler exposes some support via the undocumented pragmas that I mentioned |
20:16:37 | Zevv | yeah, but that's not for use in macros, right |
20:16:54 | Araq | the macro can emit the annotations |
20:17:32 | Zevv | ok, I will have to look into taht - but I didn't properly get into the lifting yet, my problem is in the splitting part still |
20:17:48 | Zevv | it's not really trivial, there's a lot of corner cases which are not explicit in the papers |
20:18:11 | Zevv | honestly, I'm not sure if I'll get there in the end |
20:18:35 | Zevv | and my motivation goes up and down three times a day, also due to other reasons in life |
20:19:38 | PMunch | Oh well, I'm off to bed |
20:19:44 | FromDiscord | <Kiloneie> sent a long message, see http://ix.io/2oiZ |
20:19:44 | Zevv | slep tight |
20:21:03 | Araq | and the splitting yeah. |
20:21:20 | Araq | I can imagine it's harder than it looks :-) |
20:21:45 | Araq | the paper mentions you have to make the gotos explicit, even the "fall through" gotos |
20:22:43 | Zevv | yeah, but I'm still not sure if it can be done without this step |
20:22:59 | Zevv | so my plan was to make a collection of basic patterns and their transformations |
20:23:08 | Araq | why try without this step? |
20:23:37 | Zevv | it feels very awkward somehow - I have the nagging feeling that it can be done depth first recursive as well |
20:23:54 | * | narimiran quit (Ping timeout: 240 seconds) |
20:23:58 | Zevv | but then again - if that was the case, why did the author not do it like that |
20:24:11 | Zevv | I'd like to have a good talk with the guy and ask him some questions I guess |
20:24:39 | Araq | usually 'break' and 'return' cause troubles for simple recursive traversals |
20:25:16 | Zevv | fair enough - probably one of the reasons 'break' is bothering me as well |
20:26:06 | Araq | I don't complain all day long about "unstructured control flow" because I'm a zealot |
20:26:24 | Araq | I complain because it makes everything harder |
20:26:40 | * | Zevv quit (Quit: Lost terminal) |
20:26:55 | * | Zevv joined #nim |
20:27:00 | Zevv | oops sorry dropped out |
20:27:40 | Zevv | I'm also not sure yet if implicit control flow like 'and' expressions need work. `if a() and b():` - don't run b() if a() is false, so does that need rewriting and gotos? |
20:28:18 | Zevv | I've tried to look into the cpc implementation, but it's not exactly trivial |
20:29:32 | Araq | 'and' is simple, don't allow yield points between the expressions |
20:29:58 | Zevv | hmm ok |
20:30:51 | Prestige | Anyone know why the X11 wrappers have a `T` prefix for types? Seems odd |
20:31:03 | Prestige | Asking because I'm writing a wrapper for Xft but haven't been including that prefix |
20:31:26 | Zevv | anyway, I think I do have a proper grasp of CPS itself and do see what it could bring, but the actual work to get there is harder then I thought it would be. I figured that the manual translations still had a lot of "intutiton" going on :) |
20:31:43 | * | PMunch quit (Quit: leaving) |
20:33:36 | Araq | Prestige, legacy from the days we had a T type prefix |
20:34:27 | Prestige | Would it be a breaking change to remove them or should I include them for xft? |
20:34:31 | Araq | Zevv, maybe it helps if the first version only supports a subset and produces a reasonable error for too complex stuff |
20:35:00 | Araq | Prestige, yeah but it's fine, we can release a version 2.0, semver ftw |
20:35:14 | Prestige | sweet |
20:35:50 | FromDiscord | <Rika> i dont know if ara q is sarcastic about the ftw but i kinda feel it |
20:36:24 | Zevv | Araq: that is what I'm aiming at. So no for loops, just basic while/if control flow |
20:37:01 | Zevv | just saying: if you want this to go fast, you might not want to wait for me :) |
20:39:51 | FromDiscord | <Technisha Circuit> How would i get the name of a proc as a string? In Python you do `function.__name__| |
20:39:56 | FromDiscord | <Technisha Circuit> (edit) '`function.__name__|' => '`function.__name__`' |
20:40:52 | FromDiscord | <Rika> you can only get it on compile time |
20:41:27 | FromDiscord | <Rika> actually, what's the point? |
20:41:57 | Zevv | handy for logging |
20:42:32 | Zevv | I'd love __FILE__ __FUNCTION__ __LINE__ equivalents in Nim |
20:44:40 | FromDiscord | <Rika> hmm makes sense |
20:51:57 | Araq | Zevv, there are ways to get them but only Timothee knows how to |
20:52:03 | FromDiscord | <Recruit_main707> are there any `memfiles` examples? |
20:53:09 | Yardanico | @Technisha https://github.com/nim-lang/Nim/issues/8212 |
20:53:11 | disbot | ➥ we need a standard way to get name of procedure ; snippet at 12https://play.nim-lang.org/#ix=25Yt |
20:53:22 | Yardanico | https://stackoverflow.com/a/51198228 this one is C(C++/ObjC)-backend specific |
20:53:26 | Araq | "blah, wah C++ templates are Turing complete", oops, https://releases.llvm.org/8.0.0/tools/clang/docs/UsersManual.html#cmdoption-ftemplate-depth |
20:53:29 | Yardanico | answer by timo :P |
21:20:58 | FromDiscord | <Technisha Circuit> Thanks Yardanico! |
21:23:35 | * | neceve_ quit (Ping timeout: 265 seconds) |
21:32:29 | * | haxscram` quit (Remote host closed the connection) |
21:47:07 | * | NimBot joined #nim |
21:47:08 | * | inv2004 joined #nim |
21:54:03 | stefantalpalaru | What's that define for getting verbose output from dlopen()? |
21:56:20 | inv2004 | Hello, how can I get type from NimNode in macro? https://play.nim-lang.org/#ix=2ojs |
21:56:37 | Yardanico | stefantalpalaru: -d:nimDebugDlOpen iirc |
21:56:50 | Yardanico | inv2004: NimNodes don't have a type |
21:56:55 | Yardanico | symbols have a type |
21:57:01 | Yardanico | well if NimNode is a symbol it has a type |
21:57:26 | stefantalpalaru | Thanks, Yardanico. |
21:57:40 | inv2004 | I am confused, can I have typedesc == string from SVal "string" ? |
21:58:40 | inv2004 | s/SVal/StrLit/ |
21:59:29 | arecaceae | what's best again to allocate a bytebuffer of dynamical size for use with io.readBuffer ? |
21:59:57 | arecaceae | I guess I used to do a newSeq and pass the addr of the first element ? |
22:00:29 | FromDiscord | <Recruit_main707> inv2004: is this what you want?↵https://play.nim-lang.org/#ix=2kZd |
22:02:27 | inv2004 | Recruit_main707, no, because I have proc which do typedesc => Kind conversion. You do string => Kind, I can also do it, but want to reuse proc with typedesc mapping |
22:16:15 | inv2004 | Are there any diff if I use proc f[T]() with when T is ... and proc f(T: typedesc) ? |
22:17:43 | * | tane quit (Quit: Leaving) |
22:26:41 | disruptek | balls. |
22:35:27 | * | noonien quit (Ping timeout: 240 seconds) |
22:35:43 | * | msmorgan quit (Ping timeout: 260 seconds) |
22:35:48 | * | waleee-cl quit (Ping timeout: 246 seconds) |
22:35:51 | * | sirn quit (Ping timeout: 272 seconds) |
22:36:18 | * | surma quit (Ping timeout: 256 seconds) |
22:36:30 | * | Hotbees quit (Ping timeout: 272 seconds) |
22:37:04 | * | matti quit (Ping timeout: 244 seconds) |
22:37:07 | * | alehander92 quit (Ping timeout: 272 seconds) |
22:37:08 | * | zielmicha__ quit (Ping timeout: 272 seconds) |
22:37:08 | * | jholland__ quit (Ping timeout: 272 seconds) |
22:37:12 | * | LyndsySimon quit (Ping timeout: 260 seconds) |
22:37:25 | * | r4vi_ joined #nim |
22:37:26 | * | sz0 quit (Ping timeout: 256 seconds) |
22:37:27 | * | ormiret quit (Ping timeout: 240 seconds) |
22:37:28 | * | r4vi quit (Ping timeout: 260 seconds) |
22:37:28 | * | r4vi_ is now known as r4vi |
22:37:45 | * | nikita` quit (Ping timeout: 272 seconds) |
22:37:46 | * | euantor quit (Ping timeout: 272 seconds) |
22:37:46 | * | d10n-work quit (Ping timeout: 272 seconds) |
22:37:46 | * | npgm quit (Ping timeout: 272 seconds) |
22:37:46 | * | waleee-cl joined #nim |
22:37:47 | * | l1x quit (Ping timeout: 260 seconds) |
22:37:47 | * | matlock quit (Ping timeout: 260 seconds) |
22:37:47 | * | rayman22201 quit (Ping timeout: 260 seconds) |
22:37:50 | * | LyndsySimon joined #nim |
22:38:09 | * | jholland__ joined #nim |
22:38:18 | * | bung joined #nim |
22:39:02 | * | l1x joined #nim |
22:39:04 | * | msmorgan joined #nim |
22:39:17 | * | d10n-work joined #nim |
22:40:15 | * | rayman22201 joined #nim |
22:40:22 | * | alehander92 joined #nim |
22:40:23 | * | surma joined #nim |
22:40:42 | * | npgm joined #nim |
22:40:46 | * | euantor joined #nim |
22:40:55 | * | inv2004 quit (Ping timeout: 265 seconds) |
22:41:11 | * | matlock joined #nim |
22:42:23 | * | Hotbees joined #nim |
22:42:35 | * | nikita` joined #nim |
22:42:41 | * | noonien joined #nim |
22:42:47 | * | sz0 joined #nim |
22:49:02 | * | inv2004 joined #nim |
22:51:10 | FromGitter | <codenoid> hi nim folks |
22:51:18 | FromGitter | <codenoid> how you doin |
22:51:57 | * | ormiret joined #nim |
22:51:58 | inv2004 | codenoid, even better than JavaScript! |
22:52:48 | * | matti joined #nim |
22:52:58 | * | bung quit (Ping timeout: 256 seconds) |
22:53:57 | * | zielmicha__ joined #nim |
22:55:57 | FromGitter | <codenoid> 😄 |
22:57:29 | FromDiscord | <willyboar> disruptek: everything ok? |
22:58:00 | stefantalpalaru | Does anyone remember why tlsEmulation is enabled by default on macOS? https://github.com/nim-lang/Nim/blob/c1ca06b4525b12022a5f8368582549e5bb01a438/config/nim.cfg#L172 |
23:03:26 | stefantalpalaru | It was a drive-by change in this unrelated commit: https://github.com/nim-lang/Nim/commit/78f4aacde9e79e9a13b17dc2a3709d5f09a0ae0b |
23:03:55 | * | sirn joined #nim |
23:04:08 | * | inv2004 quit (Quit: Leaving) |
23:15:24 | stefantalpalaru | Maybe an artefact from a time when Apple's Clang didn't support TLS properly? |
23:20:28 | stefantalpalaru | Xcode 8 and later should be fine with a real thread-local storage: https://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports/29929949#29929949 |
23:25:19 | * | FromDiscord quit (Remote host closed the connection) |
23:25:19 | * | FromDiscord joined #nim |
23:27:07 | FromDiscord | <Zachary Carter> I see `os` has `unixToNativePath` but is there anything that converts a non-unix path to a unix path? |
23:33:38 | FromDiscord | <Zachary Carter> it's easy enough to do - like mostly just need to replace `\\` with `/` - but I'm just curious if something already exists... |
23:51:02 | * | Jesin quit (Ping timeout: 260 seconds) |
23:57:15 | * | bung joined #nim |
23:58:36 | * | endragor joined #nim |