00:01:55 | FromDiscord_ | <exelotl> The thing I don't get though |
00:03:11 | FromDiscord_ | <exelotl> a friend added my library as a submodule and it apparently Just Worked https://github.com/IamRifki/CattoCookie |
00:06:13 | * | hax-scramper quit (Read error: Connection reset by peer) |
00:06:28 | * | hax-scramper joined #nim |
00:10:25 | * | CcxWrk joined #nim |
00:11:25 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea0dd2d2bf9ef12699a0fc2] |
00:11:40 | FromGitter | <gogolxdong> does this mean leak memory? |
00:12:28 | * | Trustable quit (Remote host closed the connection) |
00:32:24 | FromGitter | <gogolxdong> Regarding https://github.com/nim-lang/Nim/issues/12952 , is it possible that all c interface leaks memory ? I tried a minimal test with mysql , above is the result, source code as follows: β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea0e2181e3d5e20633a2110] |
00:32:26 | disbot | β₯ Possible memory leak using re ; snippet at 12https://play.nim-lang.org/#ix=2j8A |
00:34:03 | * | ryan__ joined #nim |
00:36:30 | * | ryan_ quit (Ping timeout: 256 seconds) |
00:45:05 | * | hax-scramper quit (Read error: Connection reset by peer) |
00:46:10 | * | hax-scramper joined #nim |
01:06:50 | leorize | @gogolxdong: possibly lost are potentially leaked memory |
01:07:07 | leorize | but if you're testing this with the default gc, you'll need Nim's suppression file to verify |
01:07:17 | leorize | but not all C interface leak memory |
01:07:39 | leorize | iirc re has to leak memory due to how poorly the pcre interface was designed |
01:14:33 | FromGitter | <bung87> what should I noticed when compare string from `TaintedString ` to string ? |
01:14:54 | FromGitter | <bung87> len(cleanHtml) was 6569 β len(cleanExpected) was 6583 |
01:15:09 | leorize | taintedstring is just a concept signifying that the string come from outside |
01:15:29 | FromGitter | <bung87> I use text diff that they are same.I confirmed times. |
01:16:06 | leorize | did you compare the newlines? |
01:16:41 | leorize | CRLF might have turned into LF for example |
01:17:17 | leorize | whatever tool that processed the file might have done that |
01:17:51 | FromGitter | <bung87> oh yeah, that may cause problem, thanks |
01:18:12 | leorize | you're missing 14 chars, so 14 lines? :p |
01:19:41 | FromGitter | <gogolxdong> @leorize I'm using --gc:arc , and what's Nim's suppression file? |
01:19:55 | FromGitter | <bung87> I use stripLineEnd ,still same, I 'll look carefully the source invisible chars |
01:20:04 | leorize | gogolxdong: you're using --gc:arc? are you combining with -d:useMalloc? |
01:20:17 | leorize | you need -d:useMalloc to work with valgrind |
01:20:42 | leorize | https://github.com/nim-lang/Nim/blob/devel/tools/nimgrind.supp |
01:20:59 | leorize | ^ also that's the suppression file for Nim default allocator and gc |
01:22:34 | * | oculux quit (Ping timeout: 240 seconds) |
01:23:12 | * | ryan__ is now known as temporary_monarc |
01:23:18 | * | temporary_monarc is now known as temporarymonarch |
01:23:29 | FromGitter | <gogolxdong> yes, the same result. |
01:25:04 | FromGitter | <gogolxdong> How to use it besides arc and useMalloc? |
01:27:03 | leorize | figured out your problem |
01:27:38 | leorize | it's just valgrind unable to scan libmysqlclient memory so it assume that part is lost :P |
01:27:47 | leorize | we init() mysql but we never deinit() it |
01:27:52 | leorize | not really a problem |
01:31:03 | FromGitter | <gogolxdong> How to confirm re issue is an issue rather than we init but never deinit so valgrind unable to scan the memory? |
01:31:28 | leorize | the re issue isn't an issue |
01:31:52 | leorize | "still reachable" memory meaning that the pointer still exist on the stack |
01:32:05 | leorize | so can still be reached by the program in question |
01:33:36 | leorize | practically it just mean that we alloc-ed then never dealloc at program end, the pointer is still there if manual deallocation is desired, but typically it doesn't make sense since the OS can clean up after us |
01:33:54 | leorize | usually to confirm these issue, just look at the source of those module |
01:34:10 | shashlick | leorize: what was the -d to check that the wrapped structs match the size of C structs? |
01:34:22 | leorize | -d:checkAbi iirc |
01:34:36 | shashlick | there's nothing in the nim code like that |
01:34:41 | * | krux02_ quit (Remote host closed the connection) |
01:35:37 | leorize[m] | https://github.com/nim-lang/Nim/blob/269a458d74e9abbc126d96c506b730c37af0932a/compiler/ccgtypes.nim#L249-L251 |
01:36:26 | shashlick | neat thanks |
01:37:33 | FromDiscord_ | <Elegant Beef> So what's the chances someone here knows the dance and chant to add atoms to the root window with xlib? |
01:51:08 | FromGitter | <gogolxdong> Not everyone knows what you know, it requires some experience and even, more evidences and documents. And for my own further concern, what's the functionality of useMalloc with arc, what if without it ? |
01:51:41 | disruptek | useMalloc uses malloc instead of nim's allocator. |
01:51:43 | Yardanico | with -d:useMalloc nim will use C stdlib's memory allocation functions like malloc() |
01:51:55 | Yardanico | and without it, as disruptek said, it'll use nim's own allocator |
01:52:14 | Yardanico | with -d:useMalloc when nim frees an object its memory is given away to the OS instantly |
01:53:59 | FromGitter | <gogolxdong> both shouldn't leak memory right? Does this imply better useMalloc ? |
01:54:09 | disruptek | nah. |
01:54:22 | Yardanico | no, better use nim's allocator, it knows how to deal with memory in nim programs better than your OS does :) |
01:54:31 | leorize | valgrind is not compatible with nim's allocator :P |
01:54:42 | leorize | Yardanico: to be fair, they are equally good |
01:54:50 | leorize | but nim's allocator is constant time :) |
01:55:36 | shashlick | compileOption() doesn't work for --noNimblePath or --clearNimblePath |
01:57:52 | FromGitter | <gogolxdong> I suspect my server is leaking memory , do you suggest try useMalloc or how to investigate? |
01:58:05 | leorize | does it use async? |
01:58:21 | FromGitter | <gogolxdong> yes, it does. |
01:58:23 | Yardanico | @gogolxdong gc:arc doesn't work with async yet (it leaks memory) |
01:59:38 | FromGitter | <gogolxdong> By async , do you mean async macro literally or whole async solution like waitFor, etc. |
01:59:50 | Yardanico | the whole asyncdispatch |
02:01:19 | * | chemist69 quit (Ping timeout: 272 seconds) |
02:01:26 | FromGitter | <gogolxdong> Won't useMalloc make a difference? |
02:01:30 | Yardanico | it won't really |
02:01:34 | Yardanico | gc:arc can't deal with cycles |
02:02:40 | * | chemist69 joined #nim |
02:02:56 | * | shodan45 quit (Quit: No Ping reply in 180 seconds.) |
02:04:45 | * | yumaikas quit (Ping timeout: 250 seconds) |
02:04:45 | * | Guest15539 quit (Ping timeout: 258 seconds) |
02:06:34 | * | dadada joined #nim |
02:06:57 | * | dadada is now known as Guest15289 |
02:07:09 | * | yumaikas joined #nim |
02:09:35 | * | shodan45 joined #nim |
02:15:07 | * | muffindrake quit (Ping timeout: 252 seconds) |
02:17:18 | * | muffindrake joined #nim |
02:17:18 | * | martinium joined #nim |
02:21:15 | * | martinium quit (Changing host) |
02:21:15 | * | martinium joined #nim |
02:26:09 | martinium | are there any major performance differences between the different Nim compiler backends |
02:26:26 | * | NimBot joined #nim |
02:27:23 | Yardanico | martinium: as in time to run or time to compile? |
02:27:52 | Yardanico | if time to run (the resulting binaries/code), then it's mostly the same for C/C++/Objective C I would say (although there are some backend specific options like use C++ exceptions for C++ backend) |
02:28:01 | Yardanico | JS backend will of course be slower since JS isn't a compiled language :P |
02:32:02 | martinium | pretty wild it can compile to so many languages |
02:32:11 | Yardanico | well C/C++/ObjC are "mostly" the same :P |
02:32:23 | martinium | so the JS transpiling is basically mature now? |
02:32:38 | martinium | it was still WIP last time I had checked on this language |
02:32:39 | leorize | yea been mature for awhile |
02:32:43 | Yardanico | well I mean nim forum runs on it, karax runs on it |
02:32:50 | martinium | nice |
02:32:55 | martinium | I need to check out karax |
02:33:46 | martinium | The script I was working on crashed yesterday due to too many open files |
02:34:10 | martinium | I read in the docs that the http client opens a new connection and keeps it open for each request |
02:34:17 | Yardanico | maybe you forgot to do "client.close()" ? |
02:34:21 | martinium | so I have to manually close after each request? |
02:34:29 | Yardanico | or you can just reuse the same http client |
02:34:33 | Yardanico | no need to create it for every request |
02:34:40 | martinium | that's what I was doing and it errored out |
02:34:50 | martinium | with the too many open files error |
02:35:04 | martinium | python took 7 hours but it didn't segfault |
02:35:13 | martinium | so def have to adapt the code to be more Nim |
02:35:22 | martinium | I also need to convert it to async |
02:35:33 | martinium | but I have no experience coding async or threads |
02:36:00 | martinium | love the syntax in this lang makes things a lot smoother |
02:39:55 | martinium | currently reading Dom's book to get an idea of how to do it |
02:40:43 | FromDiscord_ | <KingDarBoja> I just discovered that calling discard on some proc that raises an error will give you all the proc stacks on terminal |
02:41:15 | leorize | uhmmm what? |
02:43:37 | FromDiscord_ | <KingDarBoja> https://imgur.com/0SBSPmB |
02:47:17 | * | tml[m] quit (Ping timeout: 265 seconds) |
02:47:51 | leorize | it's not discard-specific :P |
02:48:11 | leorize | everything do that when they raise and no one catch |
02:49:58 | FromDiscord_ | <KingDarBoja> OHHHHHHH |
02:50:04 | FromDiscord_ | <KingDarBoja> Didn't know |
02:50:42 | Yardanico | lol |
02:50:46 | Yardanico | that's how exceptions work you know |
02:51:22 | Yardanico | "discard" basically has 2 uses: 1) you have to explicitly discard the value of the procedure when you call it but don't need the result 2) when you want to "do nothing" in some block (if statement, case statement, etc) |
02:51:36 | Yardanico | the 2) is the same as "pass" in python |
02:52:12 | FromDiscord_ | <KingDarBoja> Yeet |
02:54:07 | FromDiscord_ | <KingDarBoja> Not sure why I said that lol, maybe I lost sight while listening to music, who knows |
02:54:09 | FromDiscord_ | <KingDarBoja> π |
02:58:58 | * | tml[m] joined #nim |
03:14:52 | FromGitter | <bung87> can push gc flag in tests with different value? |
03:15:10 | disruptek | in a nim.cfg, sure. |
03:16:01 | FromGitter | <bung87> but should use different test file right? |
03:16:20 | Yardanico | you can use a .nims file just for one specific test file |
03:16:36 | shashlick | disruptek: what did you think of static linking libgit2 |
03:17:20 | shashlick | and a distribution model similar to choosenim - built on CI and just downloaded to users systems prebuilt |
03:17:27 | FromGitter | <bung87> thank you , I was thinking just one file, each test case |
03:21:55 | leorize | or you can use testament :P |
03:26:09 | FromGitter | <bung87> the nims is configuring for dir? |
03:26:20 | FromDiscord_ | <SolarOmni> So, I've been following Nim for about a year now, and I've messed with it a little but nothing big, and I quite like the language. Especially since I like to do web stuff too. But what I really like to focus on is game development, but I don't really like engines too much. So I was wondering if 1: You guys think Nim would be good for game development, and 2: What you would recommend for libs if so |
03:26:36 | leorize | summoning lqdev[m] |
03:26:49 | disruptek | shashlick: sounds great; when can it work? |
03:27:09 | disruptek | or zacharycarter. |
03:28:43 | shashlick | i'm looking into getting nimblePath and paths forwarded to child nim processes, should fix the build issue |
03:28:55 | shashlick | but i cannot detect clearNimblePath or noNimblePath |
03:29:05 | shashlick | compileOption() doesn't work for those |
03:29:36 | disruptek | shouldn't it yield an empty array in that event? |
03:31:10 | FromDiscord_ | <KingDarBoja> Welcome to Discord Nim, SolarOmni π |
03:31:27 | FromDiscord_ | <KingDarBoja> Take a seat while our community members answer your question. |
03:31:35 | disruptek | think about how you'd solve this if we impl your pm->builder->compiler workflow. |
03:32:04 | * | rockcavera quit (Remote host closed the connection) |
03:32:12 | disruptek | nim is good for game dev. |
03:32:21 | skrylar[m] | and now i have ported my handletree (well, based on a design stolen from stack overflow) to nim |
03:32:30 | disruptek | there are many libs to choose from. |
03:32:33 | disruptek | !repo nimgl |
03:32:35 | disbot | https://github.com/nimgl/nimgl -- 9nimgl: 11NimGL is a Nim library that offers bindings for popular libraries used in computer graphics 15 133β 12π΄ 7& 6 more... |
03:32:43 | disruptek | !repo sdl2 |
03:32:45 | disbot | https://github.com/nim-lang/sdl2 -- 9sdl2: 11Nim wrapper for SDL 2.x 15 108β 53π΄ 7& 29 more... |
03:33:21 | shashlick | it complains it isn't a supported flag |
03:35:06 | zacharycarter | C question - what does this macro evaluate to logic wise? |
03:35:27 | skrylar[m] | i guess i should look at this v lang since people here keep mentioning it |
03:35:30 | shashlick | need to add it to the compiler in http://commands.ni:neutral_face: |
03:35:42 | zacharycarter | ```#define foo(p) (cond ? a : 0, b)``` |
03:35:57 | zacharycarter | ternary followed by some expression |
03:36:05 | zacharycarter | with the comma operator |
03:36:13 | FromDiscord_ | <SolarOmni> I am familiar with SDL2, that would be nice. |
03:36:25 | FromDiscord_ | <SolarOmni> @KingDarBoja Thanks π |
03:36:41 | Yardanico | I'd prefer to recommend you a different sdl2 wrapper though |
03:36:48 | Yardanico | https://github.com/Vladar4/sdl2_nim |
03:36:58 | disruptek | they are talking to me in ##rust but i have no idea wtf they are talkin' about. |
03:37:12 | FromDiscord_ | <SolarOmni> Haha, Rust is black magic |
03:37:24 | skrylar[m] | "Unlike most languages, variable shadowing is not allowed. Declaring a variable with a name that is already used in a parent scope will result in a compilation error." dumb |
03:37:39 | Yardanico | skrylar[m]: don't |
03:37:42 | Yardanico | you'll only laugh :D |
03:37:50 | skrylar[m] | the official sdl wrapper works fine enough to start up an opengl context, which is what you use sdl for anyway |
03:38:13 | skrylar[m] | also once you do that, https://git.sr.ht/~skrylar/skgl you're welcome |
03:38:13 | disruptek | "< rtyler> disruptek: is that on report or record?" -- is this some rust-specific lingo? |
03:38:18 | zacharycarter | don't use SDL - use sokol |
03:38:20 | FromDiscord_ | <SolarOmni> NimGL looked interesting, but, that's way beyond my level |
03:38:31 | disruptek | !repo rapid |
03:38:32 | disbot | https://github.com/liquid600pgm/rapid -- 9rapid: 11A game engine written in Nim, optimized for rapid game development and prototyping. 15 68β 2π΄ 7& 1 more... |
03:38:55 | zacharycarter | but no one has any idea what that macro I posted evaluates to? |
03:40:21 | Yardanico | zacharycarter: (if cond: a else: 0; b) |
03:40:22 | Yardanico | i think |
03:40:23 | skrylar[m] | why is an ORM even mentioned in the compiler docs |
03:40:41 | disruptek | it's (something, something-else) |
03:40:58 | disruptek | ie. the b is a second clause. |
03:41:08 | FromDiscord_ | <SolarOmni> zacharycarter: What is Sokol? I googled it but I can't find anything |
03:41:15 | FromDiscord_ | <KingDarBoja> V stands for Vaporwaveeee(?) |
03:41:21 | zacharycarter | ok thanks |
03:41:29 | Yardanico | ware* |
03:41:34 | zacharycarter | SolarOmni:https://github.com/floooh/sokol |
03:41:50 | Yardanico | skrylar[m]: my favourite is https://github.com/vlang/v/blob/master/doc/docs.md#memory-management |
03:42:07 | Yardanico | "(Work in progress) There's no garbage collection or reference counting. V cleans everything up during compilation. If your V program compiles, it's guaranteed that it's going to be leak free." good luck implementing that without something like Rust's borrow checker |
03:42:07 | FromDiscord_ | <Elegant Beef> Welcome solar, im primarly a game dev too, and sadly the current gamdev front is semi bleak for nim, since there isnt a fantastic easy to use framework or engine |
03:42:22 | zacharycarter | You don't need an engine for gamedev really |
03:42:43 | zacharycarter | and if you want one - use the Godot stuff or the UE4 stuff |
03:42:53 | skrylar[m] | finished scrolling through it. i don't.. *hate* V. it looks like someone left Go out in the rain a little too long until it got rusty, and i guess type reflection is bearable in that you could do the old two step "build an app that reflects on itself and outputs a module you can include to get your static serialization stuff", but uhm.. eeh |
03:43:18 | FromDiscord_ | <Elegant Beef> Well yea i dont disagree with the not needing an engine, a framework would be fine, but most nim game stuff is 2D, which is unexceptable! π |
03:43:29 | FromDiscord_ | <Elegant Beef> unacceptable even |
03:43:58 | skrylar[m] | if it were not for nim i would be using haxe ^^;; although v's build chain is less french^W convoluted |
03:44:08 | disruptek | lol |
03:44:15 | FromDiscord_ | <SolarOmni> I'm just dabbling in a few different discords getting peoples opinions and see if I can't find some libs I can't find myself. Right now I'm mostly interestedin Rust, Go, Nim, Haxe, and Crystal (though Crystal still can't compile for windows, which is a no go) |
03:44:27 | skrylar[m] | (they make jokes about how many frenchmen are involved in their own compilers, thus the joke) |
03:44:29 | Yardanico | ahem |
03:44:42 | Yardanico | im getting some dΓ©jΓ vu here |
03:44:43 | zacharycarter | Elegant Beef: so use C/C++ libraries to fill the gap |
03:44:45 | Yardanico | disruptek will understand |
03:44:58 | zacharycarter | if you want Unity or UE4 written in Nim then just forget it it because it aint happening |
03:45:13 | zacharycarter | those engines have hundreds of developers working on them full time |
03:45:15 | skrylar[m] | is that because you keep starting your engine over |
03:45:21 | zacharycarter | maybe |
03:45:46 | skrylar[m] | i'm up to my eyeballs in index buffers and old gles2 crap |
03:45:51 | zacharycarter | actually - this iteration of it is looking promising |
03:45:56 | FromDiscord_ | <Elegant Beef> Well the thing is there isnt a plug and play solution imo, which i dont like and i dont know enough about C/C++ to actually go around making bindings/usable stuff |
03:46:00 | disruptek | shashlick: what's the deal with choosenim on osx? |
03:46:03 | zacharycarter | I have hot reloading working |
03:46:07 | Yardanico | @beef godot? |
03:46:11 | Yardanico | there are nim bindings |
03:46:15 | zacharycarter | and a fiber based job system |
03:46:15 | Yardanico | for GDNative |
03:46:24 | disruptek | it's failing my ci. |
03:46:42 | zacharycarter | Then why not just use Unity & C#? |
03:46:43 | disruptek | you made your own fibers? |
03:46:45 | skrylar[m] | Yardanico: eh the borrow checker is actually good |
03:46:57 | Yardanico | skrylar[m]: you didn't understand what I meant |
03:47:00 | zacharycarter | disruptek: deboostified fibers |
03:47:07 | disruptek | wtf is that |
03:47:08 | zacharycarter | so no boost ocntext |
03:47:11 | zacharycarter | context* |
03:47:20 | Yardanico | "good luck implementing that without something like Rust's borrow checker" means that it's really hard to do something like Rust's borrow checker with V's syntax really |
03:47:27 | disruptek | just stack? |
03:47:29 | zacharycarter | https://www.boost.org/doc/libs/1_68_0/libs/fiber/doc/html/fiber/overview.html |
03:47:30 | zacharycarter | yes |
03:47:35 | disruptek | hmm. |
03:47:52 | skrylar[m] | if i were a stupid person i would just bind Urho3D's scripting interface to hashlink :p |
03:47:53 | disruptek | seems fine to me. |
03:48:05 | skrylar[m] | thats basically budget unity |
03:48:05 | FromDiscord_ | <Elegant Beef> Zach im saying i'd like to use nim in a game environment and your solution is "use unity"? |
03:48:08 | Yardanico | skrylar[m]: 4raq himself has made Urho3D bindings in the past :P |
03:48:19 | Yardanico | https://github.com/3dicc/Urhonimo |
03:48:34 | skrylar[m] | urho is okay. i used it a wee bit |
03:48:41 | zacharycarter | No my solution was Godot haha |
03:49:08 | zacharycarter | but if you don't understand C/C++ you might be better off with C# |
03:49:13 | skrylar[m] | hmm a saner person would use godot yeah |
03:49:20 | zacharycarter | and Unity |
03:49:36 | FromDiscord_ | <Elegant Beef> I mean it's not like i cant learn it, i just have no interest in them, im already we aclimated with unity and godot |
03:49:39 | zacharycarter | You're not going to get very far in game dev with Nim if you don't understand C/C++ |
03:49:42 | skrylar[m] | "i just want to use janet to do my dialogue scripts" -> welcome to gdnative is almost entirely nudocumented ha ha ha ha |
03:50:48 | zacharycarter | I mean - if you want to do simple 2d stuff - fine you don't need to know C/C++ you can just use SDL2 / GLFW |
03:51:08 | zacharycarter | but if you want to do 3d stuff - well chances are you're going to be relying on some C library down the road |
03:51:08 | skrylar[m] | i guess there is also the inkjs option of just emitting json bytecode and then having a very hastily clad interpreter in gdscript |
03:51:21 | skrylar[m] | those are all saner than "i will just do it myself .. fek now i have to spend weeks on basic 2d parts" |
03:51:24 | FromDiscord_ | <Elegant Beef> Yea i dont do 2D games stuff often, if ever |
03:52:12 | * | Romanson joined #nim |
03:52:17 | zacharycarter | I mean it sounds to me like you want things to be easy and for things to be easy you should use a game engine that is well documented and widely adopted |
03:52:29 | zacharycarter | Nim doesn't fit into that picture at the moment |
03:52:35 | FromDiscord_ | <Elegant Beef> Which is what i said |
03:53:00 | zacharycarter | no you implied that game dev in Nim was bleak, it's not |
03:53:03 | zacharycarter | it's just not easy |
03:53:07 | FromDiscord_ | <Elegant Beef> > Welcome solar, im primarly a game dev too, and sadly the current gamdev front is semi bleak for nim, since there isnt a fantastic easy to use framework or engine |
03:53:08 | zacharycarter | is game dev in C bleak? |
03:53:13 | FromDiscord_ | <Elegant Beef> I literally gave reason why it's not bleak |
03:53:21 | FromDiscord_ | <Elegant Beef> it's bleak* |
03:53:27 | FromDiscord_ | <SolarOmni> If I wanted an engine, I'd use Defold or Godot |
03:53:31 | FromDiscord_ | <SolarOmni> But I just prefer code |
03:53:35 | zacharycarter | it's not bleak it's just not easy button |
03:53:57 | FromDiscord_ | <SolarOmni> I actually am moderately versed in C++ myself |
03:54:10 | skrylar[m] | defold? |
03:54:18 | FromDiscord_ | <SolarOmni> It's a low level lua engine |
03:54:29 | FromDiscord_ | <Elegant Beef> I've modified barony's source code to load characters through json, so im totally versed in C++ |
03:54:29 | leorize | we have a decent sdl2 wrapper :P |
03:54:31 | Demos[m] | c++ is cursed |
03:54:31 | FromDiscord_ | <Elegant Beef> π |
03:54:35 | Demos[m] | it's a great leanguage |
03:54:37 | Demos[m] | but cursed |
03:54:47 | skrylar[m] | its not a great language |
03:54:51 | zacharycarter | yeah it's def not |
03:54:57 | FromDiscord_ | <SolarOmni> I like C++, just, too much work xD I already tried writing an engine in it with SDL2, I got a ways, then burned out, cuz too much damn work |
03:55:01 | skrylar[m] | common lisp is a great language. c++ is an incurable illness |
03:55:10 | zacharycarter | nothing cursed about it - just bad design by committee |
03:55:30 | Demos[m] | there's some good design by committee too |
03:55:30 | FromDiscord_ | <SolarOmni> I also realized it was basicaly black magic to anyone but me |
03:55:38 | FromDiscord_ | <SolarOmni> So I'd have to then plugin a scripting language |
03:55:59 | Demos[m] | (I actually think for gamdev being well versed in something like Fortran 2008 is better than being well versed in c++) |
03:56:03 | shashlick | disruptek: nimph? |
03:56:35 | disruptek | cutelog is failing, of all things. |
03:56:58 | disruptek | cannot fetch choosenim nightly on osx. |
03:57:00 | disruptek | 403 |
03:58:36 | skrylar[m] | well i just have no faith in c++ stuff. i mean can you defend templates with a straight face |
03:58:38 | shashlick | it runs into the api limit on github to pull nightlies |
03:58:49 | shashlick | you could set a github token to make it work |
03:59:00 | Demos[m] | skrylar: you do know nim's generics are straight up a copy of C++ templates right? |
03:59:05 | skrylar[m] | when bjarne said "nobody will ever fully understand [all the template mechanics]" c++ should have been shot in the head |
03:59:14 | skrylar[m] | journe |
03:59:31 | disruptek | "nobody" sounds pretty damning, coming from him. |
03:59:33 | FromDiscord_ | <SolarOmni> Lol |
03:59:51 | skrylar[m] | yeah the guy who made the language basically confesses his language is crap |
04:00:31 | skrylar[m] | macros are simpler than the horror that is the entire template spec |
04:00:47 | shashlick | disruptek: oh you are still using the old travis.sh |
04:00:54 | disruptek | oh |
04:01:02 | Demos[m] | skrylar: nim macros or c++ ones |
04:01:04 | disruptek | thanks; that's an easy fix. |
04:01:05 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:01:13 | skrylar[m] | Demos: common lisp |
04:01:18 | Demos[m] | ah |
04:01:47 | Demos[m] | templates (and nim's generics) make writing certain kinds of code much easier than macros |
04:01:53 | Demos[m] | (clisp macros) |
04:01:55 | shashlick | change to **`curlΒ https://gist.github.com/genotrance/fb53504a4fba88bc5201d3783df5c522/raw/travis.shΒ -LsSfΒ -oΒ travis.sh`** |
04:01:58 | Demos[m] | (not c macros, those are bad) |
04:02:12 | shashlick | might need to clear cache |
04:02:20 | disruptek | already pushed. |
04:02:36 | Demos[m] | anyway Bjarne would probably say "yeah it's complicated, but evidently it's useful" |
04:02:59 | Demos[m] | also TONS of other languages copied c++'s template semantics (almost nobody copide the syntax, cuz it is truely insane, or should I say typename insane) |
04:03:00 | skrylar[m] | CL macros are basically "so we look at the head of a list, and if its a macro then we run some code in an interpreter and whatever you return is what we try to compile as though you typed it in." and thenpretty much every language ever says macros bad, while people praise c++ templates, even though things like boost are extreme voodoo and they're just patting themselves on the back for making a convoluted hedge maze that they |
04:03:00 | skrylar[m] | then managed to waste years walking through and then say "THERES NO PROBLEM, WE MADE IT THROUGH THE HEDGE EVENTUALLY!!" thats basically the c++ deep coping. |
04:03:43 | skrylar[m] | meanwhile they keep deferring pascal units from the standard ... |
04:03:46 | disruptek | voodoo really has no place. |
04:03:47 | Demos[m] | I don't really know any c++ people who think cl style macros are bad |
04:03:58 | skrylar[m] | guess compiling hundreds of megabytes of bad syntax every file isn't a problem we compiled it eventualy too |
04:04:08 | leorize | I'm pretty sure Nim's generics are simpler than C++ templates :P |
04:04:11 | Demos[m] | I do know many implementers who don't want to standardize their AST |
04:04:12 | skrylar[m] | anyway that's enough of that rant, have modules instead. https://git.sr.ht/~skrylar/skhandletree |
04:04:24 | Demos[m] | c++20 has pascal units |
04:04:27 | Demos[m] | although tbh they work more like ada modules/units |
04:04:50 | leorize | has != people will use it |
04:04:57 | Demos[m] | I'll point out that c++ also did a very fine job with concepts (requires requires aside.... ) |
04:04:58 | leorize | I do know people who dread that addition |
04:05:16 | Demos[m] | I know people who dread it too |
04:05:35 | Demos[m] | and it's really because the current place where the build system is seperated from the compiler doesn't make sense any more |
04:05:45 | leorize | nim have concepts before it's cool :P |
04:05:52 | leorize | we never got to make it properly work though |
04:06:01 | Demos[m] | nim is copying c++'s concepts to make them work :D |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:04 | leorize | mainly because of the lack of interest |
04:06:44 | * | supakeen joined #nim |
04:06:52 | Demos[m] | I actually still annoyed that in c++ I have to write like void foo(someconcept auto arg) {} instead of in nim where I can say |
04:07:02 | Demos[m] | proc foo(arg: someconcept) |
04:07:04 | Demos[m] | just like any other type |
04:07:17 | leorize | proc foo(a, b: int) |
04:07:17 | Demos[m] | but at least we got the abbreviated syntax! |
04:07:22 | leorize | ^ the ultimate form |
04:07:24 | Demos[m] | I hear that was an extremely spicy wg21 meeting |
04:07:42 | martinium | I am about to embark on converting a synchronous function to async. Right now it works by making requests for paginated http json responses. Would I need to make each request await? |
04:08:07 | Yardanico | martinium: to truly make use of async you'll have to do like 10-50 calls in batch and wait for all of them |
04:08:21 | Yardanico | or if your logic allows that have async procs which call other async procs with (await) |
04:08:21 | Demos[m] | martinium: that's probably the easiest |
04:08:28 | Yardanico | so you can start like 10 async procs which then will call 500 async procs |
04:08:33 | Yardanico | and it all will be async and stuff |
04:08:53 | Demos[m] | Yardanico: it's all on a stackless event loop right? they don't get deligated to the thread pool |
04:09:02 | Yardanico | ? |
04:09:04 | leorize | yea |
04:09:07 | Yardanico | yes it's single-threaded |
04:09:13 | martinium | would I need to create a separate http client for each or can they all use one client? |
04:09:15 | Yardanico | but for IO stuff like http requests it's very good |
04:09:24 | leorize | martinium: concurrency |
04:09:26 | Yardanico | martinium: you'll need a separate one for each async proc |
04:09:28 | Demos[m] | cuz I know in cpprestsdk (which uses taks based async) we have a problem where people do like "a.get() + b.get()" and don't understand the issue with it |
04:09:33 | leorize | a client can only do one request at a time |
04:09:39 | Demos[m] | they also deadlock sometimes because the threadpool runs out of threads |
04:09:39 | leorize | a limitation of the HTTP/1.1 spec |
04:09:52 | Demos[m] | clients can have more than one connection open at once |
04:10:02 | Demos[m] | also didn't 1.1 add pipelineing? |
04:10:12 | leorize | you still can't request concurrently |
04:10:20 | leorize | also pipelining is so broken no browser even enable it |
04:10:27 | Demos[m] | why the hell not? |
04:10:36 | leorize | ah wait I was wrong |
04:10:38 | leorize | you can :P |
04:10:43 | leorize | but pipelining is still broken |
04:10:50 | Demos[m] | you probs need ratelimiting |
04:10:54 | martinium | if I await one of the clients the other clients will be able to start their requests concurrently without waiting correct? |
04:10:55 | Demos[m] | but you need that anyway |
04:11:12 | Demos[m] | are you awaiting within an async proc? |
04:11:20 | Yardanico | martinium: yes |
04:11:21 | martinium | should I even await at all |
04:11:24 | Yardanico | yes |
04:11:33 | Yardanico | but you need to use it carefully |
04:11:50 | martinium | I was thinking of doing await for each http request |
04:11:55 | Yardanico | well that's ofc |
04:12:04 | Yardanico | https://gist.github.com/martinium/c93119a6e4fb0bb4914fc5dfbc7c91af you have 3 for's here |
04:12:33 | Yardanico | so you can call an async proc for each asset_id which then will call async procs for all pages which then will return stuff |
04:12:46 | Yardanico | or you can just write to a global variable xd |
04:13:22 | martinium | this is going to be a bitch lol |
04:13:39 | martinium | hate not knowing stuff haha |
04:14:56 | martinium | so you recommend breaking down the loops into their own procs? |
04:15:14 | Yardanico | otherwise you won't really be able to take advantage of async |
04:15:32 | martinium | yeah that was what I was thinking but was being lazy |
04:15:37 | Yardanico | also does this API have rate limiting? |
04:15:42 | Yardanico | in seconds |
04:15:49 | martinium | yes it does 1 sec |
04:15:56 | Yardanico | because that's quite an issue :P |
04:18:29 | martinium | think its 1 request per second |
04:18:35 | martinium | may be much higher |
04:18:40 | martinium | looking at docs |
04:18:44 | Yardanico | 1req/second is really low |
04:18:55 | Yardanico | how much requests do you need to make in total? |
04:19:17 | martinium | think I had read either 10 or 500 per second |
04:19:26 | martinium | it'll be more than 10000 requests total |
04:19:32 | Yardanico | uh-oh |
04:19:46 | Yardanico | rate limiting will be quite difficult in a nim async app because I don't have experience with that :P |
04:20:07 | Yardanico | and yes you need to care because the way I was meaning to do it is by spamming as much requests as possible at the same time |
04:20:11 | martinium | I'll try and get it as far as I can and deal with that as it becomes an issue I guess |
04:21:32 | martinium | I actually don't see any rate-limiting info in their docs |
04:21:37 | martinium | so it may not be rate limited |
04:21:51 | martinium | which would make sense considering the amount of data that needs to get requests and grabbed |
04:22:03 | martinium | they limit to max 500 items per page per request |
04:22:19 | Yardanico | well I can you implement this stuff if I know which APIs to call :P |
04:22:21 | Yardanico | and what's get_asset_IDs() |
04:25:27 | martinium | another function that gets all asset IDs from another endpoint |
04:25:39 | martinium | I save those IDs into a seq |
04:25:51 | martinium | that I plan to reuse for other procs |
04:26:00 | Yardanico | well can you send the nim version you currently have? in private maybe |
04:26:06 | skrylar[m] | for rate limits wouldn't you just make an async actor that waits on a timer before it pitches a new job to the scheduler |
04:26:11 | martinium | seq saves "id": "ip" |
04:26:18 | Yardanico | skrylar[m]: how to do that with asyncdispatch? :P |
04:26:40 | skrylar[m] | i haven't used async because i'm constantly told its broken, so. |
04:26:59 | skrylar[m] | but with a rate limit of one second i don't think you gain anything with async |
04:27:03 | martinium | I can share the code as it is nothing proprietary in the code 1 sec |
04:29:17 | skrylar[m] | ok. slapped a readme on handletrees |
04:30:04 | martinium | yeah the rate-limit was in my brain it is nowhere in their docs |
04:31:37 | * | nsf joined #nim |
04:34:08 | skrylar[m] | https://git.sr.ht/~skrylar/skhandletree i hope thats readable enough (last time i'm going to plug it tonight lol) |
04:35:27 | FromDiscord_ | <KingDarBoja> Arrrhg |
04:35:35 | Yardanico | oh so you're using insightvm api |
04:35:44 | martinium | yeah |
04:35:47 | martinium | rapid7 |
04:35:49 | martinium | https://gist.github.com/martinium/6530d5d335e29feda0ce3b885376a5ed |
04:35:51 | FromDiscord_ | <KingDarBoja> That moment when you dealing again with unicodes lol |
04:36:23 | martinium | lot of commented code that I am in process of converting |
04:36:31 | Yardanico | martinium: well I already wrote a "template" |
04:36:43 | Yardanico | I mean some stuff without saving the results and these tables with asset/site maps |
04:37:07 | martinium | with proper examples to learn from I can build upon it |
04:37:33 | martinium | I want a taste of the proper speed boost this lang can bring |
04:37:46 | FromDiscord_ | <KingDarBoja> "Check failed: value.value == "Has a ΰ¨ multi-byte character." |
04:37:54 | FromDiscord_ | <KingDarBoja> "value.value was Has a 0000000000000A0A multi-byte character." |
04:37:59 | FromDiscord_ | <KingDarBoja> Sooo close |
04:38:01 | Yardanico | well as I said before you can speed it up a lot with async even in python |
04:38:40 | martinium | yeah |
04:38:58 | martinium | I'll prob an async python version when I complete the nim version |
04:39:15 | Yardanico | also one thing - "count" won't really be possible with an async version |
04:39:16 | martinium | the other good thing with nim is I can just give someone an executable |
04:39:27 | martinium | count is not really needed |
04:39:32 | martinium | just hadn't deleted |
04:39:37 | Yardanico | you'll need to also not forget to include openssl libs if you're compiling for windows :P |
04:39:52 | skrylar[m] | why would counts not be possible |
04:40:09 | Yardanico | skrylar[m]: well I mean they will be possible |
04:40:16 | Yardanico | but they won't be in sequential order like before |
04:40:16 | martinium | since the threads will prob right at different times |
04:40:19 | martinium | yeah |
04:40:24 | skrylar[m] | true |
04:40:25 | Yardanico | martinium: there's only 1 thread in async ;) |
04:40:25 | martinium | write not right* |
04:40:43 | Yardanico | concurrency vs parallelism |
04:40:49 | Yardanico | although you can use both at the same time |
04:40:56 | martinium | I was about to ask that |
04:41:04 | martinium | how is parallelism in nim? |
04:41:07 | martinium | is it stable? |
04:41:14 | skrylar[m] | hot potatos does v compile fast though |
04:41:29 | Yardanico | well it is stable, but with the default GC you won't be able to use global GC'd memory |
04:41:29 | * | lritter joined #nim |
04:41:38 | Yardanico | that's to be solved with --gc:arc but it's still in development |
04:42:23 | martinium | a parallel async app would be amazing |
04:42:36 | martinium | proper advantage of all modern cpu cores |
04:42:58 | zedeus | about openssl and windows, I saw a bunch of forum threads about static linking but they were mostly old and nobody seemed to figure it out |
04:43:36 | zedeus | I really wanted to avoid shipping dlls though so I managed to do it on my own, maybe worth a forum post or something? i don't know if this is still something people haven't figured out |
04:43:38 | zedeus | https://github.com/zedeus/kinoplex/commit/935138b2b7cac847a9093c8cdeb9b811531b360a |
04:44:04 | Yardanico | well it's mostly the same for linux |
04:44:10 | Yardanico | coz you're compiling with mingw :P |
04:44:37 | Yardanico | kaushalmodi made some static linking stuff for linux with libressl and pcre |
04:44:47 | zedeus | right but on linux people usually have openssl installed anyway so it's not an issue |
04:44:51 | Yardanico | https://github.com/kaushalmodi/hello_musl |
04:44:59 | Yardanico | zedeus: depends on what linux you're targeting though :P |
04:45:07 | zedeus | the ones I care about targeting all have it :) |
04:45:49 | martinium | windows 10 comes with openssl nowadays |
04:45:50 | * | zacharycarter quit (Ping timeout: 256 seconds) |
04:45:55 | martinium | openssh nevermind |
04:46:06 | martinium | openssl is diff |
04:46:16 | zedeus | anyway, resources for static linking linux binaries with nim are aplenty, but there are basically none for mingw |
04:46:20 | zedeus | besides dead ends on the forum |
04:46:53 | leorize | you get to be the first then :) |
04:51:38 | FromDiscord_ | <KingDarBoja> https://github.com/nim-lang/Nim/issues/400 |
04:51:41 | disbot | β₯ Unicode-aware string handling ; snippet at 12https://play.nim-lang.org/#ix=2j9q |
04:51:45 | FromDiscord_ | <KingDarBoja> @Varriount I see what you did there |
04:51:48 | skrylar[m] | depending on what you're doing you could also jank it with an ecs or something |
04:52:02 | Yardanico | @KingDarBoja there's https://github.com/nitely/nim-unicodeplus |
04:52:12 | skrylar[m] | store the task info in boxes and then have workers ask for the job across threads like you would be doing with beanstalk anyway |
04:52:18 | Yardanico | also https://github.com/nitely/nim-unicodedb |
04:52:38 | Yardanico | well basically https://github.com/nitely/nim-unicodeplus combines 3 other unicode libs nitely wrote for Nim |
04:52:57 | FromDiscord_ | <KingDarBoja> I will check the unicodeplus |
04:53:03 | FromDiscord_ | <KingDarBoja> I love you Yardanico-sensei |
04:53:37 | Yardanico | also https://github.com/nitely/nim-strunicode |
04:54:53 | FromDiscord_ | <KingDarBoja> Ok, unicodeplus doesn't seem what I am looking for, looking at strunicode |
04:56:25 | Yardanico | what do you want to do |
04:56:29 | * | zacharycarter joined #nim |
05:00:06 | * | dddddd quit (Ping timeout: 256 seconds) |
05:00:41 | * | zacharycarter quit (Ping timeout: 250 seconds) |
05:00:52 | FromDiscord_ | <KingDarBoja> Handle unicodes on strings |
05:01:04 | FromDiscord_ | <KingDarBoja> As different GraphQL APIs could return those |
05:01:54 | skrylar[m] | um |
05:02:02 | skrylar[m] | that doesn't mean very much |
05:02:28 | skrylar[m] | you can just do literally nothing and you 'handled' a unicode string |
05:03:15 | skrylar[m] | if you mean things like comparing two strings, then you start getting in to unicode normalization forms |
05:06:08 | shashlick | zedeus: see nimarchive and nimgit2 for static linking on windows with mingw |
05:06:31 | skrylar[m] | humm. should see how well this hot code reloading works in nim |
05:07:11 | skrylar[m] | the sheer compile speed and hcr are the spiciest meatballs in V. |
05:09:10 | shashlick | Of course that's cause the libs can be built on windows with their build tools |
05:09:26 | shashlick | Openssl requires a laundry list of stuff to build |
05:11:33 | FromDiscord_ | <KingDarBoja> I need unicode cuz my current lexer isn't able to catch properly unicode strings :/ |
05:12:37 | FromDiscord_ | <KingDarBoja> or maybe I am not correctly parsing them, lol |
05:12:56 | FromDiscord_ | <KingDarBoja> Anyway, going to sleep, bye guys π |
05:14:20 | Yardanico | oh |
05:14:26 | Yardanico | you just need to use nim's unicode stdlib then |
05:14:35 | Yardanico | and iterate over utf-8 runes instead of ascii characters |
05:15:00 | Yardanico | although not neccessarily |
05:15:10 | Yardanico | nim itself supports utf-8 identifiers without actually using runes in the compiler AFAIK |
05:17:13 | FromDiscord_ | <KingDarBoja> I had something like this -> elif character == 'u' and pos + 4 <= bodyLen |
05:17:35 | FromDiscord_ | <KingDarBoja> And it is entering the condition but looks like I got the unicode wrong |
05:17:55 | FromDiscord_ | <KingDarBoja> Because I am converting that string lice using fromHex |
05:18:07 | FromDiscord_ | <KingDarBoja> Which I have no idea why I used it lol |
05:18:22 | FromDiscord_ | <InventorMatt> is there a simple way to convert a string of an expression into a proc? like turning "x**2 + 3*x" into the appropriate proc |
05:19:23 | Yardanico | @KingDarBoja that's unicode escape character |
05:19:28 | Yardanico | where are you getting the values from? json? |
05:19:34 | FromDiscord_ | <KingDarBoja> No, a string |
05:19:35 | Yardanico | @InventorMatt on compile-time? sure |
05:19:46 | Yardanico | there's https://nim-lang.org/docs/macros.html#parseExpr%2Cstring |
05:19:56 | FromDiscord_ | <KingDarBoja> But I think Variount mentioned something about perfomance with unicode module, not sure atm |
05:20:05 | Yardanico | just create something like macro(a: static[string]): untyped = parseExpr(a) |
05:20:10 | Yardanico | don't forget to import macros |
05:20:13 | FromDiscord_ | <KingDarBoja> https://github.com/nitely/nim-strunicode looking at this one right now |
05:21:10 | Yardanico | are you sure the string actually has \u1234 verbatim? |
05:21:35 | Yardanico | that's usually a unicode escape |
05:22:15 | * | oculux joined #nim |
05:22:27 | FromDiscord_ | <KingDarBoja> The input string is "{ field(arg: "Has a \u0A0A multi-byte character.") }" |
05:22:47 | FromDiscord_ | <KingDarBoja> Doing repr(s) yields "0000000000996058" # This comment has a \\u0A0A multi-byte character.\10" |
05:23:15 | Yardanico | what if you do echo arg[8] |
05:23:17 | Yardanico | what does it print |
05:25:05 | FromDiscord_ | <KingDarBoja> Char at Pos 8 ->{ |
05:25:15 | Yardanico | uh |
05:25:17 | Yardanico | I mean |
05:25:22 | Yardanico | what if you do for x in str: echo x |
05:25:34 | Yardanico | does it actually print \ u 0 A 0 A each on their own line |
05:25:38 | FromDiscord_ | <KingDarBoja> I just remember the thing with triple quote strings |
05:25:46 | FromDiscord_ | <KingDarBoja> They do not escape sequences π€ |
05:26:34 | FromDiscord_ | <KingDarBoja> Yeah, it does |
05:27:03 | Yardanico | lol |
05:27:19 | Yardanico | are you sure the graphql will actually return the answer like that? |
05:27:23 | Yardanico | and not as utf-8 encoded strng |
05:28:23 | FromDiscord_ | <KingDarBoja> I am looking at the source implementation (Javascript), the same test that I am trying to achieve |
05:28:34 | FromDiscord_ | <KingDarBoja> Hold on |
05:29:31 | FromDiscord_ | <KingDarBoja> https://github.com/graphql/graphql-js/blob/master/src/language/__tests__/parser-test.js#L137 this one mate |
05:30:31 | Yardanico | well JS has unicode escapes |
05:30:36 | FromDiscord_ | <KingDarBoja> The parser relies on the Lexer |
05:30:39 | Yardanico | so you shouldn't test if there's an "u" character |
05:30:43 | FromDiscord_ | <KingDarBoja> Which is hitting this proc |
05:30:44 | FromDiscord_ | <KingDarBoja> https://github.com/graphql/graphql-js/blob/master/src/language/lexer.js#L445 |
05:30:58 | FromDiscord_ | <KingDarBoja> This function* lol |
05:31:18 | Yardanico | yeah it iterates on unicode points as JS itself does |
05:31:34 | Yardanico | although JS uses UTF-16 internally, I don't think it'll make a difference there though |
05:31:42 | Yardanico | so you'll need to use "unicode" module or this strunicode |
05:32:02 | FromDiscord_ | <KingDarBoja> Should I worry about perfomance ? Just curious |
05:32:13 | * | narimiran joined #nim |
05:32:17 | Yardanico | not really I think |
05:32:31 | Yardanico | also I really think a lot of code in your port can be avoided, why not just write a simple iterative tokenizer lol |
05:32:47 | Yardanico | is your work open source? |
05:32:53 | FromDiscord_ | <KingDarBoja> In the case of strunicode -> _Be aware, storing a sequence of grapheme clusters may take 10 times as much space as a utf-8 string. _ |
05:33:04 | Yardanico | well and JS does it like that by default |
05:33:16 | FromDiscord_ | <KingDarBoja> By open source you mean on a repo without any stuff regarding companies? Yes |
05:33:17 | FromDiscord_ | <KingDarBoja> xD |
05:33:23 | Yardanico | yes I mean repo |
05:33:27 | FromDiscord_ | <KingDarBoja> Yup |
05:33:33 | Yardanico | well of course JS has logic for detecting if string contains unicode or not |
05:33:35 | Yardanico | for optimization |
05:33:41 | FromDiscord_ | <KingDarBoja> https://github.com/KingDarBoja/Phosphate |
05:34:12 | FromDiscord_ | <KingDarBoja> I have few changes on local, need to push to the repo but lazy right now lol |
05:44:21 | FromDiscord_ | <InventorMatt> @Yardanico I need something that can do it at run time not during compile time. |
05:47:25 | Yardanico | @InventorMatt then you need to look into embedding nimscript |
05:47:25 | FromDiscord_ | <InventorMatt> if it helps to give context I am creating a wrapper for the sympy library and I want to be able to convert the symbolic equations into a proc that I can use within the code form there |
05:47:30 | Yardanico | Nim compiles to native code |
05:47:57 | Yardanico | you'll either have to use a nim vm (which nimscript is) or think of some other way of doing that :P |
05:48:16 | FromDiscord_ | <InventorMatt> okay, thanks. |
05:48:47 | FromDiscord_ | <KingDarBoja> Yard, just updated the repo π |
05:49:09 | FromDiscord_ | <Gary M> `dev->command_pools = malloc(queue_info_count * sizeof *dev->command_pools);` from C, what is the nim way of doing this? |
05:49:42 | Yardanico | if it's a dynamically allocated "array" in c - use seq |
05:50:41 | FromDiscord_ | <KingDarBoja> If you can take a look and help me with that unicode thing, thank you |
05:50:44 | FromDiscord_ | <KingDarBoja> Now going to sleep |
05:50:47 | FromDiscord_ | <KingDarBoja> π Bye bye |
05:53:16 | * | silvernode joined #nim |
06:11:06 | FromDiscord_ | <Varriount> Hm, someone here was talking about implementation async functions using state machines, but I can't recall who... |
06:12:42 | leorize | it's rayman22201 |
06:13:09 | leorize | but he is busy with his day job rn, sadly |
06:13:35 | leorize | though Araq did voice interest in working on a newer async implementation |
06:14:21 | Araq | that doesn't mean much, Araq is always too busy |
06:14:55 | Araq | but I'll write my 20 line arc async proof of concept |
06:17:52 | FromDiscord_ | <Varriount> Araq: I was idly "sketching" an idea out today. It mostly hinges on async iterators and the fact that you can call an iterator instance with different parameters. |
06:18:34 | FromDiscord_ | <Varriount> Rather than the nested closure concept currently used. |
06:22:48 | * | solitudesf joined #nim |
06:23:27 | silvernode | Good morning |
06:24:20 | silvernode | so I am trying to create a type and make one of the fields a bool but it won't let me. |
06:25:43 | FromDiscord_ | <Rika> can i see code |
06:25:48 | FromDiscord_ | <Rika> also good morning |
06:26:50 | silvernode | https://play.nim-lang.org/#ix=2j9P |
06:27:24 | FromDiscord_ | <Rika> equals sign |
06:27:27 | FromDiscord_ | <Rika> use colon |
06:27:48 | silvernode | oh duh |
06:27:51 | silvernode | thanks |
06:28:18 | silvernode | I knew better than that, what's wrong with me! |
06:28:26 | FromDiscord_ | <Rika> you just woke up |
06:28:56 | silvernode | Indeed I did, and in 30 minutes, I have to clock into work |
06:31:15 | silvernode | We deided to start over with Space Nim now that we have mostly figured out what we want to do |
06:31:23 | FromDiscord_ | <Rika> we? |
06:31:37 | silvernode | A childhood friend is helping me work on it |
06:32:38 | silvernode | Also, techinically disruptekis a project member but has not had a good reason to jump in yet. The project is still materializing. |
06:33:09 | silvernode | That's what happens when you don't know what direction to go in and how to code well |
06:33:39 | silvernode | still flushing out the details but we know a lot more about Nim, and where we want to go with the game |
06:35:13 | * | filcuc joined #nim |
06:35:21 | silvernode | We decided that exploration will be something you cannot do without turns, and the player gets turns as a reward |
06:37:00 | FromDiscord_ | <Rika> thats odd |
06:37:12 | FromDiscord_ | <Rika> so its a turn based now instead of a real time |
06:37:21 | silvernode | yeah |
06:37:36 | silvernode | turn based should be easier on the brain for a new programmer |
06:38:26 | silvernode | I have trouble breaking down problems and using logic even if I know all the language syntax |
06:40:09 | silvernode | side note, as a young boy, it look me longer than most children to learn how to read. My brain tends to learn in a technical lway so explainations usually need to be disected more so than needed for most people. |
06:40:33 | * | PMunch joined #nim |
06:41:17 | * | temporarymonarch is now known as tangor |
06:41:35 | silvernode | Like: Roads are smooth so motor vehicles can travel easier. I would ask: but how is the road made smooth? |
06:42:05 | silvernode | To which a teacher would reply: They just are. |
06:43:36 | silvernode | I seem to be rambling a bit lol. oops |
06:44:15 | FromDiscord_ | <Rika> that is fine |
06:44:18 | FromDiscord_ | <Rika> no one is here |
06:44:37 | silvernode | I guess I just want people to know me here because I like the crowd in this IRC. |
06:45:04 | silvernode | It's the first community that I feel like I can be myself. |
06:46:56 | silvernode | disruptek: says I should start streaming when I start coding, just like he does. |
06:47:47 | FromDiscord_ | <Rika> why not? |
06:51:56 | * | martinium_laptop joined #nim |
06:53:19 | martinium_laptop | anyone ever encounter this error? |
06:53:22 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
06:53:23 | martinium_laptop | ```Exception message: Too many open filesAdditional info: "nodename nor servname provided, or not known"Exception type: [OSError]``` |
06:54:05 | martinium_laptop | Yardanico failed with that same error again |
06:54:13 | FromDiscord_ | <Rika> you probably opened too many files? |
06:54:17 | martinium_laptop | wondering if it is a macOS limitation |
06:54:31 | FromDiscord_ | <Rika> macOS has a pretty low file handle limit from what i recall |
06:54:33 | * | oculux quit (K-Lined) |
06:54:45 | martinium_laptop | I am making a bunch of async web requests and processing some data |
06:54:57 | FromDiscord_ | <Rika> are you closing your files |
06:54:59 | * | ryan_ joined #nim |
06:55:11 | martinium_laptop | the only thing I have to close is the connections |
06:55:23 | martinium_laptop | and they are being closed after each request completes |
06:56:15 | FromDiscord_ | <Rika> do you open any files |
06:56:55 | martinium_laptop | only file I create is a CSV that is written to in a loop |
06:57:14 | * | tangor quit (Ping timeout: 240 seconds) |
06:57:49 | FromDiscord_ | <Rika> huh |
06:57:51 | FromDiscord_ | <Rika> hm |
06:57:54 | * | silvernode quit (Ping timeout: 256 seconds) |
06:58:17 | martinium_laptop | I assume by open files it is referring the http get requests potentially |
06:58:36 | FromDiscord_ | <Rika> but you said you were closing them so |
06:58:41 | martinium_laptop | yeah |
06:58:58 | martinium_laptop | client.close is called after each requests |
06:59:06 | martinium_laptop | so this error has me confused |
06:59:16 | martinium_laptop | error type says OSError |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:51 | * | gmpreussner joined #nim |
07:13:43 | * | hax-scramper quit (Ping timeout: 250 seconds) |
07:14:15 | * | hax-scramper joined #nim |
07:19:31 | martinium_laptop | solved the issue |
07:20:19 | * | Vladar joined #nim |
07:24:10 | FromGitter | <codenoid> hi folks |
07:24:43 | * | liblq-dev joined #nim |
07:24:55 | PMunch | Hi codeneid |
07:41:13 | * | martinium_laptop quit (Remote host closed the connection) |
07:44:59 | * | couven92 joined #nim |
07:48:33 | * | ryan__ joined #nim |
07:48:51 | * | Romanson quit (Quit: Connection closed for inactivity) |
07:51:07 | * | ryan_ quit (Ping timeout: 265 seconds) |
08:01:35 | * | Vladar quit (Quit: Leaving) |
08:04:34 | * | letto_ quit (Ping timeout: 240 seconds) |
08:06:23 | FromDiscord_ | <Rika> anyone here knowledgeable on reactive programming? or got any guides for implementing it in a language? trying to do so for nim but i got nowhere to start |
08:14:03 | Araq | Rika check out my experiments inside karax's repo |
08:14:08 | Araq | summary: it sucks... |
08:14:11 | Araq | ;-) |
08:14:28 | FromGitter | <jorjun_twitter> Thereβs a plethora of code-challenge type websites now. Who wants a code-wrestling place to go? The winning solution wins human votes for aesthetic, and the machine can assess each solution for memory, and performance. |
08:15:06 | * | filcuc joined #nim |
08:15:20 | FromDiscord_ | <Rika> Araq: why does it suck? also, a guide for moving away from reactive would also help me |
08:15:29 | FromGitter | <jorjun_twitter> Difficult allowing different language entries..but something to think about . If there is any interest. A marketer guy told me: see if there is interest before you build speculatively. |
08:15:31 | FromDiscord_ | <Rika> im just trying to port something to nim and it uses reactive, really |
08:16:15 | * | martinium quit (Ping timeout: 265 seconds) |
08:18:24 | FromGitter | <jorjun_twitter> Trick is to devise challenges where there is a mix of IO bound and CPU bound. Would have to get categories together. |
08:22:48 | * | filcuc quit (Ping timeout: 256 seconds) |
08:26:16 | * | natrys joined #nim |
08:33:59 | * | Ven`` joined #nim |
08:44:13 | FromGitter | <jorjun_twitter> Ideally would tune it so that script guys can sometimes win. Thereβs not enough objective evidence of benefits of compiling in context of IO-heavy tasks. |
08:44:29 | FromGitter | <jorjun_twitter> And now I will get my coat. :D |
08:44:40 | FromDiscord_ | <Rika> thats a large gap in time |
08:46:58 | * | oculux joined #nim |
08:49:03 | * | dchem joined #nim |
08:52:06 | * | tane_ joined #nim |
08:53:27 | * | kenran joined #nim |
08:58:41 | * | dchem_ joined #nim |
08:58:48 | * | dchem_ quit (Client Quit) |
08:59:14 | * | dchem_ joined #nim |
09:01:30 | Araq | jorjun_twitter: Nim is not just about "make scripting faster", it's also "let's fix scripting and give a type system" |
09:01:34 | * | dchem_ quit (Client Quit) |
09:02:01 | * | dchem_ joined #nim |
09:02:01 | * | dchem_ quit (Client Quit) |
09:02:31 | Araq | Rika: it's much more complex than DOM diffing and DOM diffing is already too complex |
09:02:39 | * | dchem quit (Ping timeout: 260 seconds) |
09:02:48 | * | dchem_ joined #nim |
09:04:41 | PMunch | Is there a better way to do this without "toStr"? https://play.nim-lang.org/#ix=2jan |
09:05:00 | * | dchem_ quit (Client Quit) |
09:05:15 | * | dchem joined #nim |
09:05:27 | FromGitter | <jorjun_twitter> @Araq Yes, I see that. Didnβt come on here to critique, but thinking about teaching some new coders best practice. |
09:05:28 | * | dchem quit (Client Quit) |
09:06:10 | FromDiscord_ | <Elegant Beef> Everyone knows the best coding practice is to stop before you start π |
09:06:22 | FromDiscord_ | <Elegant Beef> Cant write bad code if you dont write code |
09:06:27 | supakeen | There isn't really a best practic when it comes to CPU vs I/O bound, it heavily depends on the workload even within those domains :) |
09:06:32 | FromGitter | <jorjun_twitter> When you solve these online code challenges, the only feedback you get right now, is votes from others and unit test passing. |
09:06:35 | * | dchem joined #nim |
09:06:48 | FromGitter | <Vindaar> @PMunch: `astToStr(name)`? |
09:07:26 | FromGitter | <jorjun_twitter> Would be good to get across a range of considerations... |
09:07:55 | PMunch | Vindaar, ah perfect. I knew there was a way! |
09:08:52 | FromDiscord_ | <Elegant Beef> Without multiple languages you could have a few solutions of good,great, and fantstic, which both use line count, memory usage, and time as indications of the solution method |
09:09:23 | FromDiscord_ | <Elegant Beef> With multiple languages you have basically 0 benchmark, and users arent going to be that into reading over 9 million duplications of the same thing |
09:09:42 | FromGitter | <timotheecour> @araq is there anything else needed for https://github.com/nim-lang/Nim/pull/13926 beside the comment here https://github.com/nim-lang/Nim/pull/13926#discussion_r406714163 ? |
09:10:09 | dchem | Hello! when a compiler gives an error like "Got <Future[type]> but got Future[type]" what does angled brackets "<" mean? |
09:10:55 | FromGitter | <jorjun_twitter> @Elegant Beef The "new thing" to bring to the table is objective assessment of the solution with benchmarking & instrumentation. |
09:10:59 | PMunch | Rika, what kind of reactive programming do you need? It should be entirely possible to do it in Nim |
09:11:00 | dchem | "but expected Future[type]" sorry |
09:11:31 | Araq | timotheecour: I don't understand it, what I'm saying is this: |
09:11:56 | PMunch | dchem, nothing. There is something else wrong |
09:11:57 | FromDiscord_ | <Elegant Beef> Yea the benchmarking is interesting, and you could do use stdin/stdout for managing most languages, but bench marks would require a rosetta code like database |
09:11:58 | Araq | .importc'ed types have sizeof, but that sizeof must be mapped to C's sizeof mechanism |
09:12:11 | FromDiscord_ | <Elegant Beef> I suppose you could possibly use rosetta code for challenges |
09:12:31 | FromGitter | <alehander92> hmm reactive programming |
09:12:40 | FromDiscord_ | <Elegant Beef> Also would require having support for many languages as far as i can see |
09:13:21 | FromGitter | <jorjun_twitter> @Elegant Beef oo great idea to grab bootstrap with existing solutions. Then I wonder how hard it is to add "fair instrumentation" all the different runtimes. |
09:13:22 | Araq | timotheecour: and then we have .incompleteStruct for when sizeof is not available |
09:13:26 | FromGitter | <timotheecour> right but Iβm enabling CT sizeof for types that are explicitly whitelisted as being complete; and for these, a static_assert will check for that |
09:14:02 | FromGitter | <timotheecour> `incompleteStruct` doesnβt work at all, because itβs the wrong default (as i showed) |
09:14:25 | Araq | sure but it isn't the default, so there is no design flaw here |
09:14:32 | dchem | PMunch, thank you. That's weird |
09:14:40 | FromDiscord_ | <Elegant Beef> Yea, i actually think any CS projects in schools should be done with the stdin/stdout methods, since forcing the usage of a single language when you might know many/dont like the language they use is weird |
09:15:31 | FromGitter | <timotheecour> the default should mean incompleteStruct, and incompleteStruct is or should be in fact a noop; the non-default is explicit `completeStruct` |
09:15:42 | FromDiscord_ | <Rika> Slr, PMunch, the one like in RxJava, and I figured it would be possible in Nim, I just don't know where to start coding one |
09:15:59 | Araq | timotheecour: so what's the original problem again? |
09:16:12 | Araq | you want to check if we got an .importc'ed definition right? |
09:16:21 | FromGitter | <timotheecour> enabling CT sizeof, and checking for it |
09:16:42 | FromGitter | <jorjun_twitter> @EB My older broβ trying to sell me Elixir to me, and I take a look at it and feel complete disgust at the syntax. I really think that people will go for the language they can tolerate the look of, and thatβs fine. |
09:17:01 | FromGitter | <alehander92> @jorjun_twitter i liked elixir before, it's elegantly simple with its macro system |
09:17:08 | FromGitter | <timotheecour> and fixing the pre-existing bugs that weβve silently had in the past where we claim a type has sizeof x but in fact has sizeof != x |
09:17:22 | Araq | but CT sizeof for .importc is very dangerous |
09:17:23 | FromGitter | <alehander92> the syntax was very ruby-like + `|>` |
09:17:24 | FromGitter | <jorjun_twitter> But there has to be some engineering in there, too. And schools have to try not to oppress budding talent making it crawl around on the floor |
09:17:45 | FromGitter | <jorjun_twitter> Yes, he is a ruby geek. I just can BEGIN and END with that s** |
09:18:08 | dchem | PMunch, is there a flag to get more detailed compiler error? I'm really lost here. Thank you. |
09:18:45 | PMunch | Rika, well I guess you would need some data structure to drop data into. And some wrapper that makes asynchronous methods able to put things into this data structure. |
09:19:08 | PMunch | And a way to save callbacks for things to be inserted into the structure |
09:19:30 | FromDiscord_ | <Elegant Beef> Yea jorjun it's a silly thing to me to have any requirement on language, like who the fuck cares what int/int equals in language x |
09:20:07 | FromDiscord_ | <exelotl> I do wish the .size pragma would work for importc'd objects, rather than just enums. There are cases where I know exactly how big a type is (due to hardware / library / toolchain guarantees), but still can't do sizeof at compile time |
09:20:08 | PMunch | dchem, not really. If you post the full error message and a code snippet there probably is enough information to figure out what has gone wrong |
09:20:22 | FromDiscord_ | <Rika> Wait, so something similar to streams? |
09:20:33 | FromDiscord_ | <Rika> Man reactive is hard to understand |
09:20:42 | FromDiscord_ | <Elegant Beef> Anyway, yea rosetta code could be a good base, assuming it's not locked down due to licensing, since it's got a ton of challenge solutions, the big thing would be getting many language compilation support |
09:21:00 | FromDiscord_ | <Elegant Beef> compilation/runtime* |
09:21:07 | FromDiscord_ | <Elegant Beef> Anyway i sleep now, buh bye |
09:21:37 | PMunch | Rika, kinda, but not really. And it's not that difficult. It's basically setting up callback for things that can update, and propagating the updates in a reasonable manner |
09:22:02 | FromGitter | <jorjun_twitter> @EB yep, I find it fascinating that there are so many distinct temperaments. Worth finding out which language appeals. I might make a facility. Last opus was a photographer competition site. But itching to make another community for coders. |
09:22:28 | * | couven92 quit (Ping timeout: 265 seconds) |
09:22:41 | FromGitter | <jorjun_twitter> Some people just need introducing to good taste of course... |
09:22:41 | Araq | timotheecour: I'm merging it but the cost is you get to update the documentation and write some very precise docs |
09:22:43 | FromGitter | <timotheecour> @araq the danger is much mitigated by fact that C compiler checks for it at C compile time via static_assert , with this this PR. And itβs opt-in anyways. And weβre already relying on this feature with types that have `{.importc, size:8.}` (for eg ) or `type Foo {importc} = cint`; and Iβve shown that thanks to this PR, we can identify existing violations. |
09:23:02 | FromGitter | <timotheecour> sure, i can do that |
09:23:15 | FromDiscord_ | <Rika> PMunch: reasonable? What is an unreasonable manner |
09:24:06 | PMunch | I dunno :P |
09:24:10 | * | couven92 joined #nim |
09:24:13 | skrylar[m] | well'p. gave v a short spin on windows. windows kept complaining about "security scans", had one instance of its cache files corrupt and need manual deleting, and hot code reloading didn't work. cest la vis. |
09:24:23 | PMunch | Setting up a socket for everything and sending all your data through the Tor network? |
09:24:31 | PMunch | That would be pretty unreasonable |
09:24:56 | FromGitter | <timotheecour> @araq thanks |
09:25:26 | dchem | PMunch, https://paste.debian.net/1142393/ |
09:25:46 | Araq | so ... it's PR week, not sure if #nim noticed |
09:26:00 | Araq | the plan is to get below 100 open PRs |
09:26:08 | PMunch | Oh neat |
09:26:09 | FromDiscord_ | <Rika> There are articles everywhere on how to use reactive programming but none that I know of about how to implement them |
09:26:26 | Araq | Rika: ask skrylar[m], he did it well iirc |
09:26:36 | PMunch | I feel like that's often the case Rika |
09:26:52 | skrylar[m] | cobweb never actually got finished because i was fighting the type system at the time, buuuut |
09:27:04 | skrylar[m] | Β―\_(γ)_/Β― basically you just need toposort |
09:27:29 | FromDiscord_ | <Rika> ???? |
09:27:54 | skrylar[m] | well reactive programming is literally just reacting to events, and works kinda the same as how spreadsheets work |
09:28:06 | FromDiscord_ | <Rika> Good analogy |
09:28:10 | skrylar[m] | you have a value node and add edges for things the value depends on to be updated |
09:28:14 | Araq | karax has ReactiveSeq and stuff |
09:28:28 | Araq | and I wrote "todo" with Karax Reactive |
09:28:38 | FromDiscord_ | <Rika> Oh no, graphs, I'm no good at that |
09:28:49 | Araq | I think the code is somewhere under /experiments |
09:28:54 | skrylar[m] | they're not complicated really |
09:29:23 | skrylar[m] | values have <-> relations with other values, and when you update one you iteratively trigger the other values watching that |
09:29:39 | skrylar[m] | and maybe throw in a little topological sorting to check for abberant geometry in the graph |
09:30:16 | skrylar[m] | if you promise not to make infinite loops you can do it with simple seqs and barely any code |
09:30:16 | Araq | you need to watch out for infinite update events, A updates B which causes A to update which ... |
09:30:45 | Araq | in my experience with vue.js that problem quickly became intractable |
09:30:51 | dchem | PMunch, sorry, I should have included that I'm using nim 1.2.0 |
09:30:59 | skrylar[m] | yea i dunno how spreadsheets deal with cycles like that. i think most of them just go "NO." and refuse to propagate |
09:31:16 | FromDiscord_ | <Rika> google sheets limits propagations afaik? |
09:31:21 | Araq | but I was also forced to write the code in the most convoluted way possible, so my experience is very biased |
09:32:00 | Araq | skrylar[m]: in most programming systems there is a 'onNextTick' thing for it |
09:32:06 | skrylar[m] | recursive data exists sometimes like meeks algorithm where you have to sit there and iteratively crunch the same things until they settle down but |
09:32:28 | skrylar[m] | delaying propagation by one yeah. vcv rack does this |
09:32:31 | FromGitter | <timotheecour> meh, i actually like karax, there are bugs that should be fixed but itβs useful and I donβt know of a better existing alternative |
09:32:39 | skrylar[m] | all values go in to "cables" so each conncetion creates a one frame propagation lag |
09:32:57 | Araq | I recently fixed the most pressing Karax bugs |
09:33:04 | Araq | but Karax is DOM diffing, not reactive |
09:33:25 | FromDiscord_ | <Rika> @_@ |
09:33:37 | FromDiscord_ | <Rika> am overwhelmed now |
09:33:38 | * | couven92 quit (Ping timeout: 256 seconds) |
09:33:41 | skrylar[m] | what i did was have a single cobweb object and the expectation is you use that to connect value objects, which are just generic boxes, because then the cobweb object is able to watch out for stupidity. but also, double effort you can use something like skyblue https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.8935 |
09:34:05 | Araq | I'm a huge fan of immediate mode UIs, DOM Diffing emulates to a good extend |
09:34:16 | PMunch | dchem, probably need to mark that procedure as {.async.} |
09:34:28 | skrylar[m] | skyblue is capable of being told several possible dependencies of a constraint, and it will work out which ones need to be re-routed and which ones have to be disabled, so you can get a little further with the dataflow that way |
09:34:34 | Araq | and for me reactive tries to do the same as immediate mode and fails |
09:34:48 | skrylar[m] | its beautiful when it works |
09:35:13 | Araq | immediate mode is more beautiful and works more often ;-) |
09:35:37 | skrylar[m] | bacon.js is also one to look at; its kinda basic but it gets the point across |
09:36:17 | dchem | PMunch, using {.async.} and then doing result = await newWeb3(uri) returns type mismatch: got <Future[web3.Web3]> but expected 'Web3 = ref Web3:ObjectType' |
09:36:54 | PMunch | Hmm |
09:36:59 | dchem | PMunch, sorry the output was type mismatch: got <Future[web3.Web3]> but expected 'FutureBase = ref FutureBase:ObjectType' |
09:37:18 | * | couven92 joined #nim |
09:37:42 | dchem | It's possible that it's web3 project issue, I'm not too familiar with future and asyncdispatch yet, so I dn |
09:39:10 | dchem | I don't know what is the prefered way to write {.async.} compatible functions - putting together toy examples without web3 works just fine, and using the await newWeb3(uri) in another context works just OK |
09:39:52 | dchem | but not if I'm trying to make a separate proc that just returns future |
09:40:32 | * | bra-ket quit (Ping timeout: 265 seconds) |
09:41:08 | FromDiscord_ | <Rika> skrylar so what made you archive cobweb |
09:41:21 | dchem | I mean nesting an async function that returns future within a async function that returns future should just be returning either the yield val or doing it as await |
09:42:11 | dchem | PMunch, thank you in any regard. |
09:43:57 | Araq | Clyybber: found the cycle collector problem |
09:44:36 | skrylar[m] | @Rika i went to rust for a while, but also dealing with variant objects was getting to be a pain. might be able to unarchive it and fiddle with it at some point |
09:44:57 | Araq | it's the old "freelist" problem, the paper uses a freelist and we don't. a freelist turns "accesses freed memory" into a valid operation |
09:45:00 | skrylar[m] | i also didn't really understand how stuff like skyblue worked and had no help at the time, so i had to grind through things like the cassowary paper for a month |
09:46:48 | Araq | fun fact: Facebook's Reactive framework isn't "reactive programming" |
09:47:39 | skrylar[m] | its funny that im the one who nudged the Red guys in to adding frp stuff and now they list it as a front page feature |
09:48:53 | skrylar[m] | i seem to remember having issues storing types in value objects |
09:53:18 | * | Vladar joined #nim |
09:54:26 | * | letto joined #nim |
09:59:54 | * | hax-scramper quit (Ping timeout: 240 seconds) |
10:01:08 | FromDiscord_ | <mratsim> well types aren't concrete ... |
10:01:21 | * | hax-scramper joined #nim |
10:01:21 | FromDiscord_ | <mratsim> but isn't "PhantomData" used for that? |
10:02:21 | FromGitter | <alehander92> hmm |
10:13:54 | skrylar[m] | i dunno but cobweb was like, nim 0.17 too |
10:16:23 | * | PMunch quit (Quit: leaving) |
10:25:43 | * | opal quit (Ping timeout: 240 seconds) |
10:27:14 | * | lritter quit (Ping timeout: 240 seconds) |
10:34:40 | * | abm joined #nim |
10:36:07 | * | krux02 joined #nim |
10:42:34 | * | PMunch joined #nim |
10:56:03 | * | natrys quit (Ping timeout: 260 seconds) |
10:56:10 | * | inv2004 joined #nim |
11:00:17 | inv2004 | Hello, How to get second int byte from structure? |
11:00:17 | inv2004 | cast[UncheckedArray[cint]](x.k)[1] does not compile |
11:00:25 | inv2004 | I use kind variant, but I do not want to do big case just to extract the same number from different kinds |
11:00:49 | PMunch | Second int byte? |
11:00:58 | PMunch | What's an "int byte"? |
11:01:08 | inv2004 | ah, sorry |
11:01:14 | inv2004 | second int position |
11:01:28 | FromDiscord_ | <Rika> what structure |
11:02:05 | inv2004 | a: char, b: char, kind: char, c: char, iNeedThisInt: int |
11:02:32 | inv2004 | ptr object ... |
11:03:20 | FromDiscord_ | <Recruit_main707> does openArray change anything? |
11:03:25 | FromDiscord_ | <Rika> im still heavily confused |
11:03:29 | dchem | ok, so it's status-im people with their own "chronos" library that is causing the problem I mentioned earlier |
11:03:29 | FromDiscord_ | <Rika> @Recruit_main707 wdym? |
11:03:48 | dchem | can't use asyncdispatch with nim-web3 library |
11:03:59 | FromDiscord_ | <Recruit_main707> instead of uncheckedArray OpenArray |
11:05:06 | FromGitter | <alehander92> dchem they are relatively similar |
11:05:09 | FromDiscord_ | <Rika> openarray isnt a real type isnt it? |
11:05:10 | FromGitter | <alehander92> chronos and asyncdispatch |
11:05:25 | dchem | Yes, but it's causing issues with compilation on 1.2.0 |
11:05:34 | FromGitter | <alehander92> hm, chronos should work on 1.2.0 iirc |
11:05:43 | FromGitter | <alehander92> i think status upgraded their code to 1.2.0 |
11:05:52 | FromDiscord_ | <Recruit_main707> Rika: oh right, he should use toOpenArray() |
11:05:52 | dchem | I mean you can use either chronos or asyncdispatch, but not both |
11:06:24 | PMunch | Something like this? https://play.nim-lang.org/#ix=2jbt |
11:06:37 | PMunch | inv2004_ ^ |
11:06:44 | FromGitter | <alehander92> dchem oh, i guess it would be hard to use both |
11:06:49 | PMunch | Note that I wouldn't recommend that.. |
11:07:03 | FromDiscord_ | <Recruit_main707> inv2004: can you show us the code? |
11:07:45 | FromDiscord_ | <clyybber> Araq: Oh, nice. I was just about to start looking at it. |
11:08:01 | Araq | however, nothing I do works |
11:09:30 | * | natrys joined #nim |
11:11:53 | inv2004 | PMunch, looks like (array[2, x])[1] works, Thank you |
11:12:21 | PMunch | Yes, that would work to get the second int field |
11:12:30 | PMunch | Still, wouldn't recommend it though.. |
11:12:39 | inv2004 | why UncheckedArray does not work ? |
11:12:51 | FromDiscord_ | <mratsim> you need to use ptr UncheckedArray |
11:12:55 | FromDiscord_ | <Recruit_main707> ^ |
11:15:41 | PMunch | Hmm https://play.nim-lang.org/#ix=2jby |
11:15:58 | PMunch | What is up with the data in there.. |
11:16:08 | PMunch | The 0th field should be the kind no? |
11:16:37 | PMunch | Ah, nvm.. |
11:16:56 | PMunch | The TestKind enum is sizeof 1 and the rest is just alignment |
11:17:13 | PMunch | So uninitialised data |
11:17:20 | PMunch | Makes sense |
11:22:30 | * | arecaceae quit (Ping timeout: 258 seconds) |
11:23:46 | * | arecaceae joined #nim |
11:34:11 | inv2004 | mratsim, it works, thanks, I forgot that my struct is a pointer |
11:37:58 | FromDiscord_ | <Recruit_main707> i think that has nothing to to, its just that uncheckedArray should be used with ptr iirc |
11:41:27 | * | lritter joined #nim |
11:42:36 | inv2004 | Another question: I reading this page: https://nim-lang.org/docs/destructors.html |
11:43:02 | inv2004 | But do I need any hook to inc_refs during contructor of the object ? |
11:43:28 | inv2004 | or `[]` works for constructor also? (Easy to check I suppose) |
11:46:18 | inv2004 | Misprint I mean `=` |
11:46:34 | inv2004 | Looks like it does not run for constructor |
11:57:12 | Araq | there is no constructor you can hook into |
11:57:56 | inv2004 | ok, not a big deal I think |
11:58:34 | inv2004 | Another question why =destroy is not called for the line?: https://github.com/inv2004/k_nim/blob/38c559d1640b7ed2260d0d535f94aa65dc2b5215/src/k_nim.nim#L31 |
11:59:43 | inv2004 | a bit confused: it worked before :) |
12:00:43 | * | filcuc joined #nim |
12:03:31 | * | filcuc quit (Client Quit) |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:40 | * | supakeen joined #nim |
12:09:24 | inv2004 | =sink prevent destroy. hm |
12:21:44 | Araq | your =sink needs to destroy |
12:23:18 | inv2004 | why? I thought it is move |
12:24:24 | inv2004 | it is really necessary to define =sink? Or I can make first implementation without it and it will work with =destroy only? |
12:25:05 | Araq | iirc =sink is inferred these days |
12:26:24 | inv2004 | but cannot understand why should I copy destroy into sink, or maybe I misunderstood something |
12:27:14 | * | opal joined #nim |
12:27:15 | Araq | read our documentation please |
12:28:07 | Araq | in imperative programming languages the assignment is destructive, it destroys the old value, both = and =sink need to clean up what was previously in the memory cell |
12:28:23 | Araq | it's fundamental. |
12:47:39 | * | dddddd joined #nim |
12:48:23 | * | liblq-dev quit (Read error: No route to host) |
12:49:49 | FromDiscord_ | <exelotl> Is there a tutorial for this stuff that explains the basics? I feel like I've only seen plans/proposals but they assume familiarity with the subject and I'm not sure how it compares to what actually got implemented |
12:49:53 | * | CcxWrk quit (Quit: ZNC 1.7.4 - https://znc.in) |
12:53:58 | FromDiscord_ | <exelotl> Looking at that destructors doc it seems clearer than last time, but still not sure about the lent or owned stuff. Is that still relevant? |
12:54:57 | * | CcxCZ quit (Quit: WeeChat 2.4) |
12:55:12 | * | CcxWrk joined #nim |
12:56:40 | * | CcxCZ joined #nim |
13:00:04 | Araq | 'owned' is currently not a thing, 'lent' is under-used |
13:00:18 | * | Hideki_ joined #nim |
13:00:24 | Araq | you can ignore both |
13:04:30 | Araq | exelotl: we don't have a tutorial yet but the summary would be "use --gc:arc, everything else is details you can ignore" |
13:05:04 | * | Hideki_ quit (Ping timeout: 256 seconds) |
13:14:01 | Faulander | huch, ist github down? |
13:15:05 | FromDiscord_ | <clyybber> not for me |
13:15:33 | FromDiscord_ | <clyybber> oh, doch.. |
13:16:51 | PMunch | Yup, it's down: https://www.isitdownrightnow.com/github.com.html |
13:17:22 | Faulander | ok, good to know. |
13:17:22 | * | hax-scramper quit (Read error: Connection reset by peer) |
13:17:25 | Araq | clyybber: I am beginning to think the algorithm cannot be saved |
13:17:33 | * | hax-scramper joined #nim |
13:17:44 | Araq | even if correct, it suffers from lots of other problems |
13:18:37 | FromDiscord_ | <clyybber> what problems? |
13:19:10 | Araq | heavily shared nodes are 'yellow' all the time and incur the trial deletion overhead |
13:19:57 | Araq | (which is enormous for 'havlak') |
13:20:23 | PMunch | Faulander, sees to be back up now |
13:20:55 | Araq | both 'incRef' and 'decRef' have even more instruction inside, so inlining them cause more code bloat |
13:21:01 | Araq | *instructions |
13:21:47 | PMunch | Eh, maybe not.. |
13:21:57 | * | rockcavera joined #nim |
13:22:10 | Araq | PMunch: it's down for me too |
13:26:46 | FromDiscord_ | <clyybber> Araq: Maybe we will get some optimization ideas after getting it to work |
13:28:33 | Araq | but we have these optimization ideas |
13:28:52 | Araq | they amount to "copy Python's algorithm, it's better" |
13:30:04 | Araq | for Nim's case this means we introduce (un)registerPotentialCycle() operations and let the user-land deal with the problem |
13:30:45 | Araq | want a cycle collector? import std / cyclecollector |
13:32:30 | FromDiscord_ | <clyybber> Araq: We could also make it opt in, via marking the objects as {.cyclic.} |
13:32:56 | Araq | we can't really. the hard cycles are introduced by closures |
13:32:58 | FromDiscord_ | <clyybber> Or we try to prove as "hard" as possible that its {.acyclic.}, possibly via drnim? |
13:33:19 | * | fredrik92 joined #nim |
13:33:22 | FromDiscord_ | <clyybber> Araq: Hmm. Do you know how rust solves the closure problem? |
13:33:30 | * | zacharycarter joined #nim |
13:33:42 | * | Romanson joined #nim |
13:33:55 | Araq | I know how Swift does it but I don't think it's applicable for Nim |
13:34:20 | * | couven92 quit (Disconnected by services) |
13:34:25 | * | fredrik92 is now known as couven92 |
13:35:10 | companion_cube | clyyber: rust creates a new (anonymous) type for each closure |
13:35:42 | companion_cube | that's why you can write `fn map<F:Fn(A)->B>(v: Vec<A>, f: F) -> Vec<B> {β¦}` |
13:35:59 | companion_cube | oops, should be `<A, B, F:Fn(A)->B>` |
13:36:07 | FromDiscord_ | <clyybber> companion_cube: Oh yeah, I mean how it handles capturing/cycles introduced by closures |
13:36:08 | companion_cube | because the type of `f` is itself a type variable |
13:36:16 | companion_cube | cycles are impossible |
13:36:30 | companion_cube | capturing is done either by reference, in which case the borrow checker must agree |
13:36:42 | companion_cube | or by move (a move closure), in which case it moves inside the closure whatever's captured |
13:36:50 | companion_cube | typically needed for spawning a thread |
13:37:07 | companion_cube | `thread::spawn(move || { β¦ })` as you can't borrow from another thread's stack |
13:37:42 | FromGitter | <alehander92> `move ||` is a syntax sugar, but is there a way to do it more granulary |
13:37:53 | FromGitter | <alehander92> e.g. `|a is moved, b is borrowed|` |
13:38:24 | * | Ven`` quit (Quit: Textual IRC Client: www.textualapp.com) |
13:38:29 | Araq | well we had pretty much the same solution with 'owned ref', 'owned proc' |
13:38:53 | Araq | problem is that our legacy code doesn't work with it |
13:39:32 | FromDiscord_ | <Venator> Can someone point me to any documentation about how C types map on to Nim types? Seems like an import subject which is only touched on in the manual and backends document, unless I've missed it. |
13:39:50 | companion_cube | alehander92: really? :o |
13:39:55 | companion_cube | what's the syntax for that? I didn't know |
13:40:08 | companion_cube | do you just annotate the types? |
13:40:55 | * | Hideki_ joined #nim |
13:41:21 | PMunch | Venator, what do you mean? |
13:41:45 | PMunch | Like what is a C int in Nim? Or more like "what is this struct" in Nim? |
13:41:52 | PMunch | Or the other way around? |
13:42:28 | FromDiscord_ | <Venator> What is a C int and a C struct in Nim |
13:42:41 | FromDiscord_ | <Venator> when calling out via FFI for example |
13:43:00 | PMunch | Well most C types simply have c placed in front of them in Nim |
13:43:14 | PMunch | So an int is a cint, an unsigned int is a cuint, etc. |
13:43:52 | PMunch | Objects in Nim are pretty analogous to a structure in C. They don't contain anything extra so they map one to one for the simple case. |
13:44:19 | PMunch | With variant objects and generics it gets a tad more complicated |
13:44:52 | PMunch | Variant objects can be thought of as a structure with a union in them. And generics just create a copy of the struct for each distinct type. |
13:46:07 | PMunch | char * can be expressed as cstring as well, not just ptr char. With cstring Nim will treat it as a zero-terminated string, with ptr char it will treat it as a single character. |
13:46:21 | PMunch | If you need void * you can use `pointer` in Nim |
13:46:23 | FromDiscord_ | <Venator> That may be enough for me then, the API I want to use is fairly straightforward and uses ints, floats, strings (const char*) and simple structs |
13:47:20 | PMunch | Yeah, then these should be pretty much what you need: https://nim-lang.org/docs/system.html#clong |
13:47:34 | PMunch | I guess this should be summed up in an article |
13:48:31 | FromDiscord_ | <Venator> Yeah, the manual mentions cstring and cint but never defines them really, a more comprehensive C mapping doc would be nice I think |
13:50:16 | * | NimBot joined #nim |
13:51:17 | companion_cube | or rather, you can make an explicit reference, and capture *that* by move if needed, I imagine |
13:51:29 | companion_cube | but if you use a move closure it's probably because it's going to live longer than your stack frame |
13:57:13 | * | sz0 quit (Quit: Connection closed for inactivity) |
13:57:40 | FromGitter | <alehander92> but doesn't that happen very often |
13:58:37 | FromGitter | <alehander92> probably most of the time with callbacks/etc except for functional code like map/filter chains |
13:58:37 | companion_cube | depends what you use the closure for, I guess |
13:58:47 | companion_cube | ah well, callbacks suck, I guess |
13:58:51 | FromGitter | <alehander92> that would be a good thing to coverage |
13:59:00 | companion_cube | but then you allocate some place to put your closure, a Box or something like that |
13:59:02 | FromGitter | <alehander92> lifetime of closures in a run |
13:59:04 | companion_cube | and use a move closure |
14:00:32 | inv2004 | ah, just understood that is was about destroy destination of = and =sink |
14:01:20 | FromGitter | <alehander92> companion_cube interesting |
14:01:25 | Araq | inv2004: please write a short article about your findings, we need an arc tutorial |
14:02:05 | inv2004 | :))) |
14:03:30 | companion_cube | alehander92: it's also interesting that the "default" is by borrow, which is enough for most iter/map/filter things |
14:03:49 | * | Hideki_ quit (Ping timeout: 264 seconds) |
14:04:13 | disruptek | #13926 |
14:04:14 | disruptek | nice! |
14:04:16 | disbot | https://github.com/nim-lang/Nim/pull/13926 -- 6CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static checks ; snippet at 12https://play.nim-lang.org/#ix=2jcQ |
14:08:01 | Araq | companion_cube: if only this were true... the default is by "I take ownership" when you use the plain 'T' as a parameter. you have to use pointers everywhere else. ok, they are borrowed and safe but it's cumbersome |
14:10:27 | shashlick | heh dev is blocked with github down |
14:11:21 | inv2004 | I started first part of the manual "how to set random ref_inc() and ref_dec() and run it until your program works" |
14:12:41 | Araq | er... ok. |
14:17:34 | * | nortti joined #nim |
14:19:10 | FromDiscord_ | <UNIcodeX> GitHub seems to be working for me |
14:20:34 | companion_cube | Araq: not in closures, afaik |
14:33:33 | disruptek | pro streamer tip no. 43: always lick your earbuds before insertion; makes for a solid 8hr seal. |
14:33:42 | * | nortti left #nim ("Anthropologa se non exstare reperit. Solum exstat pyramis ingens mechanica.") |
14:35:10 | companion_cube | sexy tip |
14:37:05 | inv2004 | seconds part of my GC interop manual: "when you debug rc in =destroy - it works perfect, if you remove it - it starts to leak" |
14:38:06 | disruptek | lick first for a tighter seal. |
14:38:15 | disruptek | it's like i'm talking to a wall in here. |
14:38:56 | shashlick | the seal's too tight so you cannot hear the ack |
14:39:48 | inv2004 | but you can see it |
14:40:11 | companion_cube | he also licked his eyelids |
14:40:39 | FromDiscord_ | <Rika> the seal was so pleasurable their eyes rolled back |
14:40:43 | shashlick | unlike ears, you gotta look |
14:41:24 | disruptek | earballs be rollin' win i git on the mic |
14:44:27 | disruptek | shashlick: is there a 1.2 branch in choosenim? |
14:44:49 | shashlick | branch? |
14:45:01 | disruptek | for the purposes of ci |
14:45:14 | shashlick | probably ot |
14:45:18 | * | lmariscal quit (Quit: I'm Out!) |
14:45:24 | disruptek | doesn't matter. |
14:45:44 | disruptek | today we're gonna try something new. |
14:46:13 | disruptek | compiler code with minimal surface. |
14:46:22 | disruptek | a whole new world of challenge. |
14:46:27 | * | lmariscal joined #nim |
14:47:07 | * | lmariscal quit (Client Quit) |
14:47:27 | * | lmariscal joined #nim |
14:49:29 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
14:50:41 | * | kitech1 joined #nim |
14:52:49 | * | Vladar quit (Quit: Leaving) |
14:55:09 | disruptek | ~stream |
14:55:10 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:56:59 | lmariscal | https://reg.nim.moe/packages.json is a packages.json for nimble that acts as a mirror for all of nim packages |
14:57:03 | lmariscal | it is running on a low budget vps so it's mostly an idea that I have (would like to expand it in the future) |
14:57:07 | lmariscal | it also converts mercurial repos to git repos like linagl https://cgit.nim.moe/linagl |
14:57:11 | lmariscal | it updates the packages every 30 mins and the packages.json every 10 mins |
14:57:17 | lmariscal | you can find the cron jobs in https://github.com/nim-moe/cron if you want to create your own |
14:58:27 | dom96 | lmariscal, awesome! |
14:58:28 | disruptek | or, just run nimph. |
15:01:16 | * | martinium_laptop joined #nim |
15:01:24 | martinium_laptop | boom |
15:01:30 | martinium_laptop | Morning everyone |
15:01:47 | FromDiscord_ | <Rika> gm o you |
15:01:49 | FromDiscord_ | <Rika> to* |
15:01:57 | martinium_laptop | Good afternoon for those across the pond |
15:02:01 | martinium_laptop | :D |
15:03:12 | FromDiscord_ | <Rika> no good evening for us? |
15:03:25 | FromDiscord_ | <Rika> (tbf, its night here) |
15:03:57 | martinium_laptop | Good evening Rika |
15:04:00 | martinium_laptop | :) |
15:04:06 | Prestige | good morning/evening :P |
15:09:01 | * | waleee-cl joined #nim |
15:10:33 | FromDiscord_ | <UNIcodeX> Could just employ the generic "good day" |
15:12:01 | FromDiscord_ | <Rika> what if i lived in a planet with no concept of days, hm? |
15:18:55 | * | xcm quit (Remote host closed the connection) |
15:20:38 | Araq | disruptek: nimph doesn't mirror packages, does it? |
15:20:47 | disruptek | mirror? |
15:21:11 | * | xcm joined #nim |
15:21:20 | Araq | it's the proper term, I don't understand the question, I'm sure you know it |
15:21:44 | disruptek | nimph doesn't have a package file, though it knows to grok nimble's. |
15:22:31 | FromDiscord_ | <UNIcodeX> > what if i lived in a planet with no concept of days, hm? |
15:22:31 | FromDiscord_ | <UNIcodeX> @Rika Error: OutOfBounds |
15:24:50 | FromGitter | <zetashift> But https://reg.nim.moe/packages.json also has a 'copy'/mirror of the nimble packages, I didn't read that nimph does that too? |
15:27:06 | Demos[m] | someone needs to clone raku (perl6's) MAIN sub |
15:28:04 | FromDiscord_ | <Rika> MAIN sub? |
15:28:59 | FromGitter | <zetashift> you mean this: https://docs.raku.org/routine/MAIN ? isn't this just a fancy isMainModule with docopt or something?? |
15:29:47 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
15:29:50 | leorize | !repo cligen |
15:29:51 | disbot | https://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces 15 171β 12π΄ 7& 1 more... |
15:30:12 | leorize | it's literally this but look nicer by default |
15:30:38 | * | kitech1 joined #nim |
15:33:04 | FromDiscord_ | <Venator> what does the method {.base.} pragma do? - apart from stop the compiler complaining that baseless methods are deprecated? The manual uses it but does not explain from what I can see |
15:33:46 | FromGitter | <bung87> @Araq I'v done the work , yesterday we disscussed. |
15:34:00 | leorize | Venator: telling the compiler what to dispatch to dynamically when the type it's not overridden for the current type afaict |
15:35:13 | disruptek | Araq: nimph just searches github for packages. |
15:35:34 | disruptek | i will use this other one if people like it. |
15:37:04 | Araq | bung87: link to your PR? |
15:37:26 | Araq | disruptek: there is an inherent danger of people deleting their repos from github |
15:37:28 | FromGitter | <bung87> https://github.com/bung87/htmlparser I upload it here. |
15:37:39 | disruptek | that's a risk i'm willing to take. |
15:37:51 | FromGitter | <kaushalmodi> @bung87 I cannot see the exact commit fixing that issue |
15:37:56 | Araq | bung87: thanks but that's what 'fusion' is about to fix |
15:38:11 | Araq | your package lacks CI and didn't get a review process |
15:39:05 | FromGitter | <bung87> so leave it just there is fine ? |
15:39:53 | FromGitter | <bung87> also need fix the `runnableExamples` |
15:39:56 | Araq | no... I mean, it's nice that you did it but it's not what I had in mind |
15:40:39 | Araq | ping me about in the next two days please, I'm busy with something else |
15:40:44 | Araq | for now it's good |
15:41:48 | FromGitter | <bung87> create pr that I'll rename the xmltree lib name as it specific to html now |
15:42:35 | FromGitter | <bung87> ok , just leave it for now utill you be free |
15:42:45 | * | kenran quit (Ping timeout: 256 seconds) |
15:44:02 | FromGitter | <bung87> @kaushalmodi It'll fix all the opened issues that contains `htmlparser` |
15:44:18 | * | hax-scramper quit (Ping timeout: 265 seconds) |
15:47:49 | * | Vladar joined #nim |
15:50:13 | Araq | narimiran: close https://github.com/nim-lang/Nim/issues/14026 please |
15:50:13 | disbot | β₯ CI broken for release branches (version-1-0, version-1-2) |
15:50:45 | narimiran | yep |
15:52:05 | martinium_laptop | does the order functions are declared in a nim program matter? |
15:52:17 | FromDiscord_ | <mratsim> yes |
15:52:23 | FromDiscord_ | <mratsim> you need to forward declare |
15:52:41 | martinium_laptop | meaning to declare above before calling? |
15:52:52 | FromGitter | <bung87> unless you using reorder pragma |
15:54:22 | * | nsf quit (Quit: WeeChat 2.8) |
15:54:23 | FromGitter | <bung87> https://nim-lang.org/docs/manual.html#scope-rules-code-reordering |
15:55:06 | leorize | it's beter to forward declare |
15:55:13 | leorize | it works better for macros atm |
15:56:44 | * | fredrik92 joined #nim |
15:57:45 | * | couven92 quit (Disconnected by services) |
15:57:53 | * | fredrik92 is now known as couven92 |
15:58:09 | planetis[m] | guys what do you think: https://gist.github.com/b3liever/d1571d25917e670e9882e48618d6a834 |
15:58:38 | planetis[m] | its a template that unwraps an (bool, T) tuple |
15:58:57 | * | NimBot joined #nim |
15:59:01 | zacharycarter | using Nim in our hackathon project at work today for an AWS lambda function |
15:59:49 | leorize | planetis[m]: you can use `bind` to bind `isNil` so you don't have to do the system.`!=` dance |
16:00:30 | leorize | zacharycarter: are you winning? |
16:00:32 | planetis[m] | though I read here that isNil is going to be booted |
16:00:50 | leorize | you can also bind `==` and `!=` if that's more of your thing :P |
16:03:00 | planetis[m] | no idea what bind does, will read about it |
16:03:09 | FromGitter | <alehander92> huh crafty |
16:03:18 | Prestige | zacharycarter: Nice! I should do that at our next hackathon |
16:03:37 | FromGitter | <alehander92> still i'd prefer to use a single Result/Option type if i can |
16:04:07 | FromGitter | <alehander92> and let it be represented by the value itself for pointers |
16:04:41 | FromGitter | <alehander92> and for range ints (where one can use start - 1 or end + 1 for invalid) |
16:05:32 | FromGitter | <alehander92> we almost never need the full int range anyway |
16:05:45 | leorize | yea that's how Option[T] is declared |
16:05:53 | FromGitter | <alehander92> but i doubt it works for int |
16:05:59 | FromGitter | <alehander92> ranges like that |
16:06:02 | planetis[m] | btw i got the ?= operator idea from a test in Nim |
16:06:03 | FromGitter | <alehander92> / uint etc |
16:06:13 | leorize | it works for Natural and Positive :P |
16:06:39 | FromGitter | <alehander92> hmm and Option still is a struct with val |
16:06:42 | FromGitter | <alehander92> even for pointers |
16:06:55 | Prestige | LOL |
16:07:01 | Prestige | Wrong chat |
16:07:08 | FromGitter | <alehander92> what i thought people want is Option*[T: SomePointer] = T |
16:07:17 | FromGitter | <alehander92> distinct T * maybe |
16:08:07 | leorize | alexander92: https://github.com/nim-lang/Nim/blob/devel/lib/pure/options.nim#L71 |
16:08:16 | FromGitter | <alehander92> no no no |
16:09:27 | leorize | a struct with only a val have zero overhead |
16:09:44 | leorize | compared to the val alone |
16:10:14 | FromGitter | <alehander92> forgive me |
16:10:18 | FromGitter | <alehander92> yeah i understand you now! |
16:10:19 | FromGitter | <alehander92> thanks |
16:10:26 | FromGitter | <alehander92> but still i wonder about the `some` case |
16:11:05 | FromGitter | <alehander92> because it is `create a separate struct and copy the val there` vs `just use the val` |
16:11:27 | FromGitter | <dumjyl> it throws or something if given nil |
16:12:01 | FromGitter | <alehander92> that's fine |
16:12:05 | leorize | create a struct and copy the val there have zero overhead compared to just use the val for pointers :P |
16:12:47 | leorize | a struct with one element is the element itself, literally |
16:13:00 | leorize | sizeof() both of them and you'll find that they are equal |
16:13:05 | FromGitter | <alehander92> i know |
16:13:08 | leorize | inspect machine code and yea, same story :p |
16:13:24 | FromGitter | <alehander92> i mean i realized it after your previous messages sorry :P |
16:13:28 | FromGitter | <alehander92> but i wonder if |
16:13:33 | FromGitter | <alehander92> it somehow introduces +1 copy |
16:13:44 | FromGitter | <alehander92> but probably not because its a return value |
16:13:54 | FromGitter | <alehander92> in both `some` and `get` |
16:14:01 | leorize | with sink inference it will captures the input completely if allowed |
16:15:40 | FromGitter | <alehander92> and `if b1 ?= b`actually seems like something i'd use |
16:22:28 | * | hax-scramper joined #nim |
16:29:27 | FromGitter | <alehander92> thanks! |
16:30:19 | * | rockcavera quit (Ping timeout: 258 seconds) |
16:40:22 | leorize | now I finally understand while libc have a buffer inside FILE* |
16:40:43 | leorize | they have to implement getline() :P |
16:44:34 | * | ftsf quit (Ping timeout: 240 seconds) |
16:46:31 | * | rockcavera joined #nim |
16:46:31 | * | rockcavera quit (Changing host) |
16:46:31 | * | rockcavera joined #nim |
17:05:34 | * | xcm quit (Ping timeout: 240 seconds) |
17:07:33 | * | xcm joined #nim |
17:23:57 | zacharycarter | leorize: don't know yet |
17:24:19 | zacharycarter | Prestige: yeah the nim lambda github projects make it super easy to use serverless framework and get something up quick |
17:26:22 | Prestige | It would be awesome if my company would up and switch from C to nim, lol |
17:30:09 | Prestige | We mostly use JS for lambdas, and I just went through a whole ordeal convincing the CTO to let us use typescript, so nim is probably not going to happen soon :/ |
17:31:19 | * | solitudesf quit (Remote host closed the connection) |
17:31:46 | * | solitudesf joined #nim |
17:32:43 | * | inv2004 quit (Ping timeout: 260 seconds) |
17:32:45 | * | martinium joined #nim |
17:36:26 | * | thegod joined #nim |
17:36:40 | thegod | inim is breaking CI for PRs |
17:37:41 | FromDiscord_ | <Varriount> leorize: Disruptek mentioned that you might be using IO completion ports? |
17:39:54 | thegod | inim seems to have a new dependency "ansiparse" which nim CI doesnt have installed |
17:42:34 | PMunch | Added four hours ago |
17:43:06 | leorize[m] | @Varriount: yes? |
17:43:07 | narimiran | i'll fix it, thanks for the report |
17:43:26 | PMunch | Oh, and I haven't added ansiparse to nimble.. |
17:44:14 | narimiran | hmmm, nothing to fix there :/ |
17:44:48 | narimiran | inim already had some dependencies, and any new one should be automatically picked up |
17:45:03 | narimiran | thegod: which PRs are broken? |
17:49:51 | zacharycarter | Prestige: I wouldn't mind coding in C |
17:49:56 | zacharycarter | for a job |
17:50:28 | thegod | seems to be just #14084 |
17:50:30 | disbot | https://github.com/nim-lang/Nim/pull/14084 -- 3changed type() to typeof() in docs and error messages |
17:51:01 | PMunch | Added the ansiparse and ansitohtml packages to nimble (or rather created a PR for it) https://github.com/nim-lang/packages/pull/1444 |
17:51:03 | disbot | β₯ Add ansiparse and ansitohtml packages |
17:54:46 | * | rockcavera quit (Remote host closed the connection) |
17:56:20 | * | sknebel quit (Ping timeout: 256 seconds) |
17:57:04 | narimiran | thegod: i'll restart tests for that one |
17:57:19 | Prestige | zacharycarter: our code base is huge messy and old |
17:57:28 | Prestige | the people who wrote it are mostly gone, too |
17:58:44 | * | thegod quit (Remote host closed the connection) |
18:01:49 | * | sknebel joined #nim |
18:02:15 | PMunch | Prestige, that reminds me of a time at my first workplace. Went up to a guy and asked him about some code. He said he'd never seen it before. I told him that according to the git history and the author section in the files it was he who had written the whole thing. He took another look and went, oooh yeaah, now I remember this. Been a while since I've seen this old thing, no idea how it works |
18:03:08 | FromDiscord_ | <arnetheduck> @alehander42 fwiw, we just added `Opt[T] = Result[T, void]` which works out nicely - https://github.com/status-im/nim-stew/blob/master/stew/results.nim - in fact , using `Result` in Nim is pretty nice overall, the code is clean and readable, yet stresses the right things on the calling side - ie which expressions fail etc |
18:03:46 | FromDiscord_ | <arnetheduck> with `Opt[T]` being the same as `Option[T]` but with a slightly richer API |
18:04:16 | * | Trustable joined #nim |
18:06:01 | Prestige | PMunch: Lol yeah, pretty much how it goes |
18:06:23 | Prestige | even better when variable names are 1 to 3 letters long |
18:06:41 | PMunch | Of course, can't wear out that keyboard! |
18:06:53 | PMunch | Especially the vowels, those are extra precious |
18:07:21 | PMunch | But TBH I prefer that to the C# way of doing things |
18:08:04 | Prestige | What's the C# way, super long names? |
18:08:58 | PMunch | Yes, basically typing the procedure out in the name |
18:10:00 | PMunch | String StringReturnedFromCallingProcedureThatReturnsStringBasedOnWhatEnvironmentVariableHelloIs = ProcedureThatReturnsStringBasedOnWhatEnvironmentVariableHelloIs(); |
18:10:05 | FromGitter | <alehander92> arnetheduck |
18:10:23 | FromGitter | <alehander92> thanks! i had some ideas how would i like to use ` result`-like dsl in nim |
18:10:38 | PMunch | Instead of just `var hello = getEnv("HELLO")` |
18:11:12 | PMunch | And of course brackets need their own line.. |
18:11:45 | FromGitter | <alehander92> arnetheduck a thing i liked looking at zig is some kind of enum-ability / automatically making sets of call errors when you propagate them |
18:12:01 | Prestige | Yeah, the C code I work with does that too PMunch |
18:12:07 | Prestige | the brackets, I mean |
18:12:09 | * | PMunch shudders |
18:12:16 | FromGitter | <alehander92> i tried to think of a good syntax for that with `Result[]` and i think its doable |
18:13:03 | Prestige | btw thanks for that link about window managers, been really helpful |
18:13:03 | FromGitter | <alehander92> but it might be not such a big deal for most codebases where one mostly follows a strict set of errors anyway |
18:15:36 | * | abm quit (Ping timeout: 256 seconds) |
18:20:38 | * | silvernode joined #nim |
18:25:00 | * | inv2004 joined #nim |
18:25:48 | * | lritter quit (Ping timeout: 256 seconds) |
18:28:51 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:30:02 | narimiran | offtopic question: how do i escape `'` in vim config? |
18:30:23 | * | NimBot joined #nim |
18:30:24 | narimiran | (and no, `\'` doesn't do the trick) |
18:41:42 | * | kenran joined #nim |
18:54:52 | * | qwertfisch joined #nim |
18:57:54 | * | nullwarp quit (Remote host closed the connection) |
19:00:10 | FromDiscord_ | <arnetheduck> alehander42 - well, I don't know really if that's a feature or not - ie enum-as-error is moderately great - you only need it if you're going to differentiate errors in the callee, otherwise a `cstring` is fine (which you _never_ compare with, just print as a debug statement basically) |
19:01:11 | FromDiscord_ | <arnetheduck> I feel that it repeats some of the issues with exceptions, namely that it creates a leaky abstraction where errors from lower levels propagate up the call hierarchy instead of being deliberatly considered at each layer |
19:01:48 | FromDiscord_ | <arnetheduck> if abstraction is the goal, leaking errors from the depths of your application makes for a proper spaghetti sauce |
19:02:25 | FromDiscord_ | <arnetheduck> but I don't have experience really with zig - maybe it's fine |
19:04:01 | FromDiscord_ | <arnetheduck> what does happen with enum however is that you end up making "catch-all" or coarse enums that are difficult to debug: because there are multiple places in your code that return the same enum (because it's such a pita to make a new one, or keep the enum list "clean" and free from cruft), it's harder to find where the error originated from.. with `cstring`, programmers tend to type out a unique string for every error so you can grep for |
19:05:15 | disruptek | strings are useless for typechecking. |
19:05:28 | Araq | I'm a fan of a single error enum that is used for everything fwiw |
19:05:37 | disruptek | enums are create for cases. |
19:05:40 | disruptek | great, too. |
19:05:41 | Araq | it works for Posix |
19:05:53 | disruptek | copying bad design... |
19:06:27 | companion_cube | zig does that too, but it generates the whole enum automatically |
19:06:37 | companion_cube | you don't have to declare all variants in one place |
19:06:44 | Yardanico | about zig " However, each error name across the entire compilation gets assigned an unsigned integer greater than 0. You are allowed to declare the same error name more than once, and if you do, it gets assigned the same integer value." |
19:07:00 | Yardanico | https://ziglang.org/documentation/master/#toc-Errors |
19:07:13 | FromDiscord_ | <arnetheduck> I'm merely relaying experience from working with Result - tendentially, the code gets organized into units which logically either fail or work - there's rarely any middle ground that calls for an enum that you later need to case over |
19:07:17 | companion_cube | OCaml has "polymorphic variants" which are structural sum types and have similar properties |
19:07:18 | FromGitter | <bung87> Can declare multiple const with `when`? |
19:07:30 | Yardanico | @bung87 well yes, depends on what you actually mean by that |
19:07:41 | disruptek | arnetheduck: see gittyup |
19:07:44 | disruptek | !repo gittyup |
19:07:45 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 1β 0π΄ |
19:07:54 | disruptek | plenty of effective use of Result there. |
19:07:59 | disruptek | and casing. |
19:08:05 | disruptek | as enums. |
19:08:10 | FromGitter | <bung87> how to do that, I using when two times now |
19:08:12 | FromDiscord_ | <arnetheduck> so programatically, enum's only make sense if later you have `case result.error of A, B, C` |
19:08:37 | disruptek | i cannot help it if you are too lazy to write explicit code. |
19:08:49 | Yardanico | @bung87 show the code please |
19:09:08 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea1e7d43ea9b172a4866ed7] |
19:09:59 | FromGitter | <bung87> here is what I intend to do, all case are same, so I wonder if I can assign just onece |
19:10:37 | * | xcm quit (Remote host closed the connection) |
19:10:41 | * | kenran quit (Ping timeout: 265 seconds) |
19:10:51 | FromDiscord_ | <arnetheduck> disruptek - it's not so much laziness as the general strucuture of code that simply doesn't end up needing to deal with multiple failure cases in different ways - instead that function might be split up into two functions that each fail separately, and then you don't need the enum |
19:10:56 | * | abm joined #nim |
19:11:07 | FromDiscord_ | <arnetheduck> the operations become more "atomic" and binary |
19:11:09 | FromGitter | <zetashift> can't you just do `const entryType = url` then? |
19:11:11 | disruptek | then don't use Results? |
19:11:32 | FromDiscord_ | <arnetheduck> well, it's not always like this - just tendentially π |
19:11:37 | FromDiscord_ | <arnetheduck> 50% maybe |
19:11:55 | FromDiscord_ | <arnetheduck> and then it's nice to have a descriptive string around which tells you what went wrong |
19:12:03 | disruptek | exceptions. |
19:12:08 | Araq | the enum exists to make it future proof, currently it can fail with A, B, then you call baz() which can fail with C and the clients already had to swallow all possible failures :P |
19:12:12 | FromDiscord_ | <arnetheduck> then there's maybe 20% that benefit from an enum |
19:12:13 | FromGitter | <bung87> entryType is enum type |
19:12:27 | disruptek | enums in case statements test for exhaustion. this is the point. |
19:12:43 | * | xcm joined #nim |
19:12:57 | disruptek | someone tell me what i'm doing wrong with import foo / [bar, bif] syntax. |
19:13:40 | FromDiscord_ | <arnetheduck> and 20% that benefit from a complex type and finally 10% that benefit from exceptions (ie the truly exceptional cases) |
19:14:03 | FromGitter | <bung87> ok , I got it, assign entryType first then assign url |
19:14:22 | Yardanico | @bung87 when blocks don't open a new scope |
19:14:40 | Yardanico | so you can declare consts inside of "when" statements |
19:15:19 | FromDiscord_ | <arnetheduck> well, what if you don't have any cases to test for? I mean - an RSA key negotiation might be composed of 5 steps, but at the end of the day, if you don't get a secret key, you don't really care if it was the a or b key that didn't match expectations so there are really no cases to check for |
19:15:59 | disruptek | sounds like nice code. |
19:18:06 | FromGitter | <bung87> @Yardanico thank you ! so I can write `const url =` in each case |
19:18:19 | Yardanico | yes |
19:19:10 | FromDiscord_ | <arnetheduck> https://github.com/status-im/nim-eth/blob/master/eth/p2p/ecies.nim#L185 - lol this was ported from an enum status code, so it happens to use an enum return - but _nothing_ would change if it switched to cstring because there is no case where the underlying result error is checked specifically - so you can see that `mapErrTo` simply puts a single enum value in place for any error that might have happened when parsing the public key |
19:22:40 | FromDiscord_ | <arnetheduck> basically, enum or some more involved type is good if you need to transport more data to the caller than "it worked" or "it didn't work" - a typical example is `send` from sockets which returns `eagain` if the write buffer is exhausted and you should call again - literally all other error codes from `send` mean "it didn't work, and won't work, stop trying" and you don't differentiate between them other than to show an error to the user |
19:23:14 | Araq | enums also have i18n benefits, it's rather easy to translate the frozen set of errors into different languages |
19:24:13 | disruptek | i can't seem to squirrel away ic code in the compiler because i cannot figure out how imports work with relative paths. |
19:24:16 | FromDiscord_ | <arnetheduck> true - that is an advantage - though gettext works with strings and not enums - in part because the string might take parameters, and some languages need conjugations etc |
19:24:27 | disruptek | π€¦ |
19:25:09 | Araq | and I claim that if you enforce a single error enum throughout the programming language you get interop benefits |
19:25:13 | FromDiscord_ | <arnetheduck> well `import a/[b, c]` works but `./[b, c]` doesn't - perfectly logical π |
19:25:45 | Araq | `.` is not an identifier and the general expression parsing logic is used. logical indeed |
19:26:10 | FromDiscord_ | <arnetheduck> well `import a/[b, c]` works but `import ./[b, c]` doesn't - perfectly logical π |
19:26:20 | disruptek | idgaf, i want compiler/ic/spec to import compiler/ast |
19:26:28 | Araq | it simply works more consistently than users might anticipate. *shrug* |
19:26:31 | FromDiscord_ | <arnetheduck> well I don't care about that distinction - I'm mostly upset that I can't group my imports consistent |
19:26:33 | FromDiscord_ | <arnetheduck> well I don't care about that distinction - I'm mostly upset that I can't group my imports consistently |
19:27:32 | Araq | disruptek: need my help on mumble? |
19:27:45 | disruptek | if it's not too annoying, please. |
19:27:59 | Araq | ok, one sec |
19:28:45 | FromDiscord_ | <arnetheduck> but I'm more upset about not being able to return a proc from a proc easily - ie `proc x(): SomeCallback = proc () = echo hello` doesn't parse - you have to `proc x(): SomeCallback = (proc () = echo hello)` |
19:30:50 | FromDiscord_ | <arnetheduck> > single error enum throughout the programming language |
19:30:50 | FromDiscord_ | <arnetheduck> you also need a global assignment oracle and someone to tell you which enums are no longer in use |
19:31:14 | disruptek | {.used.} {.deprecated.} |
19:32:49 | * | abm quit (Ping timeout: 256 seconds) |
19:37:17 | * | vesper joined #nim |
19:37:56 | * | rockcavera joined #nim |
19:38:16 | * | vesper11 quit (Ping timeout: 256 seconds) |
19:40:05 | shashlick | @PMunch - https://github.com/nimterop/nimterop/blob/master/tests/rsa.nim |
19:40:36 | PMunch | Oooh, is the RSA wrapping done? |
19:40:49 | shashlick | yep, in master, part of the official nimterop test on linux |
19:40:49 | * | Vladar quit (Quit: Leaving) |
19:41:35 | shashlick | you'd need to expand it to download headers on windows if you need that |
19:41:57 | shashlick | i'm thinking of building and wrapping libressl |
19:42:14 | * | silvernode quit (Ping timeout: 256 seconds) |
19:42:24 | shashlick | so you can statically link with nimble install nimressl |
19:42:26 | shashlick | if there's interest |
19:45:42 | FromDiscord_ | <arnetheduck> @disruptek badresults is your way of doing versioning? π |
19:46:00 | disruptek | it's my way of using your code the way i want to. |
19:46:11 | FromDiscord_ | <arnetheduck> what did you change? |
19:46:31 | disruptek | i explained my issues in your repo's issues. |
19:46:52 | disruptek | i don't want to fucking impl `func $` for every type i wrap in Result. |
19:46:57 | shashlick | disruptek - by the way, i made a cmake package in nimble so you can requires "cmake" instead of telling people to use scoop |
19:47:01 | disruptek | side-effects. they are a part of life. |
19:47:01 | shashlick | works on windows |
19:48:03 | disruptek | cool, thanks. |
19:48:09 | disruptek | i'll update nimph readme. |
19:48:16 | shashlick | but ya, we should move to binary releases |
19:48:36 | shashlick | nimph isn't a library so we should make it easy to distribute |
19:51:13 | * | martinium quit (Changing host) |
19:51:13 | * | martinium joined #nim |
19:51:18 | FromDiscord_ | <arnetheduck> @disruptek but.. I remember asking for a case where you actually had side-effects in `$` - ie you can call a proc from a `func` as long as it doesn't actually do side-effects |
19:51:40 | disruptek | well, you know where to find my reply. |
19:51:45 | FromDiscord_ | <arnetheduck> and having side-effects in `$` - well, I was just struggling to come up with a case where that was a good idea |
19:54:42 | FromDiscord_ | <arnetheduck> well, I looked and posed a questoin in response - ie do you have a side effect in there or is it deduced wrong? |
19:54:50 | FromDiscord_ | <arnetheduck> then you closed the issue |
19:55:06 | disruptek | i deduced the approach was wrong. |
19:55:37 | FromDiscord_ | <Varriount> arnetheduck: There's also the plain reeason that disruptek felt that implementing `$` for every type used was too tedious, and so forked it for his own use. |
19:56:01 | disruptek | i'm a lazy anti-social prick. |
19:56:03 | FromDiscord_ | <Varriount> There's nothing inherently wrong with that. |
19:56:05 | FromDiscord_ | <arnetheduck> Varriount, you don't have to implement `$` for every type - only if you call `$` on Result |
19:56:13 | disruptek | bzzzt. |
19:56:49 | FromDiscord_ | <Varriount> arnetheduck: Again, perhaps he felt it was too tedious. |
19:57:50 | FromDiscord_ | <arnetheduck> well, I'm trying to find out what was too tedious - then I could judge whether the change makes sense to upstream, or if there exists another solution that will please us both |
19:58:02 | FromDiscord_ | <Varriount> It's not an objective thing - what you might find acceptable in a set of requirements, someone else might find too much. |
19:58:27 | disruptek | there's no interest in extra work that doesn't even establish that no effects exist. |
19:58:31 | FromDiscord_ | <arnetheduck> again: I'm not objecting - I'm curious |
19:58:52 | disruptek | you are welcome to play with gittyup. |
20:01:03 | FromDiscord_ | <arnetheduck> I'm not _that_ curious π if you find it less work to fork, that's totally fine - we each have our use-cases - I got curious also because we've made some significant updates to work around a bunch of compiler bugs that you might be interested in |
20:01:08 | PMunch | Hmm, are float no longer always 64 bits? |
20:01:34 | PMunch | It says "Default floating point type" in the manual, but doesn't specify what that actually means.. |
20:01:52 | FromDiscord_ | <Rika> Whichever is native to the target you compile to I guess |
20:02:12 | solitudesf | https://nim-lang.github.io/Nim/manual.html#types-preminusdefined-floating-point-types |
20:02:20 | PMunch | According to the tutorial it's always 64 bit https://nim-lang.org/docs/tut1.html#basic-types-floats |
20:02:27 | PMunch | "In the current implementation" |
20:02:43 | FromDiscord_ | <arnetheduck> or rather, I don't have bandwidth to be _that_ curious - we use Result as a tool to meet certain needs, so I'm curious as far as those needs go - your use case, I'm curious because maybe we'll come across it also, and then it's good to be prepared |
20:03:28 | PMunch | Is there a particular reason why int is the same size as a pointer? For speed? For compatibility with something? For fun? |
20:04:10 | FromDiscord_ | <arnetheduck> we use `func` because it gives us guarantees about a whole class of bugs that we want to avoid in our codebase - so relaxing `Result` to not use `func` is a functionality loss from our point of view - hence we'd want something in return |
20:05:10 | * | Jesin quit (Quit: Leaving) |
20:06:15 | * | narimiran quit (Ping timeout: 256 seconds) |
20:06:31 | martinium | how can one debug a running nim program? |
20:06:48 | martinium | one of my functions doesn't seem to execute and I have no idea why |
20:07:25 | martinium | currently using vscode to write it |
20:09:58 | FromDiscord_ | <arnetheduck> oh and those of you that needs SSL: https://github.com/status-im/nim-bearssl - no pesky openssl license and no need to muck around with dll:s - it builds the C code automagically when you import it |
20:09:58 | Prestige | martinium: you could start the program with gdb, or if it's already running you can attach the pid w/gdb |
20:10:30 | PMunch | Why is cint defined like this? cint* {.importc: "int", nodecl.} = int32 |
20:10:54 | PMunch | int in C can be anything from a int16 and bigger. |
20:11:26 | * | Jesin joined #nim |
20:12:00 | PMunch | shashlick, that would be great! But what do you mean by "you'd need to expand it to download headers on windows"? |
20:12:40 | disruptek | /home/adavidoff/nims/1.3/lib/pure/ropes.nim(59, 3) Error: 'N' should be: 'n' |
20:13:43 | dom96 | lol at that error |
20:17:10 | shashlick | PMunch - point it to the headers since mingw doesn't have openssl installed by default |
20:17:21 | PMunch | Oh right |
20:17:27 | martinium | scoop install openssl helps on windows |
20:17:45 | martinium | if you went the scoop route |
20:17:53 | FromGitter | <Bennyelg> (https://files.gitter.im/nim-lang/Nim/FE1v/image.png) |
20:18:12 | FromGitter | <Bennyelg> Is that a jester bug? |
20:18:19 | FromGitter | <Bennyelg> Im reading request.params |
20:18:28 | FromGitter | <Bennyelg> but after the 3rd element its start to mee up |
20:18:31 | FromGitter | <Bennyelg> mess up |
20:18:35 | FromGitter | <Bennyelg> (https://files.gitter.im/nim-lang/Nim/iVG4/image.png) |
20:18:46 | dom96 | what's your request path? |
20:19:51 | FromGitter | <Bennyelg> managed. I was missed the & :| thanks |
20:21:01 | shashlick | arnetheduck: can you use bearssl as a replacement for openssl in an existing project? |
20:21:11 | shashlick | looking for static link for choosenim |
20:23:00 | * | inv2004 quit (Ping timeout: 258 seconds) |
20:23:12 | dom96 | shashlick, really, if the machine's curl is broken then I don't think there is much we can do |
20:23:21 | dom96 | we shouldn't add yet another dependency that's unproven just to fix this |
20:25:01 | FromDiscord_ | <arnetheduck> shashlick: well, they don't implement the same API so you need to adapt your code |
20:25:47 | Yardanico | libressl OTOH is compatible with openssl afaik |
20:25:57 | Yardanico | i tried using it to statically link linux apps |
20:26:05 | Yardanico | there's also https://github.com/kaushalmodi/hello_musl |
20:27:50 | FromDiscord_ | <arnetheduck> what's nice about bearssl is how easy it is to build and embed - works on windows too |
20:29:14 | dom96 | bearssl isn't ready for production yet though, is it? |
20:29:39 | dom96 | last time I checked the author wasn't comfortable recommending it to be used in prod |
20:30:20 | Yardanico | "There is no such thing as bug-free code, and I wonβt claim that there is none in BearSSL; only that I looked real hard. Use in production applications is, in any case, at your own risk." |
20:30:59 | dom96 | "Current version is 0.6. It is now considered beta-quality software:" |
20:31:08 | dom96 | beta implies to me that it's not ready for real-world usage |
20:31:18 | FromDiscord_ | <Rika> I think that's what he said too |
20:31:25 | dom96 | this is especially true when talking about crypto |
20:31:49 | shashlick | dom96: my concern with choosenim is that we want an older OSX build but don't want to then force users to install some specific openssl version in order to use it |
20:32:06 | shashlick | i'd rather pick the latest libressl and link it in so that end user doesn't care |
20:32:33 | shashlick | likewise for windows where we need dlls today |
20:32:42 | dom96 | shashlick, like I replied in the issue, I'm confused why it worked fine for me with curl. |
20:32:55 | shashlick | honestly no idea cause i'm not much of an osx user |
20:33:08 | shashlick | but my PR's travis jobs show you the failures |
20:33:26 | dom96 | shashlick, can you add a check for `curl -v` on the travis job? |
20:33:35 | dom96 | Maybe homebrew ended up replacing my system curl :( |
20:33:58 | shashlick | sure i can try |
20:34:30 | shashlick | the thing that confuses me is brew installing stuff without adding to system path since it can conflict with OSX's version |
20:34:51 | shashlick | so you can hack your build to pick it up but end user might not do that and you end up with runtime failures |
20:35:13 | dom96 | of course. I was under the impression that it was a system curl that I had in my PATH |
20:35:24 | dom96 | If it isn't then yes, we need a different solution |
20:35:47 | shashlick | is curl == libcurl or are they different packages |
20:35:53 | Yardanico | what about libressl |
20:35:56 | dom96 | no idea |
20:35:59 | Yardanico | it's osed by OpenBSD |
20:36:02 | Yardanico | used* |
20:36:15 | shashlick | yep that's what i'm proposing - static link to libressl |
20:36:22 | shashlick | similar to nimarchive |
20:36:24 | * | someunknownuser joined #nim |
20:39:06 | dom96 | if you want to implement libressl support for the stdlib then that would be really nice |
20:39:20 | shashlick | dom96: i forget - why curl on osx? why not httpclient |
20:39:32 | dom96 | shashlick, because openssl failed on OSX for me |
20:39:42 | dom96 | with cert errors |
20:39:46 | dom96 | curl worked fine |
20:40:11 | shashlick | so on osx, choosenim isn't linking to libcurl? it just calls the curl CLI? |
20:40:20 | dom96 | yeah |
20:40:32 | dom96 | or wait |
20:40:50 | dom96 | no, it's libcurl |
20:41:22 | Yardanico | @dom96 libressl already works with stdlib |
20:41:32 | Yardanico | it's compatible with openssl |
20:41:41 | dom96 | Yardanico, yeah yeah, I mean static linking support |
20:41:50 | Yardanico | it works too :P |
20:42:29 | Yardanico | https://github.com/kaushalmodi/hello_musl |
20:42:50 | dom96 | shashlick, guess we really should check libcurl version then |
20:42:51 | * | inv2004 joined #nim |
20:43:15 | shashlick | so sounds like if we brew install curl, it might just work then |
20:43:24 | shashlick | even on the old version |
20:43:42 | dom96 | Yes... but you can do the same with openssl |
20:43:49 | dom96 | We need to establish if it works out of the box with curl |
20:43:56 | dom96 | I just checked `brew info curl` and I don't have it installed |
20:44:29 | dom96 | so either I somehow managed to get libcurl that is newer without homebrew or it should work |
20:45:51 | dom96 | shashlick, if you try `curl --version` on travis and maybe attempt to download a release from github as well we can gain some insights. |
20:46:50 | * | leorize quit (Remote host closed the connection) |
20:48:23 | * | leorize joined #nim |
20:49:28 | FromDiscord_ | <arnetheduck> @araq https://github.com/nim-lang/Nim/pull/13908 - y/n? would be nice because we're having some trouble with this - ie somewhat unusually, we're actually trying to catch exceptions and not let things crash but people get confused |
20:49:30 | disbot | β₯ Error -> Defect for defects |
20:58:55 | * | abm joined #nim |
21:01:58 | * | PMunch quit (Quit: leaving) |
21:14:25 | * | Intensity joined #nim |
21:21:25 | * | tane_ quit (Quit: Leaving) |
21:21:38 | leorize | so a thing people usually do with pipes is to read lines from them |
21:22:14 | leorize | now to implement this functionality, I'd need to be able to store an internal buffer |
21:22:40 | leorize | question is: should this turn into it's own type (ie. BufferedPipe) or should this just be a property of the same pipe type? |
21:31:36 | * | abm quit (Ping timeout: 256 seconds) |
21:31:53 | * | moerm joined #nim |
21:32:01 | moerm | Hello everyone |
21:32:10 | disruptek | leorize: its own type. |
21:40:15 | * | krux02 quit (Remote host closed the connection) |
21:46:34 | moerm | Hmm ... bye |
21:46:40 | * | moerm quit (Quit: Leaving) |
21:50:31 | companion_cube | disruptek: you said the wrong thing |
21:55:03 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:55:55 | * | someunknownuser quit (Quit: someunknownuser) |
21:56:54 | * | rockcavera quit (Read error: Connection reset by peer) |
21:57:13 | * | rockcavera joined #nim |
21:57:13 | * | rockcavera quit (Changing host) |
21:57:13 | * | rockcavera joined #nim |
21:58:58 | * | tiorock joined #nim |
21:58:58 | * | tiorock quit (Changing host) |
21:58:58 | * | tiorock joined #nim |
21:58:58 | * | rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
21:58:58 | * | tiorock is now known as rockcavera |
22:00:33 | * | natrys quit (Quit: natrys) |
22:10:16 | FromDiscord_ | <Elegant Beef> Disruptek never says anything wrong |
22:14:00 | disruptek | wrong wrong wrong |
22:16:20 | FromDiscord_ | <Elegant Beef> see never said "anything wrong" |
22:18:04 | disruptek | i'm good but i'm not that good. |
22:18:57 | disruptek | its times like these i wish i got into ice road truckin'. |
22:19:25 | FromDiscord_ | <Elegant Beef> That's just driving around banff isnt it? |
22:19:34 | disruptek | you could do worse. |
22:19:55 | FromDiscord_ | <Elegant Beef> Yea like driving across the permafrost up north |
22:23:02 | disruptek | not for me. |
22:23:08 | disruptek | winter is a difficult time. |
22:23:19 | disruptek | balls clinkin' together like cubes in a glass. |
22:23:21 | disruptek | no thanks. |
22:25:17 | FromDiscord_ | <Elegant Beef> Lol, i live in an area that the average temperature in january is like -30C |
22:26:09 | * | martinium_laptop quit (Remote host closed the connection) |
22:26:22 | * | inv2004 quit (Read error: Connection reset by peer) |
22:27:10 | disruptek | i wouldn't call that `living`. |
22:33:42 | dom96 | Wow, HashSet sure is slow in the JS target |
22:34:32 | FromDiscord_ | <Gary M> so I'm trying to do a cpFile call from a nimble task, but I'm getting Access is denied |
22:43:57 | FromDiscord_ | <Gary M> nvm looks like I just had bad syntax |
23:04:25 | * | couven92 quit (Ping timeout: 264 seconds) |
23:05:53 | * | couven92 joined #nim |
23:08:59 | FromDiscord_ | <Technicae Circuit> Hello |
23:10:12 | Yardanico | hi |
23:10:17 | FromDiscord_ | <Technicae Circuit> Sup? |
23:10:35 | FromDiscord_ | <Technicae Circuit> Could i ask about Nim use cases? |
23:11:27 | Yardanico | well you can, but what do you want to know exactly? |
23:11:38 | FromDiscord_ | <Technicae Circuit> What cases is it useful in? |
23:11:49 | FromDiscord_ | <Technicae Circuit> And is it meant as an alternative to something? |
23:12:08 | Yardanico | well Nim is general-purpose and no, it doesn't position itself as a direct replacement for some other language |
23:12:25 | Yardanico | you can literally do anything in Nim since it compiles to C (and C++/ObjC/JS) |
23:12:33 | FromDiscord_ | <Technicae Circuit> Okay, that's cool |
23:12:36 | Yardanico | but how easy that would be depends on the task ;) |
23:12:54 | FromDiscord_ | <Technicae Circuit> I think i have a way to use Python if you use C or C++ btw |
23:13:02 | Yardanico | ? |
23:13:04 | FromDiscord_ | <Technicae Circuit> I think i have a way to use Python modules in Nim if you use C or C++ btw |
23:13:18 | FromDiscord_ | <Technicae Circuit> You know the language Python? The interpreted lang? |
23:13:23 | Yardanico | wdym? well there's a module to use python modules in nim and nim modules in python |
23:13:26 | Yardanico | i know python |
23:13:31 | FromDiscord_ | <Technicae Circuit> Oh |
23:13:33 | FromDiscord_ | <Technicae Circuit> Well |
23:13:49 | FromDiscord_ | <Technicae Circuit> I have another theoretical way to use Python modules in Nim |
23:13:59 | Yardanico | also don't edit your messages in discord, they'll just be sent as new ones in IRC instead you can corrent like *corretion) |
23:14:09 | FromDiscord_ | <Technicae Circuit> oh okay, nice |
23:14:27 | FromDiscord_ | <Technicae Circuit> oh okay |
23:14:30 | Yardanico | *correction :P |
23:14:31 | FromDiscord_ | <Technicae Circuit> Oop- |
23:14:42 | FromDiscord_ | <Technicae Circuit> I just realized i edited my message π
|
23:15:38 | FromDiscord_ | <Technicae Circuit> Well since I'm a Python programmer, myself my mind immediately thinks "can i use Python in ...", And since there is a tool called Cython, i can make a C function in Python which allows me to use import statements in Nim |
23:15:53 | Yardanico | yes but that's more effort than just using nimpy |
23:15:57 | FromDiscord_ | <Technicae Circuit> Cython can compile Python to C |
23:16:00 | FromDiscord_ | <Technicae Circuit> Eh |
23:16:00 | Yardanico | https://github.com/yglukhov/nimpy |
23:16:03 | FromDiscord_ | <Technicae Circuit> Oo |
23:16:27 | FromDiscord_ | <Technicae Circuit> Doesn't that actually use Python |
23:16:33 | Yardanico | it does |
23:16:38 | Yardanico | but that's kinda the point |
23:16:44 | FromDiscord_ | <Technicae Circuit> I mean does it use it as a bridge |
23:17:04 | FromDiscord_ | <Technicae Circuit> Wait |
23:17:09 | FromDiscord_ | <Technicae Circuit> I can't English ;-; |
23:17:10 | Yardanico | it uses CPython's dynamic library |
23:17:29 | FromDiscord_ | <Technicae Circuit> So it uses CPython itself, basically calling the Python function |
23:17:50 | Yardanico | yes |
23:17:54 | FromDiscord_ | <Technicae Circuit> Because i think my method won't actually even need Python installed |
23:18:06 | FromDiscord_ | <Technicae Circuit> I'm not sure though |
23:18:09 | FromDiscord_ | <Technicae Circuit> It might |
23:18:30 | * | Trustable quit (Remote host closed the connection) |
23:18:45 | FromDiscord_ | <Technicae Circuit> I will try it as soon as i figure out how to use C or C++ functions in Nim |
23:18:55 | Yardanico | Cython will use your local python installation as well |
23:19:05 | Yardanico | it doesn't embed CPython in the binary |
23:19:08 | FromDiscord_ | <Technicae Circuit> When the code is compiled? |
23:19:13 | FromDiscord_ | <Technicae Circuit> There is an embed option |
23:19:38 | Yardanico | you can do the same with nimpy then |
23:19:47 | Yardanico | just link statically with libpython |
23:20:38 | FromDiscord_ | <Technicae Circuit> Okay then |
23:29:22 | FromDiscord_ | <Technicae Circuit> Is there a C to Nim converter somewhere? If so, can i have a link to it? |
23:29:44 | FromDiscord_ | <Technicae Circuit> Nvn |
23:29:44 | FromDiscord_ | <Technicae Circuit> Found it |
23:30:16 | Yardanico | there |
23:30:25 | Yardanico | there's c2nim but it doesn't work for all C code |
23:30:37 | Yardanico | there's also nimterop but it's mainly for wrapping C libraries by wrapping headers |
23:30:41 | FromDiscord_ | <codic> yeah |
23:32:16 | FromDiscord_ | <Technicae Circuit> Oh okay |