00:23:40 | FromGitter | <Varriount> Huh, I wonder why #rust is on mozilla, rather than freenode. |
00:33:54 | * | krux02 quit (Quit: Leaving) |
00:38:49 | FromGitter | <asampal> I've built Nim from source and everything seemed to go OK. When I try to invoke `nimble`, I see `could not load: (libcrypto-1_1-x64|libeay64).dll`. Do I need to download these separately? |
00:46:39 | FromGitter | <Varriount> @asampal They should be available as part of the pre-built Nim compiler available on the website. |
00:47:06 | FromGitter | <Varriount> You can download that and copy the dlls to Nimble's binary directory. |
00:51:58 | FromGitter | <asampal> so nimble is built from a separate repo? |
00:53:06 | FromGitter | <asampal> I noticed that after building Nim (as per instructions on GitHub page), there was a nimble.exe (I'm on Windows) in Nim/bin. |
00:54:05 | FromGitter | <asampal> Didn't pay attention to see where it was copied from, but if it wasn't built when building Nim itself, why wouldn't the dlls be copied to Nim/bin as well? |
00:54:38 | Calinou | https://nim-lang.org/download/dlls.zip |
00:54:45 | Calinou | you can fetch Windows DLLs used by Nim here ^ |
00:54:48 | Calinou | (64-bit + 32-bit) |
00:55:38 | FromGitter | <asampal> tha;nks |
01:10:16 | FromGitter | <asampal> should the VSCode extension see nimble packages? |
01:11:42 | FromGitter | <asampal> I installed Karak following the GitHub readme and created a Nim file with the Hello World example there, but it doesn't look like VSCode is seeing Karax. |
01:13:13 | FromGitter | <asampal> I'm guessing there should be some kind of project file that specifies dependencies, no? |
01:14:59 | * | dddddd quit (Remote host closed the connection) |
01:17:31 | FromGitter | <asampal> so I ran `nimble init` to generate a package config file |
01:18:27 | * | mwbrown quit (Ping timeout: 240 seconds) |
01:19:38 | FromGitter | <asampal> added a `requires` for karax and the source file seems fine now |
01:20:08 | * | mwbrown joined #nim |
01:26:29 | FromGitter | <asampal> After building `karun` should the executable normally be added to the path? |
01:30:53 | FromGitter | <asampal> I guess I'm assuming karax is a popular framework and that people here know what I'm talking about - is it a thing in the Nim community? |
01:36:50 | FromGitter | <Varriount> @asampal If I had to guess, karun is a utility bundled with the karax module |
01:37:19 | FromGitter | <rayman22201> Karax is the premier web framework for Nim, I just don't do a lot of web stuff with Nim... so I can't help much :-/ |
01:38:00 | FromGitter | <rayman22201> Karun is the build tool for karax. It should be safe to add to your PATH. idk if it's required though. |
01:38:53 | FromGitter | <asampal> np about not being familiar with Karax in particular, but maybe you could tell me how include works wrt finding source |
01:39:46 | FromGitter | <asampal> @Varriount , yes that's what it is, and I built the executable - just don't know if the practice is to have it on the path |
01:40:14 | FromGitter | <rayman22201> https://nim-lang.org/docs/manual.html#modules |
01:40:25 | FromGitter | <rayman22201> What do you want to know about importing? |
01:41:31 | FromGitter | <rayman22201> basically, the filename is the module name |
01:41:52 | FromGitter | <asampal> it's not an import that I'm using, but `include` - and the question is where does Nim look for source? |
01:42:20 | FromGitter | <asampal> I understand that packages are downloaded as source, no? |
01:42:59 | FromGitter | <asampal> so that if I installed karax and the source is now under .nimble, Nim should be able to reach the source for any package |
01:45:57 | FromGitter | <asampal> hmm, I think I see what happened - I ran `nimble develop karax` and then moved the source directory |
01:46:30 | FromGitter | <asampal> so that the link file for karak, under .nimble was no longer valid |
01:47:06 | FromGitter | <rayman22201> include just copy/pastes the source, similar to C #include. |
01:48:16 | FromGitter | <asampal> yes, that's what I understood from the docs |
01:48:49 | FromGitter | <rayman22201> 👍 |
01:49:55 | FromGitter | <rayman22201> As far as path searching goes, It will go use the .nimble, so if that is correct that will throw things off |
01:51:52 | FromGitter | <rayman22201> Nim will generally use any config files nim.cfg, follwed by .nimble, and default to the root of the project directory. I believe. |
01:52:41 | FromGitter | <asampal> I fixed the link pointer and now running the karax Hello World runs (mostly), but I get `Error: This module only works on the JavaScript platform` when I try to run the file from VSCode |
01:53:11 | FromGitter | <asampal> I guess the run command in the extension is assuming C |
01:54:50 | FromGitter | <Quelklef> Anyone know how I can make https://gist.github.com/Quelklef/0ce5c96ba2fd926750e95733b9d54cf5 work? |
01:55:00 | FromGitter | <Quelklef> It works if I make `T` a formal parameter, but I specifically don't want that |
01:57:36 | FromGitter | <Quelklef> For some reason it's not recognizing that `2` matches `static[int]`. Is this a bug? |
01:58:53 | FromGitter | <Quelklef> I take that back, it seems to be complaining that `typeImpl[2]` isn't a type.. |
02:08:19 | FromGitter | <rayman22201> @asampal I don't know how to do it in VS code, but you need to use `nim js` instead of `nim c` |
02:10:01 | FromGitter | <asampal> yes, I changed the settings in VSCode to build with js and it built, but, according to the karax readme, the proper way to run the example is with `karun` |
02:13:22 | FromGitter | <asampal> Trying to run the file with `nim js` resulted in an error stating that `document` wasn't found. Of course the resulting js file needs to be run in a JavaScript runtime with DOM access, otherwise the generated references couldn't be resolved. |
02:13:45 | FromGitter | <rayman22201> I'm assuming `karun` would run `nim js` for you |
02:13:53 | FromGitter | <asampal> I guess `karun` does that - maybe by running with node - need to read up on what it actually does. |
02:14:41 | * | NimBot joined #nim |
02:14:47 | FromGitter | <rayman22201> you still have to run it in a browser yourself |
02:15:52 | FromGitter | <rayman22201> the `document` not found is most likely not the browser DOM document, but a Nim shim that needs to referenced or imported. |
02:16:33 | FromGitter | <rayman22201> I'm out of my depth here, sorry I can't be more specific. |
02:17:50 | FromGitter | <rayman22201> @Quelklef Your macro is interesting. It looks like Nim assigns at least some type definitions before it runs macros. It looks like your macro isn't even running. |
02:18:43 | FromGitter | <asampal> I think it is the browser document since it's in the generated JavaScript and it's specifically this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b553b034b880b3e6a40d4fb] |
02:20:27 | FromGitter | <rayman22201> are you trying to run that javascript outside the browser? |
02:21:40 | FromGitter | <rayman22201> can you post the exact error you got? |
02:22:35 | FromGitter | <Quelklef> @rayman22201 Yeah, I tried `echo(result.repr)`-ing, but that never got run. I'm not totally sure what's going on |
02:23:17 | FromGitter | <asampal> well, I ran `nim js -r "c:\dev\projects\_nim\newnim\src\main.nim"` which tries to run the result, but I guess not in the proper environment |
02:23:34 | FromGitter | <asampal> anyhow, I'm trying with karun, as their readme instructs |
02:24:09 | FromGitter | <rayman22201> don't do -r |
02:24:13 | FromGitter | <rayman22201> @asampal |
02:24:35 | FromGitter | <asampal> it worked with `karun` - a page opened in the browser |
02:25:24 | FromGitter | <asampal> oh, so just to build, not run automatically |
02:25:26 | FromGitter | <rayman22201> `nim -r` will cause Nim to try and run the code in terminal. not what you want |
02:25:34 | FromGitter | <asampal> yeah, got it |
02:26:03 | FromGitter | <rayman22201> @Quelklef I'm confused by this too. I'm investigating |
02:26:23 | FromGitter | <Quelklef> Cool, LMK if you find anything. I'm gonna see if there are any open issues or any discussion about it |
02:27:20 | FromGitter | <rayman22201> I have to go make dinner soon, so I don't think I will be able to dig into it until a bit later, but I'll let you know if I find anything |
02:32:04 | FromGitter | <rayman22201> @Quelklef this works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b553e23f02a0977a3f2b053] |
02:32:29 | FromGitter | <rayman22201> ignore the comment. I forgot to remove it from your earlier example |
02:32:54 | FromGitter | <rayman22201> macros don't like generic type params that are not formal arguments? idk |
02:33:12 | FromGitter | <rayman22201> You specifically don't want it to be a formal argument right? |
02:33:20 | FromGitter | <rayman22201> Is there a reason you want that behavior? |
02:33:34 | FromGitter | <rayman22201> of course there is. What is the reason? |
02:40:53 | FromGitter | <gogolxdong> python generated SOAP request works , difference is not using the serialized string directly but substitude `<?xml version="1.0" encoding="UTF-8"?>\n` with concating xmlHeader manually. |
02:46:47 | zacharycarter[m] | I have karax working with wasm kind of |
02:46:55 | zacharycarter[m] | just lots of work to do still - but I have dom diffing / rendering working |
02:47:02 | FromGitter | <gogolxdong> Then problems come up , there are more than four thousands data types , we have to serialize these by hand at issuing requests, but still efficient compared to using newElement and set attributions with newStringTable , I think. |
02:47:54 | FromGitter | <gogolxdong> Did you compile nim to wasm ? |
02:48:47 | zacharycarter[m] | no I'm using emscripten |
02:49:37 | zacharycarter[m] | but yes the entire Nim program eventually compiles down to wasm |
02:50:03 | zacharycarter[m] | I guess the best way to describe what I'm building is - https://github.com/DenisKolodin/yew |
02:51:03 | FromGitter | <gogolxdong> How to you manage layouts and transitions? |
02:51:30 | * | ieatnerd1 joined #nim |
02:51:33 | FromGitter | <gogolxdong> I'm trying to build a frontend framework based on karax. |
02:52:29 | FromGitter | <Quelklef> @rayman22201 The reason is that I have a `Coloring[T: static[int]]` type that I want to be implemented as a `TwoColoring` for `T == 2` and a `NColoring[T]` for all other `T`, for efficiency reasons |
02:53:16 | FromGitter | <Quelklef> Essentially, I have a `Coloring[T]` but can make a bunch of optimizations if `T` is 2, so I want to be able to transparently implement those operations while still having a generic `Coloring[T]` type |
02:53:36 | FromGitter | <Quelklef> eghhhhh both of those explanations were a little circular; hopefully they made sense |
02:54:36 | * | rockcavera joined #nim |
02:54:44 | * | erratic quit (Ping timeout: 256 seconds) |
02:55:20 | FromGitter | <rayman22201> That shouldn't be affected by whether you have the macro take the int as a formal param or not? |
02:56:42 | FromGitter | <Quelklef> That's what I'm thinking. But apparently it is... |
02:57:23 | FromGitter | <Quelklef> Do you think I should open an issue? |
02:59:53 | FromGitter | <Quelklef> I can't find an open issue about it |
03:08:57 | FromGitter | <asampal> I see Karax uses a virtual DOM like most other similar-purpose frameworks. Does anyone here know if, when it was started there was any thought about working with the actual DOM, as Imba (http://imba.io) does. Imba uses a caching method with the DOM elements it constructs which makes access really fast - much faster than React, Vue, etc. |
03:09:56 | FromGitter | <asampal> One of the benchmarks - https://somebee.github.io/dom-reconciler-bench/index.html |
03:10:31 | FromGitter | <Quelklef> @Araq @dom96 is https://gist.github.com/Quelklef/0ce5c96ba2fd926750e95733b9d54cf5 a bug? |
03:11:57 | * | ieatnerd1 quit (Ping timeout: 240 seconds) |
03:14:09 | zacharycarter[m] | gogolxdong: I don't plan on doing so |
03:14:21 | FromGitter | <Varriount> @Quelklef |
03:14:33 | zacharycarter[m] | asampal: I think there is an experiment in karax that does that |
03:14:42 | zacharycarter[m] | I need to check this out - this might be a better approach for me to take as well |
03:14:45 | FromGitter | <Quelklef> yeah varriount? |
03:14:56 | FromGitter | <Varriount> Don't you need to call the macro? |
03:15:05 | FromGitter | <Quelklef> No, doesn't work either way |
03:15:09 | FromGitter | <Quelklef> Same error |
03:15:21 | FromGitter | <Quelklef> And I've seen and used templates defined with no params and called without `()`s IIRC |
03:15:54 | zacharycarter[m] | asampal: https://github.com/pragmagic/karax/blob/master/experiments/trello/knete.nim |
03:16:11 | zacharycarter[m] | i guess I'm porting this now to my wasm thing :P |
03:17:41 | FromGitter | <asampal> nice - but I think the caching is an important aspect in how Imba achieves its great performance - not sure if this experiment does something similar |
03:18:58 | zacharycarter[m] | yeah - I'll have to look into that |
03:20:23 | * | endragor joined #nim |
03:21:06 | FromGitter | <gogolxdong> Are you going to try DOM caching rather than regular Virtual DOM solution like what karax using now with vdom? |
03:22:20 | FromGitter | <gogolxdong> knete manupulates DOM directly. |
03:22:27 | FromGitter | <asampal> @zacharycarter - maybe you want to take a look at the JavaScript Imba generates, to see what it's doing |
03:22:33 | zacharycarter[m] | I don't know what I'm going to do |
03:22:43 | zacharycarter[m] | I guess there's also - https://mithril.js.org/ |
03:23:08 | FromGitter | <asampal> take a look here - http://imba.io/guides/advanced/performance |
03:23:24 | zacharycarter[m] | and of course - https://markojs.com/ |
03:24:18 | zacharycarter[m] | interesting |
03:24:44 | FromGitter | <asampal> yeah, I thought so |
03:26:21 | FromGitter | <gogolxdong> much much faster than virtual DOM, Imba video says so, lol |
03:27:18 | FromGitter | <gogolxdong> Sadly, virtual doms are still quite slow. Imba has chosen a very different approach that turns out to be a lot faster. |
03:27:41 | zacharycarter[m] | I still wonder how it compares to markojs |
03:28:54 | FromGitter | <asampal> me too - do you know if Marko uses a virtual DOM? |
03:29:10 | zacharycarter[m] | I don't |
03:29:10 | FromGitter | <gogolxdong> I got the point, it's another different approach to manipulate DOM. |
03:29:10 | zacharycarter[m] | https://svelte.technology/ |
03:29:14 | zacharycarter[m] | also has caught my eye |
03:30:14 | zacharycarter[m] | I don't believe marko does - apparently there is an implementatin of marko that uses a vdom |
03:30:18 | zacharycarter[m] | but by default I guess not |
03:30:35 | zacharycarter[m] | https://github.com/marko-js/marko/tree/master/src/runtime/vdom |
03:30:40 | zacharycarter[m] | err wait - it looks like it does afterall |
03:33:31 | zacharycarter[m] | https://markojs.com/docs/why-is-marko-fast/ |
03:42:12 | FromGitter | <rayman22201> @Quelklef I would think `var a : typeImpl[2]` should work, but why is `var a: typeImpl(2)` not sufficient? |
03:57:44 | FromGitter | <Quelklef> No, it is |
03:57:51 | FromGitter | <Quelklef> It works as a formal parameter |
03:57:58 | FromGitter | <Quelklef> Oh, you mean why can't I use that |
03:58:14 | FromGitter | <Quelklef> Essentially because it keeps `Coloring[T]` a type both semantically and syntactically |
03:58:43 | FromGitter | <Quelklef> Although I suppose I could always `type ColoringImpl[T] = ... ; template Coloring(T) = Coloring[T]` if I change it later, so I should just to `typeImpl(2)` |
04:00:49 | FromGitter | <Quelklef> Oh shit |
04:01:05 | FromGitter | <Quelklef> `proc fT (c: TypeImpl[C])` doesn't work |
04:02:09 | FromGitter | <Quelklef> Oh boy a SIGSEGV |
04:03:05 | FromGitter | <rayman22201> Well that's a bug lol |
04:03:38 | FromGitter | <Quelklef> Yeah on my way to the git issues |
04:06:24 | FromGitter | <rayman22201> Good work! |
04:06:52 | FromGitter | <Quelklef> 😄 |
04:08:49 | * | drazan quit (Remote host closed the connection) |
04:10:47 | * | drazan joined #nim |
04:34:33 | * | mwbrown quit (Ping timeout: 264 seconds) |
04:39:19 | * | xylef joined #nim |
04:54:05 | * | nsf joined #nim |
04:58:48 | * | mwbrown joined #nim |
05:22:59 | * | leorize quit (Ping timeout: 265 seconds) |
05:35:58 | * | stefanos82 joined #nim |
05:50:36 | * | leorize joined #nim |
05:55:45 | * | leorize quit (Ping timeout: 248 seconds) |
05:56:15 | * | leorize joined #nim |
06:05:16 | * | Vladar joined #nim |
06:20:05 | * | yglukhov[i] joined #nim |
06:25:00 | * | yglukhov[i] quit (Ping timeout: 268 seconds) |
06:26:45 | zacharycarter[m] | https://github.com/zacharycarter/zapp |
06:29:28 | FromGitter | <Quelklef> aw man |
06:29:45 | FromGitter | <Quelklef> if wasm gets big then the days of javascript inspecting & tinkering will be over :( |
06:35:05 | stefanos82 | in case you haven't figure it out yet, they are unifying all programming languages under a common umbrella called wasm |
06:35:08 | zacharycarter[m] | wasm is pretty sweet if you ask me |
06:35:21 | stefanos82 | their objective is to get rid of the desktop applications and take everything on the cloud |
06:35:45 | FromGitter | <Quelklef> Google probably needs new pants |
06:36:21 | FromGitter | <kayabaNerve> stefanos82 What time zone are you? |
06:36:34 | stefanos82 | the twilight of course |
06:36:48 | stefanos82 | you are wondering whether I slept or not lol |
06:36:49 | stefanos82 | I didn't |
06:38:08 | stefanos82 | we are under a red flag alert for 2 days. we have reached 42 Celsius (107.6 F) and everything is boiling |
06:38:18 | stefanos82 | we cannot sleep even with a/c on |
06:38:37 | FromGitter | <Quelklef> woah where are you? |
06:38:43 | zacharycarter[m] | where do you live? |
06:38:43 | stefanos82 | Cyprus |
06:38:44 | zacharycarter[m] | if you don't mind me asking? |
06:38:55 | zacharycarter[m] | ooph |
06:39:09 | FromGitter | <Quelklef> christ don't die over there |
06:39:31 | stefanos82 | every time Africa farts, the sand and heatwaves greets us with gratitude lol |
06:39:52 | stefanos82 | now I know how that poor Snowman feels when it melts |
06:40:30 | FromGitter | <Quelklef> lol |
06:40:38 | stefanos82 | there is a positive side though |
06:40:44 | stefanos82 | laundry gets dried within 15 minutes! |
06:40:44 | FromGitter | <kayabaNerve> @Quelklef How's your C FFI knowledge? |
06:41:11 | stefanos82 | kayabaNerve: don't tell me you are still struggling with the wrapped code |
06:41:11 | FromGitter | <Quelklef> @kayabaNerve Never used it and don't know C |
06:41:20 | FromGitter | <kayabaNerve> I haven't worked on it since :P |
06:41:29 | FromGitter | <kayabaNerve> @Quelklef I meant your Nim wrapping C :P |
06:41:40 | FromGitter | <Quelklef> Eh? |
06:41:54 | FromGitter | <Quelklef> Yeah I know, but I don't mess with the C FFI 'cause I don't know C |
06:41:56 | FromGitter | <kayabaNerve> But yeah. It's still broken as hell because I haven't touched it since I do have jobs |
06:42:10 | FromGitter | <kayabaNerve> Argon2.o: In function `Argon2_LXoXxA4bUETX9cn8hX3n8qA': Argon2.nim:20: multiple definition of `Argon2_LXoXxA4bUETX9cn8hX3n8qA' |
06:42:12 | FromGitter | <kayabaNerve> Enlightening |
06:42:37 | FromGitter | <kayabaNerve> In the object file for the file, there's a definition of a function found in the file. |
06:42:41 | FromGitter | <kayabaNerve> Who would've though |
06:42:58 | FromGitter | <Quelklef> w0t |
06:43:14 | FromGitter | <kayabaNerve> BTW. I'm still doing my jobs. I just wanted to see of Quellie knew anything. |
06:43:58 | FromGitter | <Quelklef> who now |
06:44:33 | FromGitter | <kayabaNerve> The Nim file is linking itself twice I guess? And then the C compiles but then can't find the function it was linked against despite there being relevant .o s. |
06:44:38 | FromGitter | <gogolxdong> How to run your zapp test? |
06:44:46 | FromGitter | <kayabaNerve> stefanos82 GDI. I found the issue. |
06:44:57 | FromGitter | <Quelklef> oh by the way @kayabaNerve I just recently had my birthday so we're not the same age anymore |
06:45:01 | FromGitter | <Quelklef> sorry mate |
06:45:02 | FromGitter | <kayabaNerve> Did you know case insensitivity applies to Nim and C files? |
06:45:30 | FromGitter | <kayabaNerve> So argon2.c and Argon2.nim, even when using the paths in compile, cause Argon2.nim to get compiled and linked twice? |
06:45:40 | FromGitter | <kayabaNerve> You betrayed me. |
06:46:30 | FromGitter | <kayabaNerve> And I can't change the name of the C so I guess I'm not forced to change the name of my Nim... Argon2 to Argon? I mean technically, it's not even Argon2. It's Argon2d which is a variant of the Argon2 algo. |
06:46:46 | FromGitter | <Quelklef> :o |
06:54:19 | stefanos82 | kayabaNerve: can you open a ticket with this case? |
06:54:24 | stefanos82 | it needs to get investigated |
06:54:24 | * | dddddd joined #nim |
06:55:20 | FromGitter | <kayabaNerve> Does it? |
06:56:17 | stefanos82 | yes |
06:56:39 | FromGitter | <gogolxdong> @zacharycarter /mnt/d/zapp/src/zapp/zdom.nim(530, 16) Error: undeclared identifier: 'globalEmbindObject' |
06:56:41 | stefanos82 | tag it as "Question" |
06:59:21 | FromGitter | <gogolxdong> not sure but looks like it's from jsbind https://nimpkgdir.firelet.net/ci/badges/jsbind/nimdevel/doc_build_output.html |
06:59:42 | zacharycarter[m] | yes you need to do a nimble install first |
06:59:50 | zacharycarter[m] | then do |
07:00:10 | zacharycarter[m] | nim c -d:emscripten src/zapp.nim from the root of the directdory |
07:00:15 | zacharycarter[m] | I've only tested on osx so far |
07:02:58 | FromGitter | <gogolxdong> Do you use emsdk? |
07:03:33 | FromGitter | <kayabaNerve> stefanos82: Can I also complain about path consistency while at it? |
07:03:37 | zacharycarter[m] | yes |
07:03:43 | FromGitter | <kayabaNerve> {.passC: "-Isrc/lib/Argon/include".} ⏎ {.compile: "Argon/src/argon2.c".} ⏎ {.header: "../../src/lib/Argon/include/argon2.h", importc: "argon2d_hash_raw".} |
07:04:03 | FromGitter | <kayabaNerve> One is from the project, one is relative, and one is relative to the nimcache directory |
07:04:51 | stefanos82 | kayabaNerve: feel free to express any concern of yours, but do it in a polite, yet diplomatic and elegant way. |
07:08:19 | * | ieatnerd1 joined #nim |
07:08:59 | FromGitter | <kayabaNerve> https://github.com/nim-lang/Nim/issues/8407 |
07:12:46 | * | ieatnerd1 quit (Ping timeout: 260 seconds) |
07:16:49 | FromGitter | <gogolxdong> @zacharycarter --shell-file /Users/zachcarter/projects/zapp/static/index.html should be static/index.html |
07:18:42 | FromGitter | <kayabaNerve> https://github.com/nim-lang/Nim/issues/8408 |
07:19:59 | FromGitter | <gogolxdong> @zacharycarter got plain {{{ SCRIPT }}} HTML |
07:21:05 | * | leorize quit (Ping timeout: 240 seconds) |
07:21:40 | * | leorize joined #nim |
07:23:00 | FromGitter | <gogolxdong> This uses wasm ,doesn't involve DOM manipulation right?, if it does , it uses Virtual DOM or something like lmba? |
07:23:37 | stefanos82 | Araq: am I missing something here? https://github.com/apache/mynewt-nimble |
07:26:47 | * | leorize quit (Ping timeout: 244 seconds) |
07:28:16 | * | yglukhov[i] joined #nim |
07:30:19 | zacharycarter[m] | yes it uses vdom and dom diffing |
07:30:31 | * | leorize joined #nim |
07:30:31 | zacharycarter[m] | just basically put karax in wasm |
07:32:33 | FromGitter | <gogolxdong> what's benefit? |
07:34:32 | FromGitter | <gogolxdong> Do you want to compile nim down to wasm and using cached DOM at the same time? Does this technology Imba uses have a name? |
07:35:55 | * | floppydh joined #nim |
08:06:22 | zacharycarter[m] | the benefit would be - you don't have to write javascript |
08:06:40 | zacharycarter[m] | and you could potentially run more performant sensitive code |
08:07:00 | zacharycarter[m] | I don't know that there's much of a point - Rust has a project that does something similar minus emscripten, so I figured I might as well make one to play around |
08:08:58 | * | NamPNQ joined #nim |
08:10:26 | FromGitter | <kayabaNerve> @Quelklef I found a new use for Result Error |
08:22:21 | FromGitter | <gogolxdong> How do you manage layout and transition? |
08:27:44 | FromGitter | <kayabaNerve> :( I have a Memory leak. |
08:29:00 | zacharycarter[m] | I'm not going to manage them |
08:29:03 | zacharycarter[m] | that's kind of beyond the scope of this |
08:29:13 | zacharycarter[m] | going to bed - night |
08:36:07 | FromGitter | <gogolxdong> good night. |
09:09:35 | FromGitter | <mratsim> The original post is moderated, and I feel I’m missing some key things for a potentially important topic :/ :https://forum.nim-lang.org/t/4068 |
09:25:52 | * | erratic joined #nim |
09:30:00 | dom96 | Yeah, I need to fix that bug |
09:32:51 | * | yglukhov[i] quit (Remote host closed the connection) |
10:01:27 | * | yglukhov[i] joined #nim |
10:03:50 | FromGitter | <kayabaNerve> Morning dom |
10:05:25 | * | yglukhov[i] quit (Remote host closed the connection) |
10:08:10 | * | yglukhov_ joined #nim |
10:10:41 | * | leorize quit (Ping timeout: 248 seconds) |
10:19:58 | FromGitter | <mratsim> Oh - https://github.com/zacharycarter/zapp “Web app framework for Nim targeting WASM via emscripten" |
10:24:59 | dom96 | Good morning kayabaNerve |
10:32:26 | * | TheLemonMan joined #nim |
10:34:19 | TheLemonMan | dom96, yo, are you up for testing some code on osx? |
10:35:56 | dom96 | Depends how easy the testing is |
10:36:33 | TheLemonMan | it ranges from really easy to very easy :) |
10:37:34 | FromGitter | <zetashift> oh cool we have https://github.com/Skrylar/raylib-nim bindings :O |
10:41:21 | FromGitter | <tim-st> why does calling `system.instantiationInfo().filename` yields `???` but `system.currentSourcePath` works which calls it too? |
10:43:19 | FromGitter | <tim-st> ok, I understood, how it works, this only works when called inside a template |
10:47:29 | FromGitter | <tim-st> can I invoke a template "anonymously"? |
10:47:31 | dom96 | TheLemonMan: alright, go on then |
10:49:00 | TheLemonMan | dom96, grab https://github.com/LemonBoy/criterion.nim and try out the example in the readme. If anything goes wrong feel free to open a ticket or just wait for me to pop up again, I'll check out the irc logs, g2g now. |
10:49:22 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
10:50:12 | dom96 | /Users/dom/.nimble/pkgs/criterion-0.1.0/criterion/timer.nim(33, 62) Error: undeclared field: 'denum' |
10:52:15 | * | Ven`` joined #nim |
10:52:19 | * | Ven`` quit (Read error: No route to host) |
10:54:11 | dom96 | Pro Tip: nim check --os:macosx file.nim # works on all platforms |
10:56:44 | * | BitPuffin joined #nim |
11:03:07 | * | Ven`` joined #nim |
11:06:22 | FromDiscord | <coliny> Howdy all - has anybody managed to get nim integrated with vim such that the documentation/definition of the thing under the cursor is displayed? I have tried just about every nim plugin but they all pale into the blinding glory that is VSCode's integration :-). Any suggestions? I would even consider an emacs plugin 😃 |
11:13:31 | dom96 | coliny: this might be worthy of a forum thread :) |
11:21:06 | FromGitter | <mratsim> Is there an example of M:N threading in Nim? i.e. spawn M threads and let a macro/library dispatch that on the actual N hardware threads available (possibly even one like asyncdispatch). |
11:22:02 | * | FromDiscord <coliny> runs off to start a forum thread :-) |
11:23:04 | FromGitter | <tim-st> can I echo a the result of a const to compiler log output? |
11:25:08 | FromGitter | <tim-st> I got it working using `{.error: constStr.}` |
11:26:30 | * | ieatnerd1 joined #nim |
11:30:39 | * | ieatnerd1 quit (Ping timeout: 244 seconds) |
11:30:54 | FromGitter | <gogolxdong> I made this compiles |
11:31:20 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b55bc884b880b3e6a4222e4] |
11:31:55 | FromGitter | <gogolxdong> but browser crashes. |
11:34:51 | * | leorize joined #nim |
11:37:28 | * | leorize1 joined #nim |
11:39:04 | * | xylef quit (Quit: WeeChat 2.2) |
11:39:30 | * | leorize quit (Ping timeout: 268 seconds) |
11:41:05 | * | leorize2 joined #nim |
11:42:35 | * | leorize1 quit (Ping timeout: 240 seconds) |
11:42:47 | * | xylef joined #nim |
11:45:07 | FromGitter | <kaushalmodi> coliny: See if this helps (Emacs): https://scripter.co/accessing-devdocs-from-emacs/ |
11:46:04 | FromGitter | <mratsim> @gogolxdong the repo is only 4 hours old so I guess that’s expected :P |
11:46:19 | FromGitter | <codem4ster> (offtopic) which is faster in Nim: `func` or `proc`? |
11:46:44 | FromGitter | <mratsim> no difference |
11:46:52 | FromGitter | <mratsim> func = proc {.noSideEffect.} |
11:47:22 | FromGitter | <mratsim> noSideEffect just asks the compiler to make sure that the proc doesn’t use a global variable |
11:47:46 | FromGitter | <mratsim> global variable can mean a global variable, but also reading a file or printing to stdout |
11:48:22 | FromGitter | <mratsim> i.e. the pronc only depends on its inputs (and compile-time constants) |
11:48:25 | FromGitter | <mratsim> proc* |
11:49:28 | FromGitter | <codem4ster> ```code paste, see link``` ⏎ ⏎ so this must not work? [https://gitter.im/nim-lang/Nim?at=5b55c0c7ee530e4aac903f5a] |
11:49:53 | FromGitter | <codem4ster> test is global I think |
11:50:18 | * | TheLemonMan joined #nim |
11:50:54 | TheLemonMan | dom96, thanks for the tip, I've corrected the typo |
11:51:56 | FromGitter | <mratsim> yes test is global. const test = … would work |
11:52:16 | FromGitter | <mratsim> echo doesn’t work either |
11:52:26 | FromGitter | <codem4ster> but that is working already :P |
11:52:46 | FromGitter | <mratsim> are you using devel or stable? |
11:52:52 | FromGitter | <codem4ster> stable |
11:52:55 | FromGitter | <mratsim> try in devel |
11:53:12 | zacharycarter[m] | gogolxdong: lib is still not complete - not everything that works in karax works in zapp yet |
11:53:26 | FromGitter | <codem4ster> oh ok, thanks. |
11:53:43 | zacharycarter[m] | I'm going to post up more examples later today |
11:54:05 | FromGitter | <Varriount> Anyone know if the 'options' module is imported implicitly? |
11:54:26 | FromGitter | <Varriount> I seem to be able to access an "Option" type without importing options. |
11:54:31 | zacharycarter[m] | off to work 😢 |
11:55:23 | FromGitter | <mratsim> @Varriount I get undeclared identifier |
11:57:01 | FromGitter | <Varriount> Ok, this is weird... |
11:57:50 | FromGitter | <Varriount> If I import a module such as nim-regex (https://nitely.github.io/nim-regex/) which uses options, I can use the Option type directly in any module that imports nim-regex. |
11:58:28 | FromGitter | <Varriount> Is that supposed to happen? |
11:59:19 | * | zlib_is_awesome joined #nim |
12:01:55 | zlib_is_awesome | is there a well-documented way to cross-compile program written in nim for arm? |
12:03:03 | FromGitter | <Varriount> zlib_is_awesome: Documented? No. |
12:04:50 | FromGitter | <Varriount> zlib_is_awesome: It's probably the same process that cross-compiling a C/C++ program is. I would pass in the C/C++ compiler flags using the `--passC` and `--passL` arguments to the Nim compiler, then set the architecture via `--cpu` |
12:06:05 | zlib_is_awesome | Varriount: Well, for C code it's problematic too - cross-compiling is a big problem of manual dependency porting/getting |
12:07:28 | FromGitter | <Varriount> zlib_is_awesome: I know it's possible. People have performed (regular) compilation for Nim on the ARM architecture. |
12:08:22 | Calinou | I tried `nimble publish` but got "Error: unhandled exception: Connection was closed before full request has been made [ProtocolError]" |
12:09:08 | FromGitter | <Varriount> Calinou: I believe that happens when the proper github credentials aren't in place. Try looking at the Nimble issue tracker. |
12:09:10 | Calinou | the commit has been done in my fork, I'll just submit the PR manually |
12:09:15 | Calinou | I did set up the token :) |
12:09:20 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:09:31 | dom96 | It's a Nim bug |
12:09:39 | dom96 | Should be fixed in devel |
12:09:58 | Calinou | yeah, I see a few people ran into it too |
12:10:02 | * | Ven`` joined #nim |
12:10:04 | zlib_is_awesome | Sure it's possible to compile nim for arm, it's officially supported architecture. I'm just dreaming about magic nim compile --target "myWeirdAndroidPhoneWithTermux" like it works with go or even better. Sadly there's no such magic anywhere yet |
12:10:15 | Calinou | there https://github.com/nim-lang/packages/pull/805 :) |
12:10:40 | Calinou | zlib_is_awesome: there's this in Rust land, https://github.com/japaric/cross |
12:10:54 | Calinou | but I presume Rust makes it easier to cross-compile things due to how it works |
12:11:25 | FromGitter | <Varriount> zlib_is_awesome: For what it's worth, I've yet to find a language where I can easily cross-compile for another architecture/platform. |
12:11:40 | FromGitter | <Varriount> (Excluding interpreted languages) |
12:12:06 | Calinou | the above Rust crate made it easy for me to build a musl-linked library, but I haven't tested ARM target |
12:12:11 | Calinou | binary* |
12:14:07 | dom96 | zlib_is_awesome: Sounds like a great project for you to work on :) |
12:17:16 | zlib_is_awesome | dom96 unfortunately it's not possible until OS developers will have standardized layer of graphics/sound apis |
12:17:25 | FromGitter | <codem4ster> what is this `Warning: Cannot prove that 'r' is initialized. This will become a compile time error in the future. [ProveInit]` ⏎ I got it from this: ⏎ ⏎ ```var client = new Socket``` [https://gitter.im/nim-lang/Nim?at=5b55c7554b880b3e6a424a25] |
12:17:57 | dom96 | zlib_is_awesome: huh, what does graphics/sound API have to do with cross-compilation? |
12:18:30 | * | nc-x joined #nim |
12:18:54 | zlib_is_awesome | dom96, cross-compilation itself will be more viable and useful when it'll be possible to do easy cross-compilation for games, not just for pure dependency-free code |
12:18:56 | nc-x | @codem4ster It is a bug already reported on github |
12:19:36 | nc-x | https://github.com/nim-lang/Nim/issues/7848 |
12:19:36 | FromGitter | <codem4ster> Is there any work around to get rid of this? |
12:20:01 | nc-x | It still works so you don't need a workaround AFAIK |
12:20:44 | nc-x | Oh nope. https://github.com/nim-lang/Nim/issues/8054 I think it crashes. |
12:20:44 | zlib_is_awesome | so it is possible to make solution for compiling nim to arm using docker, but for now it will only give you same capabilities as using nim-to-js and using node from android side |
12:20:48 | nc-x | * does not compile |
12:20:57 | nc-x | Error: unhandled exception: int(client.fd) <= 0 Client socket needs to be initialised with `new`, not `newSocket`. [AssertionError] |
12:21:43 | nc-x | IIRC when I hit this issue, I had just removed the assert and it was working. |
12:22:00 | FromGitter | <codem4ster> I could compile this. It runs, but I didn't test is it works as expected yet. |
12:23:27 | nc-x | When a client will connect, it will crash with the AssertionError |
12:25:02 | dom96 | https://github.com/nim-lang/Nim/issues/7848 |
12:25:10 | dom96 | It's a known issue |
12:26:01 | FromGitter | <codem4ster> ah, a real showstopper :( |
12:26:16 | dom96 | oh, I think I just realised what the problem is |
12:26:17 | FromGitter | <codem4ster> as it is labelled |
12:26:30 | dom96 | Put the `var client = new Socket` into the while loop |
12:28:01 | dom96 | That sucks for performance though |
12:29:45 | nc-x | dom96: Same warning even after putting it inside while loop |
12:30:09 | * | Ven`` quit (Ping timeout: 260 seconds) |
12:30:13 | dom96 | warning? |
12:30:34 | Calinou | zlib_is_awesome: if you use portable APIs, your code is more portable, simple as that :) |
12:30:38 | dom96 | I'm not fixing the warning, I'm fixing the assertion error. |
12:30:39 | Calinou | i.e. OpenGL ES instead of desktop OpenGL |
12:31:41 | Calinou | unfortunately, the state of OpenGL ES 3.0 support on mobile is pretty bleak |
12:31:53 | Calinou | it's supposed to be present on 2/3 of Android devices, but it works like crap on most Adreno GPUs… |
12:32:44 | nc-x | dom96: Yeah, the assertion is fixed. |
12:34:48 | * | nc-x quit (Quit: Page closed) |
12:36:09 | * | Ven`` joined #nim |
12:39:22 | * | dddddd quit (Ping timeout: 244 seconds) |
12:48:36 | TheLemonMan | are you sure the assertion is correct? new Socket is always going to null the `fd` field |
12:49:11 | TheLemonMan | `client.fd.int != 0` should be checked for instead |
12:52:10 | TheLemonMan | well, s/!=/==/ |
12:52:17 | * | Ven`` quit (Ping timeout: 248 seconds) |
12:54:00 | dom96 | new Socket will set 'fd' to 0 |
12:54:05 | dom96 | That's the default value for an int |
12:54:46 | TheLemonMan | and that's what you want, no? newSocket will set .fd to something != 0 |
12:55:18 | dom96 | Yes, that's why I'm asseting that fd <= 0 |
12:55:20 | dom96 | *asserting |
12:58:28 | TheLemonMan | oh, right, I need my morning coffee |
13:01:41 | zlib_is_awesome | Calinou: unfortunately i know no portable api that doesnt require weird long and boring paperwork to be done with licensing. For example MIT requires to have a copyright notice of each mit-licensed dependency to be copied somewhere to your project |
13:02:10 | zlib_is_awesome | zlib require less, but very few projects use that |
13:03:04 | Calinou | you're talking about libraries here, not APIs :) |
13:04:29 | Calinou | dom96: thanks for merging my PR :) |
13:04:29 | zlib_is_awesome | i thought different libraries provide different access even to same APIs |
13:04:50 | * | Ven`` joined #nim |
13:04:50 | Calinou | I used the term API to refer to technologies like OpenGL here |
13:05:11 | Calinou | you don't have control over how it is implemented, but you can still use it (using libraries) |
13:06:30 | FromGitter | <mratsim> @zlib_is_awesome just follow what was done for Nintendo Switch cross compilation https://github.com/nim-lang/Nim/pull/8069 |
13:07:16 | FromGitter | <mratsim> you can try nimx on android and ios with the —os switch as well: https://github.com/yglukhov/nimx#supported-target-platforms |
13:08:41 | zlib_is_awesome | Calinou: lets say OpenGL. Isn't shader language the only code that is portable between different libraries implementing opengl |
13:10:19 | * | endragor quit (Remote host closed the connection) |
13:11:26 | * | regtools joined #nim |
13:12:50 | FromGitter | <mratsim> libraries implementing OpenGL? Do you mean driver? |
13:14:49 | FromGitter | <mratsim> OpenGL is an abstraction over HW, and should be implemented at the driver level. If OpenGL code does not run on different implementations, that does not mean that OpenGL is not portable, it means that one or more of the library support different version of OpenGL |
13:18:21 | * | zlib_is_awesome quit (Quit: Leaving) |
13:23:10 | * | Ven`` quit (Ping timeout: 256 seconds) |
13:25:20 | * | endragor joined #nim |
13:30:14 | * | endragor quit (Ping timeout: 260 seconds) |
13:33:11 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
13:34:40 | * | Ven`` joined #nim |
13:44:45 | * | xylef quit (Ping timeout: 264 seconds) |
13:59:29 | * | Ven`` quit (Ping timeout: 268 seconds) |
14:03:26 | * | xylef joined #nim |
14:04:32 | * | xylef quit (Client Quit) |
14:05:45 | * | xylef joined #nim |
14:36:31 | FromGitter | <Quelklef> @kayabaNerve What's your new ResultError usecase |
14:40:31 | FromGitter | <kayabaNerve> @Quelklef Just plan external libs |
14:40:51 | FromGitter | <kayabaNerve> Remove the web API part. External anything. |
14:41:27 | FromGitter | <Quelklef> IMO it can even be more general than that |
14:41:29 | FromGitter | <kayabaNerve> I validate hex input and have hard coded arguments. The function stores the results in a pointer and uses error codes. If it breaks, something seriously messed up, but I did screen the inputs and check the arguments. |
14:41:36 | FromGitter | <kayabaNerve> Yeah but previously we said web APIs |
14:41:43 | FromGitter | <Quelklef> Ah |
14:41:44 | FromGitter | <kayabaNerve> So... now it is more general |
14:41:46 | FromGitter | <kayabaNerve> :P |
14:41:54 | FromGitter | <Quelklef> The previous idea I had gotten was "Your request was valid but could not be completed" |
14:41:59 | FromGitter | <kayabaNerve> Feel free to make it even more general. I'll make some comments on the RFC |
14:42:05 | FromGitter | <kayabaNerve> That's this |
14:42:12 | FromGitter | <Quelklef> which IIRC actually is what an error *was* in the beginning until people started fucking with it |
14:42:23 | FromGitter | <Quelklef> With ValueError for instance |
14:42:37 | FromGitter | <kayabaNerve> C libs have an idea where you pass a pointer, it stores data in the pointer, but returns an int |
14:42:47 | FromGitter | <Quelklef> ooh fancy |
14:42:51 | FromGitter | <Quelklef> And by fancy I mean |
14:43:03 | FromGitter | <Quelklef> Sounds like an idiom to solve the problem of an inexpressive language |
14:43:04 | FromGitter | <kayabaNerve> 0 is OK. 5 is invalid arg X. 3 is an invalid arg Y. 1 is a f*** you. |
14:43:06 | FromGitter | <kayabaNerve> Yep |
14:43:21 | FromGitter | <kayabaNerve> So. You validate the request, but get an error code. |
14:43:25 | FromGitter | <kayabaNerve> Bam. ResultError |
14:43:34 | FromGitter | <Quelklef> What's the RFC called? |
14:43:38 | FromGitter | <kayabaNerve> Remove the external service/web API reason just for external library. |
14:43:41 | FromGitter | <Quelklef> or is it in the error rfc |
14:43:42 | FromGitter | <Quelklef> ok |
14:43:44 | FromGitter | <kayabaNerve> That one |
14:43:56 | FromGitter | <kayabaNerve> I did make an RFC though https://github.com/nim-lang/Nim/issues/8408 |
14:44:24 | FromGitter | <Quelklef> WHy can i not find "Remove the external service/web API reason just for external library." |
14:44:56 | FromGitter | <kayabaNerve> ... that was a comment |
14:44:59 | FromGitter | <kayabaNerve> Not the RFC |
14:45:01 | FromGitter | <kayabaNerve> https://github.com/nim-lang/Nim/issues/8363 |
14:45:02 | FromGitter | <Quelklef> fantastic |
14:45:28 | FromGitter | <kayabaNerve> There's the error RFC. The one above mine was just standardizing paths in the compile/header pragmas |
14:50:14 | FromGitter | <kayabaNerve> Actually going to wait to see how this plays out lol |
14:50:40 | FromGitter | <kayabaNerve> Because I think it's too up in the air to suggest an Exception be added yet... |
14:51:00 | FromGitter | <Quelklef> ehhh |
14:51:17 | FromGitter | <kayabaNerve> If you feel otherwise, you do it :P |
14:51:23 | FromGitter | <Quelklef> My one worry is that the rfc seems to be heading away from exception hierarchies |
14:51:30 | FromGitter | <kayabaNerve> It is kinda similar to the suggested UnknownError though |
14:51:32 | FromGitter | <Quelklef> and ResultError very much is designed *for* one |
14:51:50 | FromGitter | <kayabaNerve> It seems to me like we're still heading for hierarchies but with overrides |
14:52:30 | FromGitter | <Quelklef> With the new enum setup? |
14:52:34 | FromGitter | <kayabaNerve> Yeah |
14:52:48 | FromGitter | <kayabaNerve> TBH I think raising anything is just breaking the type system we've setup |
14:52:55 | FromGitter | <Quelklef> "no need to fit errors into hierarchys" |
14:53:02 | FromGitter | <Quelklef> Wym? |
14:53:13 | FromGitter | <kayabaNerve> We've made a big point that things have types |
14:53:32 | FromGitter | <kayabaNerve> We're statically typed; not like JS |
14:53:37 | FromGitter | <Quelklef> Things will still have types tho |
14:53:37 | FromGitter | <Quelklef> ? |
14:53:48 | FromGitter | <kayabaNerve> By allowing raising anything, the return value becomes untyped |
14:53:55 | FromGitter | <Quelklef> no |
14:54:01 | FromGitter | <kayabaNerve> How not lol |
14:54:15 | FromGitter | <Quelklef> It becomes `Option[T, Error]` conceptually |
14:54:23 | FromGitter | <kayabaNerve> If I can raise a bool, string, int, custom object, Exception, or ref object of IOError |
14:54:39 | FromGitter | <Quelklef> Is that part of the RFC? |
14:54:42 | FromGitter | <Quelklef> Being able to raise anything? |
14:54:48 | FromGitter | <Quelklef> I've only seen the enums |
14:54:51 | FromGitter | <kayabaNerve> Only if we allow raising anything as a language but not as a function |
14:55:02 | FromGitter | <Quelklef> come again mate |
14:55:06 | FromGitter | <kayabaNerve> It's in there a few times with no expansion |
14:55:32 | FromGitter | <Quelklef> I mean as long as you never use it as a *value* it doesn't matter |
14:55:37 | FromGitter | <kayabaNerve> "Why don't you instead make it possible to raise stack-allocated objects (as well as heap-allocated objects)?" |
14:55:46 | FromGitter | <Quelklef> hm |
14:55:49 | FromGitter | <kayabaNerve> "Exceptions are currently ref types, and there is no mechanism to raise stack or fixed size objects" |
14:56:05 | FromGitter | <Quelklef> That may just mean raising an `object of Exception` |
14:56:18 | FromGitter | <kayabaNerve> "but let's go a step further and just implement what I proposed above: the ability to raise all stack-allocated objects. Even objects that aren't variants." |
14:56:25 | FromGitter | <Quelklef> yoooo |
14:56:59 | FromGitter | <kayabaNerve> That's from dom. This is meaning int, string, object, or Exception, right? |
14:57:12 | FromGitter | <kayabaNerve> I don't think I'm misreading it tbh |
14:57:38 | FromGitter | <kayabaNerve> Or maybe not int/string but any `object` as in `ref object of RootObj` or so on |
14:57:46 | dom96 | Can't wait for the latest TechEmpower run to finish: https://tfb-status.techempower.com/ |
14:57:55 | FromGitter | <kayabaNerve> dom96 perfect timing |
14:58:06 | dom96 | Jester/HttpBeast numbers are already there and they are looking really good |
14:58:06 | FromGitter | <Quelklef> I don't think ints & co. are objects in Nim |
14:58:08 | FromGitter | <Quelklef> I could be wrong |
14:58:11 | FromGitter | <kayabaNerve> When you referred to all stack based options in the Errors rfc going around |
14:58:17 | FromGitter | <kayabaNerve> *objects |
14:58:52 | FromGitter | <kayabaNerve> Did you mean: ⏎ int, string, object, Exception, ref object of IOError ⏎ object as in ref object of RootObj ⏎ ref object of Exception [https://gitter.im/nim-lang/Nim?at=5b55ed2cc579673e6b8c2663] |
14:58:57 | FromGitter | <kayabaNerve> The second, right? |
15:00:07 | dom96 | Is that 3 choices? |
15:00:07 | FromGitter | <kayabaNerve> Wouldn't that create an untyped system for Exceptions? @Quelklef referred to Option[T, Error] but you must define T when you do it. It sounds like for this, I could: ⏎ proc a() = ⏎ ⏎ ```if myBool: ⏎ raise obj1 ⏎ raise obj2``` [https://gitter.im/nim-lang/Nim?at=5b55ed77f10ffa0b48a7d428] |
15:00:11 | dom96 | I meant `object` |
15:00:39 | dom96 | As in a non-ref `object` type |
15:00:46 | FromGitter | <kayabaNerve> Got it |
15:00:51 | FromGitter | <Quelklef> With arbitrary fields? |
15:01:00 | dom96 | sure |
15:01:01 | FromGitter | <kayabaNerve> So then I could raise two completely separate objects? Would I have to define all possible ones in the header or have a common inheritor? |
15:01:09 | FromGitter | <kayabaNerve> Besides object itself |
15:01:17 | dom96 | There would be no inheritance in this proposal |
15:01:18 | FromGitter | <Quelklef> Hm, that could be abused, but then lots of things can in any plang |
15:01:27 | FromGitter | <kayabaNerve> Because it sounds like you're suggesting untyping Exceptions |
15:01:29 | dom96 | In any case, this isn't happening for 1.0 anyway |
15:01:48 | dom96 | how so? |
15:01:55 | FromGitter | <kayabaNerve> There's a reason I declare an Animal object and a Plant object... If I use one, it's completely different from the other. |
15:02:15 | dom96 | There would probably be a constraint that only objects with a 'msg' field can be raised |
15:02:19 | dom96 | but that's a simple concept |
15:02:36 | FromGitter | <kayabaNerve> But why not just keep the types/a common inheritor lol |
15:02:47 | dom96 | That's what I want |
15:02:50 | FromGitter | <kayabaNerve> For example. A Error type with the msg field predeclared |
15:02:56 | dom96 | The RFC proposes getting rid of inheritance |
15:03:03 | dom96 | and the current system of exception and replacing it with enums |
15:03:29 | FromGitter | <kayabaNerve> Yeah |
15:03:31 | FromGitter | <Quelklef> @kayabaNerve This kind of abuse can already be done with the current system anyway |
15:03:55 | FromGitter | <kayabaNerve> @Quelklef Yes but the Exception common ancestor/inheritor/whatever guarantees some consistency. |
15:04:09 | FromGitter | <Quelklef> Don't agree |
15:04:17 | FromGitter | <Quelklef> Doesn't Exception just have the msg field |
15:05:52 | FromGitter | <kayabaNerve> He's suggesting requiring all objects raised have the message field |
15:06:03 | FromGitter | <kayabaNerve> This sounds like the current system lol |
15:06:10 | FromGitter | <kayabaNerve> But we removed types for field sharing |
15:06:14 | FromGitter | <Quelklef> Well my point being the only consistency you have is that the raised object has `msg` |
15:06:22 | FromGitter | <kayabaNerve> That's what the suggestion is |
15:06:30 | FromGitter | <kayabaNerve> Except we get rid of the Exception type when we do it |
15:06:33 | FromGitter | <Quelklef> Especially if Nim supports multiple inheritance (dunno if it does), that's a fairly weak guarnatee |
15:06:37 | FromGitter | <kayabaNerve> Even though we still require the field |
15:06:47 | FromGitter | <Quelklef> No I'm replying to "Yes but the Exception common ancestor/inheritor/whatever guarantees some consistency." |
15:07:03 | FromGitter | <kayabaNerve> It guarantees as much as the suggestion |
15:07:22 | FromGitter | <kayabaNerve> Except now we use object over Exception, and check the names of fields to verify it's at least usable as an Exception |
15:08:49 | * | arecacea1 quit (Remote host closed the connection) |
15:09:00 | FromGitter | <kayabaNerve> I could be misunderstanding this and I do believe dom96 is the better Nim dev. This just sounds like the current system with no inheritance for... some reason? But then requiring the new object at least have a msg field which is why objects must inherit from the Exception object in the first place (and that is properly typed) |
15:09:14 | * | arecacea1 joined #nim |
15:09:47 | FromGitter | <kayabaNerve> So it sounds like removing types to remove inheritance just to reintroduce the reason we had the Exception type but this time do it in a more complex way, akin to JS or something |
15:09:49 | dom96 | The whole point of this whole thing is to avoid heap allocation |
15:09:53 | dom96 | For performance reasons |
15:10:43 | FromGitter | <kayabaNerve> How much performance would an object with a msg field and custom fields over an object with custom fields inherited from an object with a msg field save? I actually do not know. |
15:10:50 | FromGitter | <kayabaNerve> Kinda asking here |
15:12:18 | FromGitter | <Quelklef> I mean, given that that's the RFC, it must be significant |
15:14:02 | FromGitter | <kayabaNerve> "As far as I'm concerned this diminishes exceptions in Nim greatly by removing their ability to be extended. Like I've said in the forum: I use exceptions very heavily and love them dearly. Please do not diminish them." ⏎ ⏎ "The rationale for this change seems to be embedded systems, but how many of Nim's users are actually targeting embedded systems? How many of those users are limited by Nim's exceptions? I |
15:14:02 | FromGitter | ... have never heard anyone complain about Nim's exceptions so to me this seems like an almost theoretical problem with a solution that is very disruptive." ⏎ ⏎ Also dom96. [https://gitter.im/nim-lang/Nim?at=5b55f0ba9ddf5f4aad0284ad] |
15:14:21 | FromGitter | <kayabaNerve> That's a single quote... |
15:14:36 | FromGitter | <kayabaNerve> Of course, this was made very early on |
15:14:38 | dom96 | Yeah, I'm deeply skeptical about the benefits that this overhaul brings |
15:14:51 | FromGitter | <kayabaNerve> I don't know enough |
15:15:02 | FromGitter | <kayabaNerve> I do know I do some embedded systems work but can't even run the GV |
15:15:05 | FromGitter | <kayabaNerve> *GC |
15:15:13 | * | Trustable joined #nim |
15:15:15 | FromGitter | <kayabaNerve> So I'm so embedded I don't really care |
15:15:23 | FromGitter | <kayabaNerve> I've just accepted my fate |
15:16:43 | FromGitter | <kayabaNerve> "You're not a real embedded sys dev if you haven't tried to make your env better, and given up after a week of work after realizing it's impossible and crying for an hour." -- Some C asshole |
15:17:53 | FromGitter | <andreaferretti> @kayabaNerve in my proposal you could raise anything, but only catch things of a single type in a `try` block |
15:17:55 | FromGitter | <andreaferretti> that is |
15:18:00 | FromGitter | <andreaferretti> `try` becomes tyepd |
15:18:13 | FromGitter | <andreaferretti> in a way, it would be more typed than before |
15:18:30 | * | ftsf quit (Ping timeout: 244 seconds) |
15:18:41 | FromGitter | <andreaferretti> you could not catch just anything, only things that have been declared in a single variant type |
15:18:48 | * | dashed quit (Ping timeout: 256 seconds) |
15:19:21 | * | surma quit (Ping timeout: 256 seconds) |
15:19:22 | * | r4vi quit (Ping timeout: 256 seconds) |
15:19:24 | FromGitter | <kayabaNerve> Isn't except typed though? |
15:19:55 | * | crem quit (Ping timeout: 256 seconds) |
15:20:48 | FromGitter | <Varriount> For me, the biggest advantage to this would be faster exceptions. |
15:21:19 | FromGitter | <Varriount> setjmp/longjmp can be very slow (especially for glibc) |
15:21:29 | * | surma joined #nim |
15:21:29 | * | r4vi joined #nim |
15:21:47 | * | crem joined #nim |
15:21:56 | * | dashed joined #nim |
15:26:23 | FromGitter | <Varriount> Though, I wonder why exceptions can't use `goto` |
15:29:55 | * | icebattle joined #nim |
15:35:42 | * | yglukhov_ quit (Remote host closed the connection) |
15:36:26 | * | yglukhov[i] joined #nim |
15:37:06 | FromGitter | <kayabaNerve> I like performance; I use exceptions; personally, I'm fine with just compiling to C++ if I need it as long as the language doesn't get quirky/worse behavior. |
15:37:49 | FromGitter | <kayabaNerve> I understand this isn't me versus everyone and how we should target performance. I just believe in either our current system or modular enums. |
15:38:10 | FromGitter | <kayabaNerve> *or something I can use the same as our current system without sacrificing language integrity |
15:40:52 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
15:41:50 | * | yglukhov[i] joined #nim |
15:43:57 | FromGitter | <andreaferretti> @kayabaNerve yeah, what I mean is that the whole `try .. except` construct becomes typed over the exception type that you are guarding |
15:44:46 | FromGitter | <Varriount> @andreaferretti The compiler could create a variant exception type behind the scenes. |
15:44:47 | FromGitter | <andreaferretti> you would not be allowed (under my proposal) to do ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b55f7ef32fa1b74085ea9d0] |
15:44:59 | FromGitter | <andreaferretti> @Varriount sure, it could |
15:45:13 | FromGitter | <andreaferretti> it would be more convenient |
15:45:22 | FromGitter | <andreaferretti> but you would end up with a lot of generated types |
15:45:52 | FromGitter | <andreaferretti> I also kind of like the limitation on variant types |
15:46:05 | FromGitter | <andreaferretti> it would force library authors to declare their own exceptions upfront |
15:46:20 | FromGitter | <andreaferretti> and catch foreign exception to rethrow as their own type |
15:46:43 | FromGitter | <andreaferretti> maybe a little complicated, but it would bring some order |
15:48:01 | FromGitter | <andreaferretti> anyway, it's just a proposal, I have no string preference here |
15:48:15 | FromGitter | <andreaferretti> as long as one is not tied a fixed enum as in the first proposal |
15:52:56 | FromGitter | <Varriount> Yeah, but then you might get 50 different variants of errors thrown from the standard library. |
15:55:10 | FromGitter | <Varriount> If various libraries are made that create variants of standard library exceptions, and then an application writer wants to create generic procedures that handle those exceptions, things could get messy. |
16:23:03 | * | krux02 joined #nim |
16:25:11 | FromDiscord | <emekoi> is it possible to create a `seq` that uses shared memory? |
16:27:14 | * | NamPNQ quit (Remote host closed the connection) |
16:27:17 | * | dorelix quit (Ping timeout: 276 seconds) |
16:46:24 | FromGitter | <krux02> emokoi: I don't think so. |
16:46:34 | FromGitter | <krux02> maybe |
16:46:37 | FromGitter | <krux02> soon |
16:46:44 | FromGitter | <Varriount> emokoi: What's your use-case? |
16:48:18 | FromGitter | <krux02> emokoi: I think Araq currently works on a seq that as an allocator bound to it, so that when you expand it, the seq knows that it has to allocate further memory from shared memory. |
16:48:18 | * | dorelix joined #nim |
16:48:59 | FromGitter | <Varriount> There is a shared list module, however it is rather bare-bones, and has difference performance characteristics than a sequence. |
16:51:26 | FromGitter | <krux02> @Varriount what list? |
16:51:34 | FromGitter | <krux02> I am worried that it might be a linked list. |
16:51:43 | FromGitter | <Varriount> http://github.com/nim-lang/Nim/blob/master/lib/pure/collections/sharedlist.nim |
16:52:02 | FromGitter | <Varriount> Yes, it's a linked list, for concurrency reasons. |
16:52:14 | FromGitter | <krux02> ouch, I just by looking at it, I can only scream, don't use it. |
16:52:46 | FromGitter | <Varriount> Why? |
16:54:02 | FromGitter | <krux02> it feels a lot like some early experiments with Nim that just did not catch up. |
16:54:20 | FromGitter | <krux02> not conventional names like iterAndMutate |
16:55:09 | FromGitter | <krux02> head, tail name usage that is just semantically wrong. |
16:55:22 | FromGitter | <krux02> head is normally the first element of the list and teal the list without the first element |
16:55:27 | FromGitter | <krux02> but here tail is just tha last element. |
16:55:45 | FromGitter | <krux02> for anybody who ever did functional programming, that is just wrong |
16:57:33 | * | leorize2 is now known as leorize |
16:58:19 | * | craigger_ quit (Quit: bye) |
16:58:37 | * | craigger joined #nim |
17:00:26 | * | leorize1 joined #nim |
17:01:59 | * | leorize quit (Ping timeout: 260 seconds) |
17:04:46 | * | leorize joined #nim |
17:04:58 | * | leorize1 quit (Ping timeout: 260 seconds) |
17:06:49 | FromGitter | <kaushalmodi> > but here tail is just tha last element. ⏎ ⏎ Oh yeah, that is wrong. Even from the perspective of lisp users |
17:11:38 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
17:12:13 | * | yglukhov[i] joined #nim |
17:12:35 | FromGitter | <mratsim> Posix tail is the last line ;) |
17:12:54 | * | yglukhov[i] quit (Remote host closed the connection) |
17:13:59 | FromGitter | <mratsim> @emokoi, you can always pass a pointer to the first elem of the seq. A seq is in the heap which can be accessed by all proc through pointers |
17:22:27 | * | arecacea1 quit (Remote host closed the connection) |
17:22:51 | * | arecacea1 joined #nim |
17:26:11 | * | yglukhov[i] joined #nim |
17:32:59 | * | thomasross quit (Remote host closed the connection) |
17:33:27 | * | thomasross joined #nim |
17:46:26 | Yardanico | ok, I've mentored all solutions for Nim on exercism which were requiring mentor feedback :) |
18:12:15 | dom96 | awesome |
18:12:25 | dom96 | Was there many? |
18:14:12 | Araq | krux02: the GC uses sharedlist iirc |
18:14:32 | Araq | I agree the API design is well ... suboptimal but I wrote it quickly for the GC. |
18:15:05 | dom96 | Yardanico: Passed last year's response rate on the survey. Now at 636. |
18:15:21 | dom96 | I should really close it now but since I advertised it late on nim-lang.org I'll leave it open for a while longer |
18:16:32 | krux02 | Araq: I still won't recommend it for the standard library. |
18:17:29 | * | Araq shrugs. |
18:24:54 | Araq | can't be that hard to clean up the API names |
18:40:36 | * | icebattle quit (Quit: leaving) |
18:41:26 | * | icebattle joined #nim |
18:41:59 | * | Ven`` joined #nim |
18:48:51 | FromGitter | <Varriount> Yardanico: How many were there? |
18:50:57 | FromGitter | <rayman22201> @dom96 I'm super excited to see the survey results. I will be patient though :-) |
18:57:55 | * | arecacea1 quit (Remote host closed the connection) |
18:58:20 | * | arecacea1 joined #nim |
18:58:57 | * | yglukhov_ joined #nim |
18:58:58 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
19:00:12 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:00:58 | FromGitter | <tim-st> @kayabaNerve how did you generate the error here? |
19:01:02 | FromGitter | <tim-st> https://github.com/nim-lang/Nim/issues/8407 |
19:01:35 | FromGitter | <tim-st> did you use `{.compile: "a.c".}`? |
19:05:46 | * | UxerUospr joined #nim |
19:15:57 | * | donotturnoff joined #nim |
19:21:28 | stefanos82 | Araq: I have tried an example based on kayabaNerve's issue and produced the following problem: https://pastebin.com/uCReWMLn |
19:22:53 | stefanos82 | basically I took the following example https://nim-lang.org/docs/backends.html#nim-code-calling-the-backend-c-invocation-example and instead of calling it logic.c, I renamed it to calculator.c and placed it under the same directory as calculator.nim |
19:23:18 | stefanos82 | and changed the {.compile.} line accordingly |
19:24:59 | Araq | yeah, so fix it. not sure how though. |
19:26:12 | stefanos82 | the question is: does nim compiler converts calculator.nim to c in the background using the same name as nim's file? |
19:28:33 | FromGitter | <kayabaNerve> @tim-st Yeah. They weren't in the same directory though. |
19:28:37 | FromGitter | <kayabaNerve> And they had different casing |
19:28:44 | * | dddddd joined #nim |
19:29:12 | FromGitter | <kayabaNerve> That was the part that really pissed me off lol. ~/lib/src/argon2.c and ~/Argon2.nim |
19:30:20 | FromGitter | <kayabaNerve> Where does the Nim compiler throw an error if two Nim files have the same name? I'd just throw that same error, tbh. Of course, I'm not a Nim dev for a reason, not my expertise... |
19:32:05 | Araq | stefanos82: yes, it does. unless it's in a nimble package then the name becomes package_module.c |
19:32:38 | Araq | but you know what? I don't care, hash the full path and make it module_$HASH.c |
19:32:44 | FromGitter | <tim-st> @kayabaNerve ok, that's exactly what I predicted a few days ago, is one case [of several] that will fail on the "all sources in one nimcache folder" concept |
19:35:14 | FromGitter | <tim-st> rebuilding the folder structure implicit or explicit is the only way to solve this |
19:35:36 | FromGitter | <tim-st> (inside the cache folder) |
19:36:15 | stefanos82 | Araq: when you say hash the full path? can you provide an example please? |
19:36:25 | Araq | that's not true, no matter how often you repeat it. |
19:36:35 | Araq | @tim-st |
19:37:08 | FromGitter | <tim-st> ^^ well the first issue comes quicklier than what was assumed |
19:37:20 | Araq | no, it's an old issue. |
19:42:25 | * | nsf quit (Quit: WeeChat 2.1) |
19:43:24 | FromGitter | <kayabaNerve> stefanos82: output = file.name & SHA256(file.path) |
19:43:48 | FromGitter | <kayabaNerve> That'd break binary verification if we use the full path though, right? |
19:43:48 | stefanos82 | and where to place this output kayabaNerve? |
19:44:18 | FromGitter | <kayabaNerve> I'm just saying what it means to hash a path and rename the module :P Not where to put it. Output was meant to be the .o file. I have no clue. |
19:45:00 | FromGitter | <kayabaNerve> If we hash /home/user/Kayaba/project/file.nim to create file_HASH.o, wouldn't that be included in the binary meaning the only way to verify my build is to have my exact same full path Araq? |
19:45:13 | * | Trustable quit (Remote host closed the connection) |
19:45:15 | FromGitter | <kayabaNerve> It should be the path relative to the calling of the Nim compiler. |
19:45:34 | FromGitter | <kayabaNerve> *right? |
19:46:01 | stefanos82 | I wonder why difficult it is to produce .c files for each .nim post-fixed with -nim.c or even better, foo.nim.c |
19:46:05 | FromGitter | <tim-st> btw what I wanted to ask: it it ok to use `{.compile: "folder/file.c".}` regarding the seperator `/` ? |
19:46:10 | FromGitter | <bluenote10> Hello everyone! Maybe I'm too tired, but didn't `1 == 1.0`produce a warning in the past? |
19:46:11 | FromGitter | <tim-st> on windows it works |
19:47:58 | FromGitter | <krux02> @bluenote10 it is not a warning, because it is lossless conversion. |
19:50:04 | FromGitter | <bluenote10> @krux02 I see and it only works with pure literals, I'm reliefed ;) |
19:50:19 | krux02 | yes |
19:54:31 | FromGitter | <mratsim> @stefanos82 @kayabaNerve @araq, I’m curious about your .c .nim file conflict: I’ve been using this repo without any issues for months: https://github.com/define-private-public/stb_image-Nim/tree/master/stb_image |
19:57:11 | stefanos82 | mrtasim: Araq answered above about this; your example works because you are using it via nimble which produces package_module.c |
19:58:16 | FromGitter | <mratsim> ah! |
19:58:42 | FromGitter | <mratsim> so adding a .nimble file to the project solves everything |
19:58:55 | FromGitter | <mratsim> \o/ |
20:01:37 | stefanos82 | if I knew where to check for the file checking before the C generating code...all I would ask it would be something like "if c file has the same name as nim file, then add a -nim.c as Nim file's suffix" |
20:02:09 | * | yglukhov_ quit (Ping timeout: 244 seconds) |
20:06:54 | krux02 | dom96: are you online? |
20:08:52 | FromGitter | <Yardanico> @dom96 maybe you can mention in nim_lang's twitter that Nim track is live at exercism.io? |
20:09:34 | * | yglukhov[i] joined #nim |
20:11:01 | krux02 | Araq: I would like to have your opinion on this PR that I made https://github.com/nim-lang/Nim/pull/8369/files |
20:11:16 | dom96 | krux02: Yes. Don't ask to ask. |
20:11:17 | * | Jesin quit (Quit: Leaving) |
20:11:27 | * | donotturnoff quit (Ping timeout: 240 seconds) |
20:11:46 | dom96 | yardanico: waiting for them to fix the icon :P |
20:11:55 | krux02 | dom96: that PR I just linked. I made the changes you asked for. |
20:11:58 | FromGitter | <Yardanico> they don't know what icon is broken :) |
20:12:01 | FromGitter | <Yardanico> *that |
20:12:03 | * | Ven`` joined #nim |
20:13:19 | dom96 | Yardanico: what? |
20:14:08 | FromGitter | <Yardanico> I think they don't know that Nim icon is broken |
20:15:24 | krux02 | dom96: Also I would also really like to remove all the functional programming stuff away from the options module. I think it does not belong in there. With fucntional programming I mean map and flatMap and flatten |
20:15:47 | * | xylef quit (Quit: WeeChat 2.2) |
20:16:40 | * | Jesin joined #nim |
20:16:56 | Araq | krux02: can't we make 'get' a template instead? then you can do f.get(otherwise) for 'f or otherwise' |
20:17:07 | krux02 | I would like to have minimal definition of the types with a minimal set of functions that allow to access them generically, and then one modle for fuctional programming that allows to use functional programming paradigms |
20:17:59 | dom96 | Also, yeah, what Araq said |
20:18:26 | dom96 | `or` for two Option[T]'s is still nice though |
20:18:56 | dom96 | I commented on the PR too |
20:19:05 | dom96 | Please, everyone, write short and sweet examples |
20:19:18 | dom96 | Nobody is going to read a novel when they just want to get shit done (TM). |
20:20:07 | stefanos82 | lol dom96 you are an OCD I presume? I know this perfectionist's characteristic...I wonder who that might be...hmmm |
20:20:41 | Araq | does that imply you finally agree with me on '@param foo the foo' being bad? |
20:20:50 | krux02 | dom96: don't try too be too harsh about the documentation. Yea it is probably not the best, but I wanted at least an example and I did that. |
20:22:03 | krux02 | Araq: get should be a template as well. I think there is nothing from holding it back. |
20:22:46 | dom96 | stefanos82: I like to think of it rather that I have an eye for detail ;) |
20:23:13 | krux02 | Araq: I would really like to get all the functional programming shinanegance and put it all in a fucntional programming modlue where it belongs. |
20:23:25 | dom96 | I'm not going to lose nights of sleep if docs aren't perfect |
20:23:33 | Araq | does it though? |
20:23:36 | dom96 | but it's time we strive to push for them to be better |
20:23:36 | stefanos82 | dom96: don't worry mate, I know *exactly* what you mean. I'm OCD since, let's see...as long as I remember? LOL! |
20:23:37 | krux02 | I don't want everything cluttered with functional programming stuff, when I am not going to use it. |
20:23:52 | Araq | do we also have an "oo.nim" module where all the OO stuff ends up? |
20:24:04 | krux02 | I get it, people want to do functional programming. but pleas don't clutter the standard library with all that stuff. |
20:24:25 | Araq | who are you and what did you to krux02? |
20:24:30 | krux02 | you can put in in a nice "funcpro" or something package and everybody is happy. |
20:24:47 | Araq | we already fp nimble packages. |
20:25:38 | Araq | as much as I sympathesize with your position |
20:25:40 | krux02 | I am still the same person. I still like functional programming as a paradigm. But I see that the standard library can be much more minimal without all the functional programming functions cluttered everywhere. |
20:26:01 | Araq | I'm not sure it's really the way to go. |
20:26:17 | krux02 | It is also much easier to make functional programming in nim consistent when all the functions are gathered in a single package. |
20:26:53 | Araq | does Haskell have a single module then, what does that even mean |
20:27:10 | krux02 | well haskell has no alternative to functional programming |
20:27:15 | dom96 | I see Araq is getting picky about whitespace after commas too :D |
20:27:24 | krux02 | so haskell hat operators for flatmap |
20:27:36 | krux02 | and fold |
20:27:38 | FromDiscord | <awr> @Araq can you rephrase what you mean by this? https://github.com/nim-lang/Nim/issues/8405#issuecomment-407184321 |
20:27:39 | krux02 | (I think) |
20:28:04 | dom96 | krux02: I'm afraid I can't agree either |
20:28:12 | FromDiscord | <awr> i don't understand what you mean by "assuming the current version is fine for compiletime evaluation" |
20:28:15 | dom96 | Nim needs its own functional programming flavour |
20:28:28 | Araq | FP is a paradigm, I don't see how we can restrict a paradigm to "one module only" |
20:28:53 | Araq | on the other hand, 'flatMap' shouldn't be in options.nim |
20:29:41 | Araq | awr you link against nimrtl.dll, right? |
20:29:45 | krux02 | Araq: haskell works much more with concepts, so the Option type is like any sequence with 0 or 1 element. |
20:30:05 | FromDiscord | <awr> yes |
20:31:11 | Araq | so you don't know which version of strutils.replace you will get. |
20:31:20 | krux02 | so when Option just has an index operator and and a len field, a functional programming module could provide a generic map flatMap and all the other stuff, without taking care if it is an opiton an array a seq or something like that. |
20:31:27 | Araq | how can you then run it at compile-time? |
20:31:36 | Araq | I'm probably overthinking this though. |
20:33:52 | krux02 | it is very important to think about the true core features that every container needs to provide in order to have functional programming on them enabled. |
20:34:06 | krux02 | so maybe [] and len isn't the right choice. |
20:34:30 | krux02 | maybe `items` and `add` is the better option. |
20:34:51 | FromDiscord | <awr> what if there was a const-safe variation of the `{.rtl.}` pragma without `{.dynlib.}` on it at compile time? presumably under a `when nimvm` block |
20:35:09 | krux02 | `add` surely isn't "pure fucntional" but it is surely a nice generic way to implement `map` |
20:35:53 | Araq | 'items' and 'add' is MUCH better for packedjson |
20:36:30 | krux02 | yea but not that good for `array` but that one can be overloaded. |
20:37:23 | FromGitter | <kayabaNerve> We had a Nimble file; it messed everything up @mratsim |
20:38:04 | FromGitter | <kayabaNerve> Other things; not this. Not broke things, just messed things up. |
20:38:29 | * | Ven` joined #nim |
20:38:35 | FromGitter | <kayabaNerve> Had to completely redo the project structure, lot of bloat, wouldn't allow dependency installing without module installing, wasn't suitable for tests... |
20:40:24 | dom96 | huh |
20:40:28 | dom96 | Elaborate |
20:40:38 | * | Ven`` quit (Ping timeout: 256 seconds) |
20:44:15 | FromGitter | <kayabaNerve> 1) I wanted a .nimble for the dependency installation. AFAICT, you can only install a module's dependencies by installing the module. This is not a module to be instaled. ⏎ 2) It was added by someone else for the testing architecture which was ditched because it wasn't suitable for the tests I did. ⏎ 3) The Entire src directory had to be wrapped in another directory to get rid of critical warnings/future errors. |
20:44:15 | FromGitter | ... It was a major PITA. ⏎ We had no benefit on the avenue I wanted to use it for, and no benefit or the avenue it was added for. It completely changed the project structure and added bloat. [https://gitter.im/nim-lang/Nim?at=5b563e1f32fa1b74085f936e] |
20:44:44 | FromGitter | <kayabaNerve> And we could've used develop but it'd still get a symlink... |
20:48:20 | dom96 | What project was this for? |
20:49:44 | krux02 | Araq: I made a little example how a generic functional programming module could look like: http://ix.io/1icY |
20:49:59 | krux02 | it is completely untested |
20:50:14 | krux02 | and it requires a concept Container that I just skipped writing |
20:50:19 | krux02 | but that is the idea |
20:50:35 | * | Ven` quit (Ping timeout: 240 seconds) |
20:51:11 | krux02 | if the Concept is implemented correctly, these functions would work on every type. |
20:53:16 | FromDiscord | <awr> haha i think it works |
20:53:22 | Araq | yes ok, but that's fold and map |
20:53:38 | Araq | and 'sum' should arguably in math.nim instead (I think it already is) |
20:54:49 | Araq | fold and map are important, but hardly the only thing FP offers. what about a 'curry' macro? |
20:54:58 | Araq | would that be in fp.nim too? |
20:55:05 | FromDiscord | <awr> ugh lol i accidentally tried to open a DLL in my photo editing app instead of my DLL inspection tool |
20:58:47 | krux02 | Araq: I think a curry marco is perfectly fine in an fp.nim |
20:59:24 | krux02 | I am just not sure how yo would want a curry macro. I have seen a curry macro that makes functions "curry-able". |
20:59:52 | krux02 | but I think far more asable would be a curry macro that curries an arbitrary function. |
21:00:05 | FromDiscord | <awr> damnit the new pragma doesn't work. it just removes the export entirely when i do that |
21:00:41 | krux02 | haskell does currying by requiring the fucntion definition to be written in a way that is curryable |
21:01:04 | krux02 | int -> int -> int |
21:01:25 | krux02 | it is a function that takes an int and returns a function that takes and int and returns an int |
21:01:34 | krux02 | int -> (int -> int) |
21:01:52 | krux02 | but that is also the common way I've seen to write a function with two arguments |
21:02:26 | Araq | my Haskell knowledge is good enough to know that one |
21:02:57 | Araq | the 'curry' macro is some slides of mine |
21:03:14 | Araq | I forgot how it works, I don't use currying. |
21:03:31 | Araq | currying is for the people who lack 'mapIt' |
21:04:20 | Araq | as I said, once you have 'it', you have general expressions, not tied to first class functions and so you don't need currying |
21:05:38 | * | donotturnoff joined #nim |
21:06:11 | * | UxerUospr quit (Quit: Lost terminal) |
21:10:35 | krux02 | I don't really like functions as parameters when it is avoidable, because they are a very slow function call. |
21:10:53 | krux02 | the compiler can't inline |
21:11:18 | krux02 | and the logic in such functional programming expressions is always very small where inlining would really benefit. |
21:20:24 | * | Vladar quit (Quit: Leaving) |
21:21:05 | * | donotturnoff quit (Ping timeout: 240 seconds) |
21:23:57 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
21:24:14 | FromGitter | <mratsim> Yeah remove flatMap from Options and introduce a Monad Concept :trollface: |
21:24:31 | * | yglukhov[i] joined #nim |
21:25:41 | FromGitter | <mratsim> regarding function as parameter, I think having first class inline iterator chaining would go a long way. |
21:26:28 | FromGitter | <mratsim> most of the time you pass a function as parameter either for comparison, or to process elements in a container for which iterators are probably better |
21:27:51 | FromGitter | <Quelklef> Is there any sugar for `var x: X; x[] = y`? Since constructors for `ref object` types are still object constructors (I think)? |
21:29:06 | FromGitter | <Quelklef> Yeah, `var x: X = ... ; let y: X = X(x[])` doesn't work. |
21:29:08 | FromGitter | <mratsim> let x = X(field0: y) |
21:29:30 | FromGitter | <mratsim> well somewhat like that because what you’re doing is not really safe |
21:29:35 | FromGitter | <Quelklef> Really? |
21:30:08 | stefanos82 | dom96: can we extend the survey until the end of the month? I didn't know there was a survey running on the main website |
21:30:57 | FromGitter | <Quelklef> My specific use-case is that `w` and `z` are NimNodes. I want `w` to be a copy of `z`, but with a few fields changed |
21:31:01 | FromGitter | <mratsim> var x: X is nil pointer @Quelklef , you should then use new. |
21:31:03 | krux02 | I just put in more funcpro stuff http://ix.io/1id7 yay |
21:31:17 | FromGitter | <mratsim> and only then you can dereference |
21:31:31 | FromGitter | <Quelklef> Ah, thank you |
21:31:36 | stefanos82 | krux02: do you know whether is possible or not to overload backticks? |
21:31:46 | FromGitter | <Quelklef> Is there an existing idiom for this use-case, do you know? |
21:31:50 | FromGitter | <Quelklef> But thank you, I'll just make a proc |
21:32:18 | krux02 | stefanos82, honestly I don't know if you can overload them. I think you can't |
21:32:25 | stefanos82 | darn it :/ |
21:32:34 | krux02 | how do you want to use them? |
21:32:39 | FromGitter | <mratsim> there is copyChildrenTo, copyNimNode and at least one other copy functions @Quelklef, I was also lost into how to do it properly |
21:32:53 | krux02 | I gave them a meaning in ast-pattern-matching, but I did that with a macro. |
21:32:59 | FromGitter | <Quelklef> alright, I'll look in macros. ty! |
21:33:07 | stefanos82 | krux02: I really don't like using triple quotes so I can use double quotes in a certain line nor I like escaping double quotes |
21:33:14 | FromGitter | <mratsim> ah, copyNimTree |
21:33:30 | stefanos82 | compare echo """hello "world"!""" with echo `hello "world"!` |
21:33:30 | FromGitter | <mratsim> I think copyNimNode == copyNimTree nowadays |
21:33:41 | krux02 | well you can't overload backticks with macros, it is just that you cant the ast in a macro including the backticks and there you can put any meaning into backticks you want. |
21:33:49 | krux02 | but that is not overloading at all. |
21:33:58 | FromGitter | <Quelklef> Perhaps one is shallow? |
21:34:15 | FromGitter | <mratsim> the simple `=` is shallow |
21:34:22 | krux02 | why do you want to overload backticks? |
21:34:27 | krux02 | can't you just use a fucntion name? |
21:34:31 | FromGitter | <Quelklef> Wait, really? `=` on ref types is a shallow clone? |
21:34:35 | FromGitter | <mratsim> everything else should be deep, but it’s easy to test |
21:34:35 | stefanos82 | krux02: I demonstrated my reasoning above. |
21:35:18 | FromGitter | <mratsim> ref type have reference semantics, ref semantics = you only copy the pointer, i.e. it points to the same memory so data is shared / copy is shallow |
21:35:20 | FromGitter | <Quelklef> I'm not in a state to test at ;-) |
21:35:30 | FromGitter | <Quelklef> Right no but |
21:35:46 | FromGitter | <Quelklef> Copying the pointer is not a "shallow clone" in my book |
21:35:55 | FromGitter | <Quelklef> a shallow clone is that the object is clones, but its fields are not |
21:36:02 | krux02 | what you want can't even be done with overloading |
21:36:05 | FromGitter | <Quelklef> Is this just a terminology difference between us? Or am I actually misunderstanding |
21:36:18 | FromGitter | <mratsim> a field is just a memory location. |
21:36:31 | krux02 | stefanos82, have yo trued doing this foobar"my string"? |
21:36:41 | FromGitter | <mratsim> when you `=`a ref type it points to the same memory location |
21:36:44 | krux02 | it won't help you with tha quotes, but it is a raw string otherwise |
21:36:52 | FromGitter | <Quelklef> Okay, I think I'm understanding then |
21:36:53 | FromGitter | <Quelklef> just to be sure |
21:36:58 | stefanos82 | krux02: you mean much like C++ uses raw strings since C++11? |
21:37:13 | FromGitter | <Quelklef> `var x: NimNode = ...; var y = x; y[0] = z; x[0] == y[0] # true`, yes? |
21:37:20 | krux02 | stefanos82, I don't know what you mean by that |
21:37:29 | FromGitter | <mratsim> @Quelklef yes |
21:37:33 | FromGitter | <Quelklef> Alright, I got it then |
21:37:35 | krux02 | how does c++11 treat raw strings (whatever you mean by that) differently? |
21:37:38 | stefanos82 | the foobar"my string" you mentioned krux02 |
21:38:05 | FromGitter | <mratsim> Try with a ref array and a ref tuple, and use “repr”, it’s easy to check. |
21:38:12 | FromGitter | <mratsim> ref object not ref tuple |
21:38:22 | FromGitter | <Quelklef> aaaaaa cannot right now |
21:38:31 | FromGitter | <Quelklef> Well, I could, but making new files for testing breaks flow |
21:38:48 | stefanos82 | krux02: C++11 and afterwards allow you syntax like R"foo(something in "here")foo"; |
21:39:04 | krux02 | http://ix.io/1id8 |
21:39:19 | krux02 | no not like c++11 |
21:39:32 | krux02 | c++11 is much better than Nim is this regard. |
21:40:24 | krux02 | c++ allows you to choose you own begin and end tokes, so that you won't have conflics in the string literal. |
21:40:53 | krux02 | But nim just has the simple raw string that can't have " in them, and the """ string literal that can't have """ in them. |
21:41:48 | stefanos82 | that's why I asked whether I could overload backticks or not :/ I don't like the use of """ for such cases |
21:42:17 | krux02 | you can still escape the backticks in non raw strings if you prefer that. |
21:42:35 | stefanos82 | you mean the standard C way, like "\"hello\""? |
21:42:40 | krux02 | yes |
21:42:49 | stefanos82 | that I know and I would like to avoid it -_- |
21:43:17 | stefanos82 | look at this beauty: echo `she said "hello" to me!` |
21:43:22 | krux02 | the escaping string literals are the only literals that can really represent any string thanks to escaping. |
21:43:45 | krux02 | stefanos82, I get what you mean. |
21:43:52 | krux02 | but that is not how Nim works |
21:44:10 | stefanos82 | maybe one day...who knows? |
21:44:33 | krux02 | also if if you could overload the backticks `` your example would still not work, because to make it work the parser would need to know about this. |
21:44:49 | krux02 | and no mapper what you overload, you can't change the behaviour of the parser. |
21:45:08 | stefanos82 | I understand |
21:46:17 | krux02 | stefanos82, look what the parser generates http://ix.io/1idb |
21:46:30 | krux02 | it is interesting it completely eats up the quotes. |
21:46:40 | krux02 | I don't think that is right. |
21:46:45 | stefanos82 | I see |
21:47:10 | krux02 | also the spaces are gone |
21:47:29 | krux02 | you won't be able to see if there was one space, more spaces or not a single space at all |
21:51:02 | stefanos82 | maybe a macro could emulate the behavior I want with the use of a different operator of my choice? |
21:51:07 | stefanos82 | something like @{}? |
21:57:01 | * | Ven`` joined #nim |
22:00:52 | * | Ven`` quit (Client Quit) |
22:05:27 | stefanos82 | krux02: do you know which file is responsible for generating C files upon compilation? I tried to read cgen.nim, but couldn't figure it out. |
22:07:11 | stefanos82 | I mean the name for each generated C code |
22:10:12 | krux02 | I am sorry, i can't tell you that |
22:10:20 | krux02 | I only know what you already found out. |
22:10:52 | FromDiscord | <emekoi> @Varriount i'm trying to wrap a c pointer as a seq that shares memory with the c side. i got nim to make an openarray that shares memory with c, but i get errors when i store an openarray in an object. |
22:10:56 | * | yglukhov[i] quit (Remote host closed the connection) |
22:11:55 | krux02 | you can't store an openarray in an object |
22:12:00 | krux02 | for reasons |
22:12:14 | krux02 | nor can you wrap a pointer is a seq. |
22:12:22 | krux02 | at least not yet. |
22:23:47 | * | krux02 quit (Quit: Leaving) |
22:26:06 | FromDiscord | <emekoi> i didn't get an error from putting the openarray in an object, but i got errors from declaring procs that took them as arguments. |
22:33:27 | FromGitter | <Quelklef> Question which is perhaps dumb: Generally, is a function call faster than a field access, or the other way 'round? |
22:34:08 | FromGitter | <Quelklef> I have a situation where I have to decide between giving 20 functions overhead by either A) making them dispatch to another function or B) making them do 1 extra field access |
23:00:21 | FromGitter | <Varriount> emekoi: An openarray is purely for parameter types - it's not a type you can actually pass around. |
23:00:38 | FromGitter | <Varriount> Or rather, not a type you can actually store in other types, or in variables. |
23:00:45 | FromGitter | <Varriount> emekoi: What C library is this? |
23:34:20 | * | ftsf joined #nim |
23:47:57 | * | icebattle quit (Ping timeout: 240 seconds) |
23:51:18 | FromGitter | <Quelklef> Anyone know if this is a bug?: https://gist.github.com/Quelklef/7edf87ac89e4b90a23b37ce2fd1d8cff |