00:01:07 | * | Hideki_ joined #nim |
00:51:56 | * | krux02_ quit (Remote host closed the connection) |
01:03:40 | * | Hideki_ quit (Ping timeout: 265 seconds) |
01:10:35 | * | ftsf joined #nim |
01:10:39 | * | Hideki_ joined #nim |
01:24:41 | * | Hideki_ quit (Remote host closed the connection) |
02:33:02 | FromGitter | <gogolxdong> @treeform thanks for your googleapi , we've been working on it for a long time and didn't have any luck to work it out because of oauth2 . |
02:34:21 | disruptek | gogolxdong: have you not seen this? https://github.com/disruptek/gcplat |
02:35:09 | FromGitter | <gogolxdong> sorry, didn't notice that, does it do the same? |
02:35:52 | disruptek | yes, but it supports all the apis google publishes and it'll get updated automatically whenever they release any changes. |
02:36:25 | disruptek | treeform gave me some signing code that i inserted into gcplat and now we're just trying to figure out how we want to handle default options to the calls. |
02:36:33 | FromGitter | <gogolxdong> sounds great. |
02:37:14 | FromGitter | <gogolxdong> the signing code is tricky really. |
02:37:30 | disruptek | if you have an opinion, please let me know. i am thinking that maybe we'll just omit values passed to each call() if those values match the default for the type. |
02:38:23 | FromGitter | <gogolxdong> let me see. |
02:38:25 | disruptek | but that would mean that you couldn't call(someIntegerVariable=0), which seems like a bummer. you'd have to fall back to the syntax in the example. |
02:40:30 | disruptek | signing for google is trivial compared to amazon, and to be honest, amazon was trivial. it's so easy writing code to spec. |
02:42:28 | FromGitter | <gogolxdong> That's true. |
02:42:31 | disruptek | after call() is figured out, we'll eventually define all the types automatically and parse all the responses. |
02:44:57 | disruptek | another option, so to speak, is to use Options. it makes ad hoc calls kinda verbose, though. might be preferable to the other hack, though. |
02:45:56 | FromGitter | <gogolxdong> ok, let me see what I can do. |
02:49:51 | * | traviss joined #nim |
02:50:33 | FromGitter | <gogolxdong> wow, how do you find so many apis you consume ? |
02:51:02 | FromGitter | <gogolxdong> many cloud provider such as aws, google, bluemix and auzre |
02:51:03 | disruptek | they are hosted by the openapi directory; take a look at my openapi project and all this will make a lot more sense. |
02:52:19 | FromGitter | <gogolxdong> yes, I just find these in your openapi, so I wonder how come you find so many apis and know it can be consumed by openapi macro? |
02:52:37 | disruptek | i only build these apis because you have to tweak the nim compiler to be able to process them; it's a lot of vm cycles for these larger apis. |
02:53:25 | disruptek | the openapi macro is designed to be progressive and very tolerant of bad input, so it parses about 99% of what is out there. |
02:54:07 | FromGitter | <gogolxdong> oh ,you mean have to chang nim compiler to use the apis generated by openapi? |
02:54:10 | disruptek | the only thing it pukes on, really, is very very large integers that nim's json parser isn't able to understand. |
02:54:24 | * | theelous3__ quit (Ping timeout: 246 seconds) |
02:54:34 | disruptek | no, i just hack it to be able to generate the apis. you can use a normal nim to consume them yourself. |
02:55:21 | disruptek | and you don't need a special nim to generate _most_ openapi sources. it's just that some of these apis turn into .nim files of like 100,000+ lines of code. the default vm pukes on that. |
03:03:53 | * | sagax joined #nim |
03:21:33 | * | chemist69 quit (Ping timeout: 245 seconds) |
03:23:45 | * | chemist69 joined #nim |
03:51:13 | * | nif quit (Quit: ...) |
03:51:23 | * | nif joined #nim |
03:53:01 | * | rockcavera quit (Remote host closed the connection) |
03:54:34 | * | nif quit (Client Quit) |
03:54:45 | * | nif_ joined #nim |
04:28:00 | shashlick | If anyone wants to test the better cOverride, check out the nimterop override branch |
04:50:51 | * | nsf joined #nim |
04:56:37 | * | lmariscal quit (Quit: I'm out!) |
04:57:16 | * | lmariscal joined #nim |
05:25:37 | * | narimiran joined #nim |
06:12:13 | FromGitter | <mratsim> @planetis use parents if operator precedence is an issue |
06:12:19 | FromGitter | <mratsim> Parens* |
06:30:10 | * | PMunch joined #nim |
06:43:04 | * | couven92 joined #nim |
06:52:21 | * | solitudesf joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:04 | * | dddddd quit (Read error: Connection reset by peer) |
07:02:27 | * | krux02 joined #nim |
07:04:56 | * | gmpreussner joined #nim |
07:17:23 | * | alexander92 quit (Ping timeout: 268 seconds) |
07:23:42 | * | lbartoletti is now known as lbart |
07:47:37 | * | couven92 quit (Disconnected by services) |
07:47:42 | * | fredrik92 is now known as couven92 |
07:48:05 | * | fredrik92 joined #nim |
07:49:25 | * | fredrik92 quit (Client Quit) |
08:02:57 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:03:36 | * | gmpreussner joined #nim |
08:11:36 | livcd | hey mratsim |
08:39:54 | * | floppydh joined #nim |
08:40:50 | * | vesper joined #nim |
08:40:54 | * | vesper11 quit (Ping timeout: 265 seconds) |
08:41:14 | * | lritter joined #nim |
08:48:48 | lqdev[m] | shashlick: what did you improve? |
09:11:49 | * | tklohna_ joined #nim |
09:41:52 | * | Vladar joined #nim |
09:48:07 | * | NimBot joined #nim |
09:49:46 | planetis[m] | I just think it is an issue... |
10:01:24 | * | tklohna_ quit (Ping timeout: 246 seconds) |
10:18:01 | * | fanta1 joined #nim |
10:41:24 | * | tklohna_ joined #nim |
10:51:31 | Zevv | Everyone switched to Zig now? |
10:56:22 | Araq | huh? that came out of nowhere |
10:56:35 | Araq | plus I thought everybody switched to Rust already |
10:56:57 | Zevv | Or rust. But noone is talkin #nim today it seems! |
10:57:21 | Zevv | I tried rust again. Still not smart enough for that. |
11:11:37 | PMunch | Zevv, Mondays are usually a bit more quiet |
11:12:03 | * | ng0 joined #nim |
11:12:10 | PMunch | I notice that I miss Nim every time I have to write in a different language now.. |
11:12:36 | PMunch | Just had a bug in some C code because I assumed implicit return and it doesn't require you to handle a return or discard it |
11:13:07 | Araq | PMunch, increase the warning level of your C compiler |
11:13:31 | Araq | or better yet compile your C code with a C++ compiler, the type checking is much better |
11:14:22 | PMunch | Well this is a huge project by someone else, I'd rather not fiddle around in their autoconf/makefile system |
11:14:35 | PMunch | I guess I could just set the CC variable to g++ though.. |
11:19:21 | FromDiscord | <kodkuce> /usr/bin/ld: cannot find -lcrypto |
11:19:21 | FromDiscord | <kodkuce> collect2: error: ld returned 1 exit status |
11:19:28 | FromDiscord | <kodkuce> i did -d:ssl |
11:19:38 | FromDiscord | <kodkuce> i think i have libcrypto installed |
11:19:43 | FromDiscord | <kodkuce> like 95% sure |
11:19:44 | PMunch | You might not have the crypto library installed |
11:19:49 | PMunch | Oh |
11:19:52 | PMunch | Check? |
11:21:25 | FromDiscord | <kodkuce> stupit ubuntu i have installed libcrypto++-dev and libcrypto++6 duno meybe this C , gues need to us that LD or whatewer comand to see exact name, need to google |
11:25:20 | FromDiscord | <kodkuce> was missing libssl-dev |
11:25:23 | PMunch | kodkuce, wouldn't that be the C++ version? Are they comatible |
11:25:25 | PMunch | Yeah |
11:26:06 | FromDiscord | <kodkuce> duno i too thinked thats C++ but thats only what search offerd me, but anyway now it works |
11:29:32 | * | Romanson joined #nim |
11:33:30 | FromDiscord | <kodkuce> can someone elaborate to me why? https://hastebin.com/olomawarek.cs it works but i dont think this fallows standard JWToken |
11:35:12 | FromDiscord | <kodkuce> like its not using same algo or something |
11:40:28 | PMunch | Hmm, I'm unable to see your paste.. |
11:40:57 | narimiran | PMunch: probably because you have disabled JS |
11:41:07 | PMunch | Nope |
11:41:35 | PMunch | Server just isn't responding |
11:42:15 | narimiran | that's the case for me. without JS, i see a blank page. way to go, hastebin! code paste site where you cannot see the code without JS :rolleyes: |
11:43:31 | * | rockcavera joined #nim |
11:44:41 | PMunch | Just use ix.io.. |
11:45:55 | FromDiscord | <kodkuce> what i thinked you run it and see your token i have a line that echos it |
11:46:21 | FromDiscord | <kodkuce> eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJwb29wNTUiLCJleHAiOjE1NzE3NDQ3Njh9.QjQ1RkM4MzJEM0U3NUUwOEY0RjcyNUIxNzI1QjkyN0Q4NzkyQTMxMDM4QTg4MUI2REMwOUE5RjEwNEI4OTFDOA |
11:47:11 | FromDiscord | <kodkuce> oh you meant you cant open hastbin page |
11:47:47 | FromDiscord | <kodkuce> https://pastebin.com/PSZhDazb |
11:48:29 | * | sealmove joined #nim |
11:49:18 | FromDiscord | <kodkuce> http://ix.io/1ZoN |
11:50:49 | FromDiscord | <kodkuce> and when i change from HS256 to HS512 i get *** stack smashing detected ***: <unknown> terminated |
11:52:25 | shashlick | @lqdev I've implemented https://github.com/nimterop/nimterop/issues/133 |
11:54:52 | * | fanta1 quit (Quit: fanta1) |
11:56:52 | * | fanta1 joined #nim |
12:06:32 | lqdev[m] | shashlick: nice, I'll try it out when I get home |
12:08:45 | FromDiscord | <kodkuce> still if anyone can explain me my question, http://ix.io/1ZoN why not good signature when i put on jwt.io |
12:08:51 | lqdev[m] | how does it work? is it any different from what it was before on the user side? |
12:11:13 | lqdev[m] | @kodkuce you're getting a stack overflow, maybe try allocating some objects on the heap by making them `ref object`s? |
12:15:00 | FromDiscord | <kodkuce> duno how, its yukov build am just calling his function |
12:22:59 | FromDiscord | <kodkuce> *lib |
12:30:55 | shashlick | @lqdev originally, cOverride simply added the symbols to the top before cImport and set those symbols to not be wrapped |
12:31:38 | shashlick | This doesn't work if a missing symbol refers to other symbols that are wrapped later in cImport |
12:31:58 | * | Kaivo joined #nim |
12:32:20 | shashlick | So now, cOverride overrides in place which means first nimterop now detects any symbols it doesn't know how to wrap |
12:33:11 | shashlick | Any defined in cOverride then get applied in place so the contextual reference to other symbols is preserved |
12:33:41 | shashlick | Anything not detected continues to be put at the top |
12:34:02 | shashlick | So overriding is much better and effective now, just need some real world testing |
12:34:18 | shashlick | And that it didn't break any existing wrappers |
12:36:25 | shashlick | Ya, user side is the same |
12:41:33 | * | MarderIII joined #nim |
12:46:37 | * | nsf quit (Quit: WeeChat 2.6) |
12:52:20 | Zevv | Hmm, I asked this a few days ago, but still haven't found it: is it possible to make a proc reference to operators? I now get things like "Error: '+' cannot be passed to a procvar" |
12:55:02 | * | fanta1 quit (Quit: fanta1) |
12:55:32 | PMunch | Should be possible IIRC |
12:57:17 | PMunch | Like this? https://play.nim-lang.org/#ix=1Zp5 |
12:57:22 | PMunch | Zevv ^ |
12:58:48 | Zevv | yeah but that is *your* `+++` |
12:58:54 | Zevv | I'd like to use the default `+`, for example |
12:59:06 | PMunch | Aaah |
12:59:21 | Zevv | but I just found a forum post from araq from 2015, noting among other constraints "The procedure that is accessed resides in the current module." |
12:59:23 | PMunch | Hmm, yeah I remember that being a bit different |
12:59:39 | Araq | we changed it, .procvar is dead |
13:00:07 | Araq | but system.`+` is not a proc, it's more of a code generation device, can't pass it around. |
13:00:32 | Araq | you can do this: (proc (x, y: int): int = x + y) |
13:00:48 | Zevv | sure, that's what I'm doing now |
13:01:17 | Araq | Zevv, templates also help |
13:01:26 | Araq | template map(op) = ... |
13:01:30 | Araq | map(`+`) |
13:01:44 | Zevv | ah right |
13:06:59 | Zevv | related, I ran into this before: https://play.nim-lang.org/#ix=1Zpa |
13:09:29 | Araq | I fucked up this part of the language :P |
13:09:35 | disruptek | what, again? |
13:09:45 | * | alexander92 joined #nim |
13:09:47 | Zevv | pfff, *every time* |
13:09:52 | Araq | but I think I know how to fix it |
13:10:16 | disruptek | don't tell anyone; just slip it into a documentation patch. |
13:10:53 | Araq | I intend to use a parser patch :P |
13:11:04 | disruptek | amateur. |
13:11:25 | Araq | Zevv, https://play.nim-lang.org/#ix=1Zpb |
13:11:26 | disruptek | shashlick: i made this bump thing so you could release more often. |
13:11:46 | Araq | bbl |
13:13:02 | disruptek | his response is to create more branches. 🤦 |
13:13:06 | shashlick | @disruptek I'm still on a branch since cOverride is still in test |
13:13:21 | disruptek | oh, okay. |
13:13:40 | shashlick | I don't want potentially broken stuff on master |
13:13:59 | disruptek | how do you test "any existing wrappers"? |
13:14:39 | shashlick | By asking the community to :) |
13:14:58 | shashlick | I've tested with nimgit2 and nimarchive |
13:15:19 | shashlick | All works, some appveyor bug I need to look into |
13:15:35 | shashlick | But basically it needs to be backwards compatible |
13:16:01 | disruptek | ah, cool. in theory it can't be any worse, only better. |
13:16:24 | shashlick | Ya, I've had to put in some workarounds but eh |
13:16:33 | shashlick | Have to update docs too |
13:17:37 | shashlick | Recent fixes also wrap more stuff so doing pretty good |
13:18:03 | shashlick | Main challenge is nested structs which I don't have a strategy for yet |
13:18:36 | * | theelous3__ joined #nim |
13:19:04 | Zevv | ah magic brackets! |
13:19:21 | disruptek | if i understand the nested struct problem, you need to create intermediate symbols, right? |
13:19:50 | disruptek | it seems like the same issue i have with openapi generated types. |
13:20:08 | shashlick | Well the way nimterop works is it recognizes AST patterns if that even means anything |
13:20:35 | shashlick | So I need some way to represent recursive stuff |
13:20:53 | disruptek | can i see an example? |
13:20:59 | shashlick | I already use that for enum expressions and unknown symbols now |
13:21:33 | shashlick | But want to do the same for multidimensional arrays, ***ptr and of course nested structs |
13:22:41 | shashlick | It's all in grammar.nim |
13:22:44 | disruptek | openapi now requires 20-40 million cycles in the vm in order to build azure apis. |
13:22:54 | disruptek | (i stopped counting) |
13:24:12 | shashlick | I get an ast structure from tree-sitter and compare with a tree of known stuff |
13:24:34 | shashlick | You can see the tree with `toast -g` |
13:24:37 | disruptek | i love how short your comments are. |
13:25:00 | disruptek | it's like reading great literature. |
13:25:05 | disruptek | so much left to the imagination. |
13:25:26 | shashlick | Yep, perhaps too terse |
13:25:28 | disruptek | these procs don't even have *names*. |
13:25:35 | disruptek | you're a fuckin' badass, no two ways about it. |
13:26:04 | disruptek | line 624: # // comment |
13:26:11 | disruptek | i mean, wtf, am i being trolled right now? |
13:26:32 | PMunch | Hmm, is there a good guide for how to make Nim bindings for a library? |
13:26:48 | shashlick | It's a tuple of pattern to look for and callback |
13:27:01 | shashlick | The comment is the struct it looks for in C |
13:27:13 | disruptek | no, i know. |
13:27:22 | shashlick | P |
13:27:53 | shashlick | @PMunch is like to know too cause I'd like nimterop to make better wrappers |
13:28:12 | shashlick | @disruptek very open to feedback |
13:28:13 | disruptek | leorize[m]: this r"""something something quotes" are hell"""" # " 🙄 appears in my bump source for your syntax-highlighting pleasure. |
13:28:28 | shashlick | I think you're the first set of eyes looking in there |
13:28:34 | disruptek | i'm just breaking your balls. |
13:28:49 | disruptek | insert job security golf clap here. |
13:29:08 | shashlick | Nah I really need help to get this moving faster |
13:29:23 | shashlick | So cryptic code isn't really a passion |
13:29:33 | shashlick | I want to get to C++ |
13:29:42 | shashlick | And then rust, go etc |
13:29:44 | disruptek | i find docs are helpful because they force me to explain something stupid that i'm doing (and, worse, justify it). |
13:30:06 | shashlick | Ya most of the docs are in cimport and build since they are user facing |
13:30:19 | disruptek | maybe start with a 100' overview in a block at the top of the file. |
13:30:23 | shashlick | Toast is a mule behind the scenes |
13:30:32 | * | Hideki_ joined #nim |
13:30:35 | shashlick | Sounds good, will do |
13:31:45 | disruptek | i know the grief you go through with toast; openapi has the same "too bad this isn't /actually/ lisp" feel to it. |
13:31:48 | PMunch | Hmm, c2nim really doesn't like these files.. |
13:34:25 | shashlick | What you working on @PMunch |
13:34:33 | Araq | it's raining |
13:34:40 | Araq | so I'm back already |
13:34:59 | Araq | so ... I need some rubber duck |
13:36:31 | disruptek | kinky. |
13:36:36 | PMunch | shashlick, well I'm working on adding dynamic library support to the Unbound DNS server |
13:37:03 | PMunch | Which is going great, but it was time to start writing documentation, so I thought I'd try to write a dynamic module in Nim instead for fun :P |
13:37:31 | PMunch | But that means importing some definitions from the Unbound files |
13:37:56 | PMunch | Amongst other things some monstrously large structs I didn't feel like typing out by hand |
13:38:03 | PMunch | Araq, on what? |
13:38:55 | PMunch | But things here doesn't work properly, e.g. this https://github.com/NLnetLabs/unbound/blob/master/util/locks.h#L70 |
13:39:08 | PMunch | Complains that the # is not expected |
13:39:50 | FromGitter | <alehander42> araq what you doing |
13:39:54 | Araq | I forgot about the # toString preprocessor operator |
13:40:03 | Araq | so c2nim doesn't understand it either :P |
13:40:12 | PMunch | Hmm, well that's a bummer.. |
13:40:34 | Araq | so ... I added dispose/deepDispose to the mark&sweep GC and use it in async |
13:40:40 | Araq | it causes crashes |
13:40:43 | PMunch | If I can make this wrapper I might be able to push some Nim code into prod where I work :) |
13:41:07 | Araq | simple tests reveal that deepDispose seems to be correct |
13:41:39 | Araq | that means there must be some wild sharing going on that I failed to model |
13:42:46 | PMunch | Does your simple tests cover closure iterators? |
13:43:07 | Araq | they cover closures |
13:43:17 | shashlick | @PMunch - I let the C preprocessor deal with all that |
13:43:19 | Araq | but good point, let's see |
13:43:39 | Araq | PMunch, the secret to c2nim lies in "edit the header file for c2nim" |
13:43:42 | PMunch | shashlick, how? That's my problem, I'v never wrapped more than a function or two in Nim |
13:44:04 | PMunch | Araq, yeah I've noticed that that is a recurring theme.. |
13:44:58 | Araq | Listen to me, the spice must flow! |
13:45:13 | shashlick | Is it all just C? |
13:46:03 | PMunch | Yup, at least the parts I care about: https://github.com/NLnetLabs/unbound |
13:46:16 | shashlick | @PMunch what's your main import file |
13:46:52 | PMunch | Well this is a very simple dynamic library I wrote in C: https://github.com/PMunch/unbound/blob/master/dynlibmod/examples/helloworld.c |
13:47:15 | PMunch | So the config.h and util/module.h would be the stuff I need to recreate that |
13:47:34 | PMunch | Araq, Dune reference, nice |
13:52:17 | PMunch | Hmm, it doesn't seem to like this either: https://github.com/PMunch/unbound/blob/master/dynlibmod/examples/helloworld.c |
13:52:23 | PMunch | void verbose(enum verbosity_value level, const char* format, ...) ATTR_FORMAT(printf, 2, 3); |
13:52:32 | PMunch | Didn't mean to paste that URL again.. |
13:53:07 | PMunch | Complains at the ( after ATTR_FORMAT that ';' was expected |
13:58:51 | leorize | disruptek: uhmm, what do you mean? |
14:00:50 | shashlick | @PMunch cloning |
14:04:44 | shashlick | @PMunch - http://ix.io/1Zpz |
14:04:54 | shashlick | that's locks.h |
14:05:08 | shashlick | ran it with `toast -pn -I. util\locks.h` |
14:05:15 | jken | How common is it to have all of your types defined in a single file, vs in seperate modules |
14:05:15 | shashlick | and renamed pid_t => int32 |
14:05:27 | Araq | PMunch, learn about #def vs #define |
14:06:02 | Araq | jken, I think I have 0 projects where everything type is in a single module |
14:06:38 | PMunch | Araq, what do you mean? |
14:06:43 | PMunch | shashlick, ooh interesting |
14:06:48 | Araq | avoid the OOP mindset and the problem doesn't come up nearly as often. |
14:07:02 | Araq | PMunch, c2nim has #def **and** #define, read about it please |
14:07:07 | shashlick | @PMunch - https://nim-lang.org/docs/c2nim.html#preprocessor-support-def-directive |
14:07:35 | Araq | PMunch, anyway, closure iterators work too |
14:08:31 | PMunch | Hmm, editing the C files are a bit of a pain though.. |
14:08:41 | PMunch | Means I need to do it every time they change |
14:08:58 | Araq | oh not that again... :P |
14:09:40 | Araq | the idea is to not touch the c2nim produced file and keep a C header file diff/patch around, so you can re-apply the patch and re-run c2nim |
14:10:13 | Araq | c2nim even supports an .emit like feature to influence the produced Nim code so that you don't have to touch it |
14:10:41 | shashlick | @PMunch - that's my position as well, but it is still Araq's fault since I'd rather edit Nim files all day than make code changes to C |
14:11:09 | Araq | you're free to patch c2nim further |
14:11:30 | shashlick | Araq, you made Nim too comfortable, i'll never write C again |
14:11:51 | PMunch | I mean what I ultimately want is to just write `cinclude "../util/module.h"` in my Nim file and just have it magically work |
14:12:03 | PMunch | But I'd also like a pegasus, soo.. |
14:12:08 | jken | Araq, that's what I figured, someone suggested that approach to me in here the other day and It didn't feel right |
14:12:09 | Araq | you want that, I don't. |
14:12:41 | PMunch | shashlick, nimterop seems promising, I'll play around with it some more tomorrow |
14:12:44 | PMunch | But I'm off work now |
14:12:45 | Araq | I enjoy *real* wrappers, not hacks where every misfeature of C shines through |
14:13:03 | * | PMunch quit (Remote host closed the connection) |
14:13:16 | shashlick | i'm too practical i guess |
14:13:50 | disruptek | araq draws the line at pegasi. |
14:14:14 | Araq | you need to add *types* to C header files because C lacks them. No, "everything is a pointer to char", doesn't count as a "type system". |
14:14:53 | disruptek | sure it does; it's a type system with a single type. |
14:16:45 | disruptek | leorize: i mean i had to do this to fix syntax highlighting mid-file: https://github.com/disruptek/bump/blob/master/bump.nim#L86 |
14:19:45 | disruptek | araq: i don't want to sound like i'm casting shade on your dispose algo, but "wild sharing" doesn't strike me as surprising when it comes to C compiler optimization. |
14:20:49 | Araq | no, the C compiler doesn't optimize heap stuff |
14:21:04 | Araq | it must be a simple mistake in my thinking somewhere |
14:21:41 | disruptek | i guess "simple test, seems correct" means you need to up the ante in the complexity arms race. |
14:22:33 | disruptek | also, the C compiler doesn't optimize heap stuff? |
14:23:15 | Araq | it can't optimize customly allocated stuff, it would break the world |
14:23:18 | disruptek | or is that just in the flavor of C that nim is producing? |
14:23:37 | * | nsf joined #nim |
14:24:08 | Araq | in general, the heap is very tricky so what's done is it inlines much to see through the pointers and if they happen to point to the stack, further optimizations are enabled |
14:24:12 | disruptek | i guess for your purposes, it can't. can you confirm that easily? |
14:24:49 | Araq | I think I know what happens |
14:24:51 | disruptek | that's neat and makes a lot of sense. |
14:25:56 | Araq | the Future[T] is part of the task and freed too early |
14:29:57 | disruptek | i've made two forays in the memory management in nim and they both failed: klee says there's a bug in alloc during `hello world`, and i can't do much of anything in lmdb without leaking memory. |
14:30:26 | Araq | klee has no chance of understanding 'alloc' |
14:30:30 | disruptek | these are challenging enough to prove wrong or right that they basically taught me nothing. |
14:30:51 | disruptek | why do you say that? |
14:31:26 | Araq | how could it understand it? I know few memory allocators that are proven correct by tools |
14:31:44 | disruptek | i don't know. |
14:32:01 | disruptek | i mean, i really have no strong sense for how it works beyond the obvious. |
14:32:21 | Araq | yeah but I do and I'm telling you, it's outside of its domain |
14:32:35 | disruptek | but, i know it works to find bugs in coreutils, and i'm pretty sure some alloc goes on in there. 😉 |
14:32:36 | Araq | feel free to prove me wrong ;-) |
14:34:47 | disruptek | there are probably fences to prevent it from trying to prove certain constructs. |
14:35:02 | disruptek | so maybe there are presumptions inherent. |
14:35:15 | Araq | yeah, these tools usually come with tons of custom annotations |
14:35:40 | FromDiscord | <kodkuce> newruntime/sharedgc, this week? 🙂 |
14:36:26 | FromDiscord | <kodkuce> or abandonware xD |
14:36:53 | Araq | that's what I'm talking about, yes |
14:37:47 | Araq | yeah, this makes sense |
14:37:55 | Araq | what I'm doing is completely wrong |
14:39:30 | Araq | bummer, need to find a different solution |
14:39:46 | * | nixfreak40 joined #nim |
14:39:52 | * | nixfreak40 is now known as nixfreak_work |
14:41:50 | Araq | in retrospect it's obvious... but how to fix it |
14:43:53 | FromGitter | <alehander42> i'd write a new language |
14:44:00 | FromGitter | <alehander42> and then a toolkit for writing languages |
14:44:06 | FromGitter | <alehander42> but dont do that |
14:44:06 | livcd | so newruntime did not work out ? |
14:44:17 | disruptek | it's being worked on. |
14:44:25 | disruptek | sshhh he's thinking. |
14:45:32 | Araq | lol |
14:46:39 | Araq | ah! |
14:47:12 | disruptek | livcd: newruntime just got a little closer to death. |
14:48:03 | livcd | what happened ? |
14:48:40 | Araq | actually newruntime got closer to winning |
14:49:53 | Araq | as I'm tinkering with 'dispose' (the alternative to --newruntime) |
14:50:23 | Araq | however, maybe both are deadends and one-bit refcounting cannot cut it |
14:50:39 | disruptek | yes, but then you said `ah!`, which means dispose regained the upper hand. |
14:51:38 | leorize | disruptek: fixed |
14:51:45 | disruptek | sweet! |
14:52:20 | disruptek | i bet that'll fix other cases, too. it doesn't happen that often that i can offer a repro. |
14:52:37 | sealmove | dispose is different from newruntime? :S |
14:52:45 | Araq | I'm beginning to dislike closures. with them the heap topology is a black hole |
14:53:11 | sealmove | But need procs are closures by default xD |
14:53:14 | sealmove | this is bad |
14:53:21 | sealmove | But nim* |
14:54:05 | Araq | we should all panic now :P |
14:54:19 | disruptek | i'm not that attached to procs. i could take 'em or leave 'em. |
14:54:27 | Araq | news! language design experiments can fail. |
14:54:53 | shashlick | too big to fail |
14:55:01 | disruptek | i dunno about that; i think newruntime forwarded the state of the art. |
14:55:46 | Araq | it's too early to say anything really. I still don't understand the problem all that well |
14:56:01 | disruptek | it's a weird feeling, huh? |
14:56:06 | disruptek | totally alien. |
14:56:18 | Araq | :P |
14:56:45 | FromGitter | <alehander42> can you say a bit why |
14:56:52 | FromGitter | <alehander42> do they make heap topology so confusing |
14:57:25 | Araq | too much magic, you capture stuff, it needs to be kept alive |
14:57:27 | sealmove | alehander42: tests failing do the talking |
14:58:13 | disruptek | blackhole is a good analogy because you are losing information and there's no way to get it back. |
15:01:05 | * | PrimHelios joined #nim |
15:01:29 | PrimHelios | is there any way to use `switch` inside a nim file to define a symbol? |
15:01:48 | disruptek | switch? |
15:02:25 | Araq | --define, and no, but you can do const foo {.strdefine.} = "abc"; when foo == "abc": ... |
15:02:26 | disruptek | do you mean `case` or do you mean `switch() a la config.nims` or do you mean some Third Way? |
15:02:46 | PrimHelios | i meant `switch()` sorry :P |
15:02:52 | PrimHelios | Araq: that works perfectly, thank you! |
15:15:56 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
15:16:21 | * | ng0 joined #nim |
15:18:15 | * | Trustable joined #nim |
15:25:19 | Araq | hmmm nothing works |
15:27:15 | PrimHelios | is there a way to use a strdefine like that to define a symbol globally? i want to export a function only when testing |
15:32:34 | sealmove | {.global.} might help? |
15:35:14 | Zevv | I use `const someDef* = defined(someDef)` |
15:35:25 | Zevv | and then you can `when someDef` everywhere |
15:35:30 | * | dddddd joined #nim |
15:35:46 | Zevv | compile with -d:someDef to enalbe |
15:35:55 | disruptek | zevv you madlad. |
15:36:53 | * | clyybber joined #nim |
15:36:56 | PrimHelios | hmmm, how do i use multiple pragmas for one symbol? |
15:37:08 | disruptek | i use -d:defineSomeDef and then i `when defined(defineSomeDef): const someDef* = defined(true)` |
15:37:26 | disruptek | {.prag1, prag2.} |
15:37:29 | Zevv | also fine, right |
15:38:05 | PrimHelios | disruptek: tried that, got "Error: cannot attach a custom pragma to 'testing'" |
15:38:10 | disruptek | or sometimes, -d:defineDefineSomeDef if you need to check `when defined(defineDefineSomeDef): ...` |
15:38:15 | PrimHelios | line is "const testing {.strdefine, global.} = true" |
15:38:37 | disruptek | PrimHelios: let's see the whole line. the syntax is `let foo {.praggies.}: string`, fwiw. |
15:39:05 | disruptek | why do you think you need the global pragma? |
15:39:50 | PrimHelios | sealmove recommended it |
15:39:52 | Zevv | beacuse sealmove said so |
15:40:12 | Zevv | he doesnt know sealmove yet! |
15:40:22 | disruptek | what a joker! |
15:40:25 | Zevv | ha |
15:40:34 | disruptek | get a load of this clown! |
15:40:55 | Zevv | PrimHelios: sorry, never mind :) |
15:41:05 | disruptek | `when defined(something): export mySymbol` |
15:42:21 | PrimHelios | i'm trying to achieve this without defining something from the command line but i'm beginning to think that isn't possible |
15:43:06 | disruptek | well, i've done it without hurting anyone i care about. |
15:43:22 | disruptek | are you getting an error message? |
15:43:34 | disruptek | !eval echo "talk to me, son, how can i help?" |
15:43:37 | NimBot | talk to me, son, how can i help? |
15:43:57 | disruptek | it's my back, nimbot. |
15:44:06 | disruptek | !eval echo "stfu disruptek, i'm not talking to you" |
15:44:09 | NimBot | stfu disruptek, i'm not talking to you |
15:44:15 | * | disruptek 😢 |
15:44:16 | PrimHelios | i'm trying to define a symbol in my test file. when that symbol is defined, the library exports a certain function |
15:44:19 | FromGitter | <alehander42> disruptek you'd like https://elm-lang.org/news/the-syntax-cliff |
15:44:43 | disruptek | omg that's nuts, i just starting working on a tool i call `cliff`. |
15:44:48 | disruptek | and it has to do with syntax. |
15:45:15 | FromGitter | <Willyboar> I have a toy cli app named cliff |
15:45:25 | FromGitter | <Willyboar> :) |
15:45:41 | * | krux02 quit (Remote host closed the connection) |
15:45:44 | disruptek | obviously i'm renaming this thing. |
15:45:50 | FromGitter | <Willyboar> no |
15:46:07 | FromGitter | <Willyboar> its just a toy project |
15:46:15 | FromGitter | <Willyboar> not at nimble |
15:46:17 | disruptek | every project i publish is a toy. |
15:46:30 | disruptek | why don't you share your toys, Willyboar? |
15:46:37 | FromGitter | <Willyboar> i do |
15:47:35 | FromGitter | <Willyboar> https://github.com/thebigbaron/cliff |
15:47:50 | clyybber | !eval echo 1; echo 2 |
15:47:52 | NimBot | 1↵2 |
15:49:59 | * | fanta1 joined #nim |
15:50:42 | FromGitter | <alehander42> disruptek |
15:50:44 | FromGitter | <alehander42> what does it do |
15:51:59 | disruptek | ima post the url here once i finish the readme. |
15:55:16 | FromGitter | <alehander42> okk |
15:55:20 | clyybber | !eval echo "am i off?" |
15:55:25 | NimBot | am i off? |
16:04:28 | alexander92 | araq |
16:04:40 | alexander92 | i have to handle an outmem error |
16:04:42 | alexander92 | it happened |
16:05:11 | alexander92 | return error people won |
16:06:14 | shashlick | @lqdev - did you wrap dr_wav |
16:08:57 | Araq | alexander92: there is system.outOfMemHook to deal with it |
16:09:36 | Araq | you can turn it into an exception and handle it, exceptions win |
16:09:47 | alexander92 | nice |
16:10:43 | PrimHelios | is there a simple way to make `nimble test` define a custom symbol, or no? |
16:13:56 | * | xet7 quit (Quit: Leaving) |
16:15:36 | PrimHelios | oh my god i can just do `when not defined(release)` |
16:24:15 | shashlick | @lqdev - http://ix.io/1Zqg <= dr_wav wrapper with new cOverride |
16:25:41 | disruptek | https://github.com/disruptek/gully |
16:25:48 | FromDiscord | <kodkuce> Araq we believe in you , dont back down 🙂 |
16:27:21 | shashlick | very nice @disruptek |
16:27:34 | shashlick | need to figure out how to pass a selection to tool in vim |
16:28:42 | * | PrimHelios quit (Quit: Leaving) |
16:30:12 | * | floppydh quit (Quit: WeeChat 2.6) |
16:32:19 | clyybber | ugh, now this has been an adventure |
16:32:27 | jken | is this approach to interfaces in nim still valid? https://www.openmymind.net/Interfaces-In-Nim/ |
16:32:30 | jken | Post is from 2016 |
16:32:36 | clyybber | newTransNode turns some sons to nil apparently.. |
16:32:50 | clyybber | jken: Sure, if it works it works :) |
16:33:27 | jken | feels kinda hacky so thought I would ask |
16:34:06 | jken | my current design is distinct types that extent a base type, and procs that handle the basetype log a warning saying I should have implemented that method for the distinct type |
16:37:47 | jken | ex, https://play.nim-lang.org/#ix=1Zqi |
16:37:59 | jken | but I feel like there should be a better way to achieve that |
16:38:24 | jken | One that could even be caught at compile time |
16:43:13 | clyybber | If you want the compile time equivalent of interfaces, concepts are the way to go. |
16:44:42 | jken | never heard of them, something new to learn! |
16:45:36 | jken | These? https://nim-lang.org/docs/manual_experimental.html#concepts |
16:46:29 | disruptek | i thought about selection in vim but then i remembered that i zevv's vt52 doesn't support selection on the potato he uses for most of his development. |
16:46:40 | disruptek | yeah, that's it. |
16:47:01 | disruptek | when in doubt, blame zevv. |
16:48:03 | disruptek | shashlick i'm gonna make you guilty for not writing comments one way or another. |
16:50:56 | jken | hmm, if I have a seq[MyType], why can't I add a type that extends MyType into it? |
16:51:44 | disruptek | because seq can only hold a single series of values of a single type. |
16:52:15 | disruptek | because types, man, because types. |
16:52:38 | * | nsf quit (Quit: WeeChat 2.6) |
16:53:20 | jken | I am confused because I seem to be able to add the child type to the seq after it is initialized? |
16:53:22 | jken | example: type |
16:53:22 | jken | MyType = ref object of RootObj |
16:53:22 | jken | MyOtherType = ref object of MyType |
16:53:22 | jken | |
16:53:23 | jken | # Works |
16:53:24 | jken | var list: seq[MyType] |
16:53:25 | jken | list.add(MyOtherType()) |
16:53:27 | jken | # Does not work |
16:53:29 | jken | # var list: seq[MyType] = @[MyOtherType()] |
16:53:31 | jken | oops, sorry.. |
16:53:33 | jken | https://play.nim-lang.org/#ix=1Zqq |
16:54:28 | disruptek | write a test to determine how well the first version "works." |
16:54:54 | jken | I end up with a seq with length 1 |
16:55:24 | disruptek | step next) write another test. |
16:56:00 | clyybber | jken: Report it |
16:56:06 | clyybber | It looks like a bug |
16:56:13 | * | Hideki_ quit (Remote host closed the connection) |
16:56:17 | clyybber | Or an undocumented design "feature" |
16:56:56 | disruptek | no, a "feature" just like having to baseMethod(foo.BaseType) is a "feature". |
16:57:06 | * | Hideki_ joined #nim |
16:57:11 | disruptek | no one said we had to be consistent. |
16:57:21 | disruptek | wait, did anyone say we had to be consistent? |
16:57:34 | planetis[m] | jken: they need to be casted to the base type |
16:57:40 | * | sagax quit (Ping timeout: 268 seconds) |
16:58:23 | planetis[m] | depending of what you -actually- want to implement you can get away without inheritance |
16:59:33 | * | ofelas quit (Quit: shutdown -h now) |
16:59:45 | disruptek | story of my life. |
17:01:22 | planetis[m] | has anyone tryed this tutorial: https://peterroelants.github.io/posts/neural-network-implementation-part04/ to write a neural net? Is it correct? |
17:01:27 | jken | My only other approach at enforcing an interface looked something like this: https://play.nim-lang.org/#ix=1Zqt |
17:01:59 | * | Hideki_ quit (Ping timeout: 268 seconds) |
17:03:26 | planetis[m] | jken: also distinct types are different of what you think: https://nim-lang.org/docs/manual.html#types-distinct-type |
17:03:53 | jken | ah. I specifically mean "non-distinct" then |
17:05:11 | planetis[m] | also look at methods: https://nim-lang.org/docs/manual.html#multiminusmethods |
17:06:06 | clyybber | |
17:06:27 | * | xet7 joined #nim |
17:09:27 | jken | planetis[m], can you demonstrate how you might implement an interface using methods? |
17:11:20 | * | ofelas joined #nim |
17:13:55 | * | fanta1 quit (Quit: fanta1) |
17:15:31 | * | Romanson quit (Quit: Connection closed for inactivity) |
17:15:33 | * | alexander92 quit (Ping timeout: 268 seconds) |
17:16:04 | planetis[m] | glad you asked, :) check my macro https://github.com/b3liever/protocoled |
17:17:15 | planetis[m] | it has a flaw that you need to define all implementations in a single file, but I plan to fix it |
17:17:19 | planetis[m] | just don't know how yet... |
17:17:33 | jken | interesting! taking a look |
17:18:21 | sealmove | is it possible to have recursion in an iterator? for example to traverse a tree. |
17:21:39 | planetis[m] | i think not, sealmove |
17:27:19 | clyybber | sealmove: It is not intended to be possible, but you can if you make the iterator return : auto, see https://github.com/nim-lang/Nim/pull/6807 |
17:27:36 | Araq | clyybber: huh? |
17:27:54 | Araq | that's not a recursive iterator |
17:28:28 | Araq | nobody knows what it is so it wasn't merged :P |
17:29:10 | * | Hideki_ joined #nim |
17:31:55 | disruptek | i think this is just another flavor of the generic tree walker i wrote, and i'm just an idiot with a keyboard. |
17:32:12 | * | fanta1 joined #nim |
17:32:25 | disruptek | i mean, the walker i wrote solves the problem. not sure why we'd need something so poorly defined. |
17:32:55 | Araq | I use a stack inside the iterator to solve that, sealmove |
17:33:56 | sealmove | Araq: yep, algorithms tend to have iterative versions |
17:34:32 | clyybber | Araq: flatitems is recursive in that PR afaict |
17:34:34 | Zevv | disruptek: What did I *do* to you to deserve all this |
17:35:08 | disruptek | your name is as short as araq's and i think it annoys him that i rag on him all day. |
17:35:19 | Zevv | gha |
17:36:28 | disruptek | it's accidentally avoiding a recursion check. |
17:39:57 | Araq | here is the thing: even freeing a single callback object is wrong |
17:40:23 | Araq | what am I missing... |
17:40:35 | Araq | maybe I don't understand async |
17:40:55 | clyybber | Araq: Theres one thing thats a bit ugly with doing default obj fields in transf.nim, that is checking for reset. |
17:41:44 | Araq | clyybber: everything is a bit ugly with this feature :-/ |
17:42:35 | * | PMunch joined #nim |
17:42:41 | * | nixfreak_work quit (Remote host closed the connection) |
17:42:51 | Araq | currently I can do alloc0(sizeof(T)) and get a reasonable state for T, with custom defaults it's not so easy |
17:43:39 | disruptek | ah, tricky, yeah. |
17:44:28 | clyybber | Araq: I think when you do that you are on your own. |
17:47:47 | Araq | Nim v1 is so hard to improve upon :-/ |
17:50:12 | Zevv | Just freeze it and find another job |
17:50:36 | disruptek | that's what i did with my first daughter. |
17:51:24 | Zevv | the 'find another job' kind of messes up the joke, I think |
17:51:31 | Zevv | sorry about that, try again |
17:51:37 | clyybber | wtf |
17:51:46 | clyybber | lol |
17:52:19 | FromDiscord | <kodkuce> dont stop trying,we believe xD |
17:52:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
17:52:55 | Araq | bbl |
17:53:34 | disruptek | nah, i been a sperm donor for almost 30 years now. i wouldn't know how to handle myself in another field. |
17:53:56 | Zevv | good save |
17:54:09 | disruptek | thanks, i gave it a little polish. |
17:54:54 | Zevv | took you a while though. In a real life situation the conversation would have moved on, and you would sit there going "Daaaaang, I messed that up and if I get back to that now everybody will think I'm a dork" |
17:55:24 | Zevv | luckily, IRC is more forgiving - you can just blame your typing seed, or lack thereof |
17:55:33 | disruptek | my typing seed is just fine, thank you. |
17:55:41 | Zevv | just as my potato |
17:55:51 | disruptek | believe it or not, i'm busy working on the Next Great Thing. |
17:55:56 | disruptek | gully is gonna change the world. |
17:56:04 | PMunch | gully? |
17:56:12 | disruptek | steve gully, from houston. |
17:56:25 | disruptek | https://github.com/disruptek/gully |
17:56:58 | disruptek | VOTE GULLY FOR PRES. |
17:58:35 | Zevv | can it do colors? |
17:59:19 | * | solitudesf- joined #nim |
17:59:35 | disruptek | nah, but i did add emoji's to shashlick's bump tool last night. |
17:59:40 | Zevv | haha |
18:00:00 | Zevv | well, personally I loathe these kind of comments, but given the task it does it looks pretty cool! |
18:00:27 | disruptek | thanks, i'm trying something new. |
18:00:38 | disruptek | a little cross-fertilization, if you will, from my day job. |
18:00:50 | Zevv | what is your day job exactly? |
18:01:05 | disruptek | i believe that was uncovered, so to speak, above. |
18:01:07 | Zevv | because given your earlier comments and the term "cross-fertilization" I'm not sure anymore |
18:01:10 | Zevv | oh it was on purpose :) |
18:01:38 | disruptek | i figured i would write the spec and put it on a landing page, first. |
18:01:48 | disruptek | run it up the flag pole and see who salutes. so to speak. |
18:01:48 | Zevv | my wife informs why I'm so annoyingly grinning all the time |
18:02:14 | Zevv | when in doubt, I blame disruptek |
18:02:25 | * | solitudesf quit (Ping timeout: 268 seconds) |
18:05:27 | * | MarderIII quit (Quit: Leaving) |
18:06:43 | * | junland quit (Quit: %ZNC Disconnected%) |
18:08:27 | * | junland joined #nim |
18:10:22 | * | nif_ quit (Quit: ...) |
18:10:31 | * | nif joined #nim |
18:10:37 | PMunch | Huh, gully looks cool |
18:10:52 | PMunch | Certainly something I could see myself adding to an autotask in Vim |
18:11:21 | PMunch | Or maybe just a shortcut |
18:11:53 | disruptek | steve gully is winning hearts and minds, people, HEARTS AND MINDS! |
18:12:20 | PMunch | Is Steve Gully an actual person? |
18:13:57 | disruptek | ima tellim you said that. |
18:14:51 | clyybber | PMunch: Looks like it http://www.stevegulley.com/Band.html |
18:15:31 | disruptek | if i had a band, it'd just be me times three, too. |
18:15:40 | disruptek | what more do you want? |
18:18:21 | jken | I think I like concepts for implementing interfaces... can someone who knows more about them point out any flaws in this example of "implementing an interface" concepts? https://play.nim-lang.org/#ix=1ZqL |
18:18:53 | PMunch | jken, don't tell Araq that :P |
18:19:34 | jken | I am new to nim and am working on internalizing things, is what I am doing there considered an antipattern PMunch ? |
18:20:00 | jken | I like it because the compiler complains if I don't implement a proc it expects |
18:21:10 | PMunch | Well Nim, as you probably have noticed, doesn't have interfaces. The normal way to do them is how `streams` does it: https://nim-lang.org/docs/streams.html#StreamObj |
18:21:24 | PMunch | But when I saw interfaces it was the first thing I thought of as well |
18:22:07 | PMunch | And I don't recall if there is anything wrong with using them as such, but they can do much more |
18:22:24 | jken | That's actually closer to my first approach, I didn't like having to check at runtime if a proc was nil |
18:22:33 | Araq | huh? concepts as interfaces are not implemented, are they |
18:22:41 | PMunch | When I first found them though they were really slow.. |
18:22:55 | PMunch | Araq, well you can do what jken did |
18:23:09 | PMunch | Although he forgoes any type checking |
18:23:29 | jken | (because I only learned about concepts 2 minutes ago and don't know how yet) |
18:23:58 | jken | PMunch, your suggesting my LayerInterface could enforce that init, update, and destroy are procs? |
18:24:07 | PMunch | Well, your example actually doesn't have any types to check for, so that's fine |
18:24:29 | PMunch | Well, the way you have it they don't have to be, they can be a macro or a template as well, which is nice |
18:24:37 | PMunch | I was more thinking about return types |
18:24:41 | PMunch | But you don't have any |
18:25:26 | clyybber | Concepts are like interfaces but at compile time. |
18:25:45 | jken | Curious, what would my LayerInterface need to look like if my init/update/destroy procs had a return type? |
18:26:35 | clyybber | init() is SomeType |
18:26:37 | clyybber | I think |
18:26:55 | PMunch | https://play.nim-lang.org/#ix=1ZqO |
18:27:02 | PMunch | Yeah, pretty much |
18:27:15 | jken | wow |
18:27:21 | jken | Nim continues to amazge. |
18:27:24 | jken | amaze* |
18:27:47 | PMunch | One problem with concepts though, you can't (at least last time I checked) have a list of types of a certain concept |
18:31:14 | jken | One more question, in my project ill have the "interface" (concept) imported from another file, is there a way to say when declaring a type what it needs to use a concept? |
18:31:39 | jken | more of a readability thing, if a fresh nim dev looked at my code they wouldn't see the interface unless they inspected the imported modules |
18:33:13 | disruptek | i usually use a source code filter for that. |
18:38:55 | jken | https://nim-lang.org/docs/filters.html |
18:39:03 | jken | those? How do those help that case? |
18:39:27 | disruptek | i wrote a filter called `translate` and i use it like this: |
18:40:03 | disruptek | #? translate(input="[A-Za-z]", output="[N-ZA-Mn-za-m]") |
18:40:14 | disruptek | problem solved. |
18:40:32 | jken | You might as well be speaking chinese to me right no |
18:40:42 | jken | now* |
18:41:14 | disruptek | that would be amazing. |
18:41:21 | clyybber | nihao |
18:41:31 | disruptek | i might know chinese and i don't even realize it. |
18:41:39 | disruptek | this is blowing my mind right now. |
18:43:38 | disruptek | jken: it's a gag, son: rot13 translation. |
18:45:44 | disruptek | https://gist.github.com/disruptek/1811f673d22fbb5b74c31c858ce276ed |
18:46:52 | FromGitter | <xmonader> Day 18 writing a webframework in nim https://xmonader.github.io/nimdays/day18_webframework.html |
18:48:20 | FromGitter | <xmonader> I gave a session about it today as well at work ^_^ |
18:48:22 | disruptek | jken: everyone knows you cannot create new source code filters for nim. |
18:51:07 | Araq | so ... what problem do we need to solve? |
18:51:43 | Araq | async tasks backed up by a shared memory allocator |
18:51:48 | Araq | right? right. |
18:52:38 | disruptek | the problem is the futures escaping the async closure and then getting gc'd without being discharged by the dispatcher? |
18:52:50 | dom96 | What's the context here? |
18:54:57 | PMunch | dom96, https://irclogs.nim-lang.org/21-10-2019.html#13:40:34 |
18:55:37 | Araq | disruptek: kind of, maybe |
18:57:44 | dom96 | Am I the only one that's happy with the GC for my async needs? :P |
19:00:06 | Zevv | works fine for me, with or without async. |
19:01:03 | disruptek | the question is whether it'll work once the concurrency bomb goes off. |
19:01:37 | disruptek | add threads and shake. serve chilled. |
19:02:21 | PMunch | Yeah.. |
19:02:24 | PMunch | I tried that |
19:02:48 | PMunch | Implemented a work stealer where tasks where co-operatively scheduled, much like how it is in Go |
19:03:16 | PMunch | But I had to use Boehm in order for a task to be able to switch tasks |
19:12:40 | * | krux02 joined #nim |
19:16:18 | Araq | PMunch: you can "deepCopy" a task too, maybe |
19:16:33 | FromGitter | <xmonader> maybe i should have splitted the webframework chapter into more days, doesn't seem to be readable :( |
19:17:17 | Araq | hmmm |
19:17:54 | Araq | that's a system.move right here |
19:18:08 | PMunch | Well, you could probably deep copy the task itself. But what about everything it had allocated while under the old GC? |
19:18:27 | Araq | it's a *deep* copy :P |
19:18:48 | Araq | but you can also move it |
19:18:57 | PMunch | Can you? |
19:19:21 | Araq | if it were backed up by a shared allocator |
19:19:37 | PMunch | If |
19:21:31 | Araq | I wrapped mimalloc, it works |
19:22:46 | * | nsf joined #nim |
19:26:23 | clyybber | Araq: Did in transf.nim, its not that bad actually. |
19:26:38 | clyybber | Bootstrapping still fails for a reason that elides me though. |
19:33:01 | * | daddoo joined #nim |
19:36:09 | Araq | what's the error? |
19:39:56 | clyybber | Its an internal error in genArray |
19:40:28 | clyybber | Because somehow `high(int)` ends up there.. |
19:41:19 | clyybber | Which comes from there: https://github.com/nim-lang/Nim/blob/devel/compiler/dfa.nim#L546 |
19:42:04 | * | lritter quit (Ping timeout: 264 seconds) |
19:45:18 | * | fanta1 quit (Quit: fanta1) |
19:45:29 | clyybber | Araq: Hmm, thinking about it, it would be much simpler if we would transform `Obj(v: 1, b: true)` to `let tmpO = Obj(); tmpO.v = 1; tmp.b = true` |
19:45:43 | clyybber | ; tmpO` |
19:46:55 | * | daddoo left #nim ("Leaving") |
19:47:12 | clyybber | Because I just noticed that I'm currently overwriting the obj contructors arguments with mine with the new transf approach |
19:49:08 | clyybber | s/mine/default fields |
19:50:23 | clyybber | Its not really a requirement though, just wanted your opinion on if we could do that in transf generally |
19:53:33 | Araq | isn't that what I suggested? |
19:55:31 | * | PMunch quit (Remote host closed the connection) |
19:59:46 | clyybber | Oh, I wasn't aware. We were once talking about doing the result variable thing in transf |
19:59:52 | clyybber | Which I yet to do |
20:03:40 | clyybber | Araq: transf is done after injectdestructors right? |
20:04:37 | Araq | injectdestructors is done after transf iirc |
20:06:33 | clyybber | Ah, yeah. Hmm. |
20:11:30 | clyybber | When we do that transformation in transf we don't get that "Copy to sink param" warning for object contructor arguments. |
20:12:12 | clyybber | But I don't think thats a big deal, or even a bad thing. |
20:13:34 | * | couven92 quit (Quit: Client disconnecting) |
20:16:23 | * | filcuc joined #nim |
20:17:28 | clyybber | Araq: WDYT? |
20:18:21 | * | nsf quit (Quit: WeeChat 2.6) |
20:20:26 | * | rockcavera quit (Ping timeout: 240 seconds) |
20:21:36 | * | Hideki_ joined #nim |
20:24:38 | filcuc | krux02: no backport of this one? |
20:24:42 | filcuc | krux02: https://github.com/nim-lang/Nim/pull/12462 |
20:26:14 | * | Hideki_ quit (Ping timeout: 276 seconds) |
20:30:31 | clyybber | Araq: bbl, I'll check the logs if you answer |
20:30:36 | * | clyybber quit (Quit: WeeChat 2.6) |
20:32:25 | krux02 | filcuc: Sorry my mistake, I always forget to add the [backport] tag to my commits. |
20:33:06 | filcuc | krux02: probably this is root problem i had with debugging (i talked about it here yestarday) |
20:33:57 | krux02 | yes |
20:34:14 | krux02 | that is also why I said, go to the latest development version of Nim for debugging. |
20:35:48 | * | sagax joined #nim |
20:36:11 | filcuc | krux02: i'm testing it with my QtCreator plugin and now it work perfectly |
20:36:18 | filcuc | krux02: (btw thank you) |
20:36:33 | krux02 | you debug through QtCreator? |
20:36:50 | filcuc | krux02: yes |
20:36:51 | krux02 | That was my initial attempt with Nim debugging as well. |
20:37:01 | filcuc | krux02: work decently |
20:37:04 | filcuc | works |
20:37:15 | krux02 | can you inspect seq types? |
20:37:15 | filcuc | i can make a gif video if you want |
20:38:35 | krux02 | I remember I had a conversation with a QtCreator developer who was keen to just add support for builtin types on Nim into QtCreator, but I don't know what actually happed to that branch since I decided to write my own gdb integration on a codebase that I understand. |
20:38:42 | krux02 | yes I am interested in a gif |
20:39:09 | filcuc | krux02: i can work and add support for seq |
20:39:23 | filcuc | krux02: it's pretty simple and QtCreator accepts my patches |
20:39:45 | filcuc | krux02: in other words they accept my plugin in their offical repo...so |
20:39:52 | filcuc | krux02: :) |
20:39:53 | krux02 | well, I can tell you so much, The only IDE that I got working with my gdb pretty printers was Eclipse. |
20:40:12 | krux02 | I hate Eclipse, but the gdb integration and the feedback that I got developing the plugin was great. |
20:40:31 | krux02 | but you have to create an eclipse project file in order to be able to start debugging. |
20:40:59 | filcuc | krux02: i'm working on adding nimble support |
20:41:14 | krux02 | nimble in qtcreator? |
20:41:18 | filcuc | krux02: give me a sec for the gif video |
20:41:21 | filcuc | krux02: yes |
20:41:35 | filcuc | at least opening, build and debug |
20:41:36 | filcuc | support |
20:41:45 | filcuc | as bare minimum |
20:41:53 | filcuc | remote debugging later |
20:42:38 | krux02 | well, I use emacs for debugging. |
20:42:45 | * | narimiran quit (Ping timeout: 268 seconds) |
20:43:30 | krux02 | I always open a fresh emacs instance and the stard gdb from it. This way it won't mess with my emacs instance that I use for developiing. |
20:45:01 | FromDiscord | <bird> is there a way to speed up httpclient requests? i have basically the same code implemented in both nim and python3 with http.client, and the python3 instance always wins even when giving nim a ping advantage to the server. I was under the impression that nim would be quicker, so i dont know if theres something glaringly wrong im doing |
20:47:25 | * | dgt joined #nim |
20:49:13 | filcuc | krux02: now i've to find where to host the gif |
20:49:14 | filcuc | :D |
20:49:26 | disruptek | alehander42: did you try impl some of these syntax cliff lessons? |
20:49:32 | * | lqdev[m] uploaded an image: image.png (490KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/SReCWzQigaqUiIAvgMFZWhKO > |
20:49:34 | krux02 | giphy |
20:50:06 | lqdev[m] | great scott |
20:50:27 | disruptek | lqdev[m]: i'm sure it's nothing. |
20:55:08 | filcuc | krux02: https://gifyu.com/image/kU4l |
20:55:19 | filcuc | krux02: https://codereview.qt-project.org/c/qt-creator/qt-creator/+/274127 |
20:55:42 | filcuc | krux02: the second link is the actual pull request state...it's not completed yet...i've to finish wizards for nimble project creation |
20:58:29 | krux02 | I can see, the string is show correctly in qt creator |
20:58:35 | disruptek | that's pretty neat. |
20:58:55 | disruptek | i've always had a thing for italian seqs. |
20:59:30 | filcuc | italian seqs? |
21:00:00 | disruptek | i mean, they may not be very long, but they make up for it with hand motions. |
21:00:32 | filcuc | disruptek: you mean gestures? |
21:00:45 | disruptek | well, that's one way to put it. |
21:01:24 | filcuc | disruptek: it's a stereotype we don't use so much |
21:01:31 | filcuc | them |
21:01:45 | * | Vladar quit (Quit: Leaving) |
21:02:48 | filcuc | disruptek: furthermore habits change a log from place to place in italy :) |
21:02:57 | filcuc | lo |
21:03:00 | filcuc | lot |
21:03:48 | disruptek | that's true. sometimes milan feels like another country. |
21:05:30 | * | Trustable quit (Remote host closed the connection) |
21:05:49 | * | nif quit (Quit: ...) |
21:05:56 | * | rockcavera joined #nim |
21:05:59 | * | nif joined #nim |
21:12:23 | FromGitter | <jason_koch_twitter> i've packaged up some wrapper libs for nim - i have put it on nimterop wrappers wiki, i'll shortly put it in nimble directory ⏎ ⏎ anything else i should do? ⏎ ⏎ i might write up a blog article - it's a libbpf wrapper, allows use of ebpf programs from nim [https://gitter.im/nim-lang/Nim?at=5dae1f379825bd6baca39bb3] |
21:12:31 | * | couven92 joined #nim |
21:14:39 | shashlick | Nice work! |
21:16:25 | * | alexander92 joined #nim |
21:26:02 | * | solitudesf- quit (Ping timeout: 276 seconds) |
21:33:52 | * | filcuc quit (Quit: Konversation terminated!) |
21:39:01 | Zevv | https://sourcesort.com/interview/andreas-rumpf-on-creating-and-growing-nim |
21:42:26 | Zevv | "In retrospect, everything was harder than it first looked" :) |
21:43:40 | disruptek | that's what she said. |
21:55:13 | Araq | hmmm walking dead is boring |
21:59:27 | Araq | will the zombies ever die out? |
21:59:36 | Araq | anybody read the comics? |
22:01:39 | disruptek | i think the idea is that zombies start with death and go from there. |
22:05:56 | sealmove | what I like in walking dead is that zombies are just the setting, they don't evolve or anything crazy, so the story is more about humans and not zombies. |
22:06:14 | disruptek | yeah, great. |
22:06:23 | disruptek | what we need are more stories about humans. |
22:07:34 | disruptek | "it's the zombies that imbue real humanity to this story." |
22:07:58 | sealmove | something like that |
22:08:31 | sealmove | but it's just preference, since I don't like sci-fi |
22:10:47 | disruptek | so, what other sci-fi can you recommend for its lack of offensive science fiction and extra large dose of reality? |
22:11:14 | disruptek | have you seen Dark? |
22:22:04 | * | Hideki_ joined #nim |
22:22:12 | sealmove | yes, now rewatching season 1 with a friend before starting season 2 |
22:22:14 | sealmove | i love it |
22:23:05 | sealmove | sci-fi in small dose is the best |
22:26:39 | krux02 | there is a lot of different kinds of sci-fi. |
22:26:51 | disruptek | what would you call a "large dose"? larger than time travel, the inception paradox, reanimation, and immortality, i mean. |
22:26:55 | * | Hideki_ quit (Ping timeout: 265 seconds) |
22:28:11 | krux02 | there is Sci-fi in distant future that actually just describes our society but allows us to see it from far away, there is sci fi that is just about telling about some technology that would be cool to have, and there is more |
22:29:17 | disruptek | i really wanted to like altered carbon but i hated it. horrible. very poorly done, imo. |
22:29:18 | krux02 | there is sci fi that is neither about the society, nor the technology, it is just a setting that works for a certain kind of story, like Alien. |
22:29:47 | krux02 | I like alternate timeline sci-fi |
22:29:57 | * | dgt quit (Ping timeout: 250 seconds) |
22:30:14 | krux02 | steampunk and stuff like that. |
22:30:44 | krux02 | Iron Sky |
22:31:38 | disruptek | what kinda authors? |
22:32:21 | disruptek | like, neal stephenson quicksilver? |
22:33:50 | * | Jesin joined #nim |
22:46:39 | * | nif quit (Quit: ...) |
22:46:50 | * | nif_ joined #nim |
22:51:52 | FromDiscord | <krab4t> how do you check in nim if object's field has value for bool? something about nils 🤔 |
22:52:38 | * | tiorock joined #nim |
22:52:38 | * | tiorock quit (Changing host) |
22:52:38 | * | tiorock joined #nim |
22:52:38 | * | rockcavera quit (Killed (cherryh.freenode.net (Nickname regained by services))) |
22:52:38 | * | tiorock is now known as rockcavera |
22:56:52 | FromDiscord | <krab4t> i can't because they all autoinitialized with false? sad panda |
22:59:34 | * | clyybber joined #nim |
23:02:21 | * | clyybber quit (Client Quit) |
23:22:51 | * | krux02_ joined #nim |
23:24:05 | krux02_ | krab4t: are you compiling to js or C? |
23:24:45 | krux02_ | the default compilation target is C, and there a bool has two states, true or false, you cannot set it to something else, like nil or something. |
23:25:12 | krux02_ | when you compile to js, the same constrained is applied, even if the compilation target would allow something else. |
23:25:18 | * | krux02 quit (Ping timeout: 245 seconds) |
23:32:48 | * | ng0 quit (Ping timeout: 260 seconds) |
23:32:49 | * | lbartoletti joined #nim |
23:34:08 | * | couven92 quit (Read error: Connection reset by peer) |
23:34:28 | krux02_ | how do you do addInt on the js backend? |
23:34:34 | krux02_ | aparently it doesn't exist. |
23:34:35 | * | lbart quit (Ping timeout: 265 seconds) |
23:37:37 | * | ng0 joined #nim |
23:47:43 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:53:26 | * | sealmove quit (Quit: WeeChat 2.6) |