00:09:35 | * | Tortice quit (Remote host closed the connection) |
00:09:58 | * | owner_ joined #nim |
00:10:16 | * | owner_ is now known as Guest71257 |
00:12:27 | * | mr_yogurt quit (Ping timeout: 252 seconds) |
00:14:35 | * | wildlander quit (Quit: Konversation terminated!) |
00:14:55 | * | mr_yogurt joined #nim |
00:32:14 | * | druonysus joined #nim |
00:32:14 | * | druonysus quit (Changing host) |
00:32:14 | * | druonysus joined #nim |
00:34:51 | * | zachk quit (Quit: Leaving) |
00:48:26 | * | vlad1777d quit (Ping timeout: 244 seconds) |
00:49:50 | FromGitter | <timotheecour> @kaushalmodi are you still here? |
00:51:57 | * | chemist69 quit (Ping timeout: 252 seconds) |
00:52:55 | * | chemist69 joined #nim |
01:05:48 | * | vqrs quit (Ping timeout: 252 seconds) |
01:06:54 | * | Yardanico quit (Ping timeout: 252 seconds) |
01:07:26 | * | planetis[m] quit (Ping timeout: 276 seconds) |
01:07:26 | * | stisa[m] quit (Ping timeout: 276 seconds) |
01:07:39 | * | MrAxilus[m] quit (Ping timeout: 250 seconds) |
01:07:39 | * | TheKing[m] quit (Ping timeout: 250 seconds) |
01:07:39 | * | Demos[m] quit (Ping timeout: 250 seconds) |
01:08:48 | * | stisa[m] joined #nim |
01:08:49 | * | planetis[m] joined #nim |
01:09:20 | * | MrAxilus[m] joined #nim |
01:09:21 | * | TheKing[m] joined #nim |
01:09:56 | * | flyx quit (Ping timeout: 260 seconds) |
01:10:36 | * | flyx joined #nim |
01:11:18 | * | Yardanico joined #nim |
01:11:30 | * | Demos[m] joined #nim |
01:12:24 | * | vqrs joined #nim |
01:12:33 | FromGitter | <timotheecour> Never mind, cc-d you here: https://github.com/nim-lang/Nim/issues/9301 |
01:24:42 | * | Yardanico quit (Ping timeout: 252 seconds) |
01:25:03 | * | abm quit (Ping timeout: 245 seconds) |
01:34:29 | AlexMax | shashlick: How do I prepend lines to the start of the file? |
01:34:34 | AlexMax | like #mangle? |
01:37:12 | * | planetis[m] quit (Ping timeout: 252 seconds) |
01:37:21 | * | vqrs quit (Ping timeout: 252 seconds) |
01:37:30 | FromGitter | <kayabaNerve> include? What? |
01:37:47 | FromGitter | <kayabaNerve> I have no idea what mangle is and no idea about the prior debate. |
01:37:56 | * | petersjt014[m] quit (Ping timeout: 252 seconds) |
01:37:57 | * | zacharycarter[m] quit (Ping timeout: 252 seconds) |
01:38:09 | * | ryuo quit (Ping timeout: 252 seconds) |
01:38:18 | * | dyce[m] quit (Ping timeout: 252 seconds) |
01:38:53 | * | vqrs joined #nim |
01:40:07 | AlexMax | @kayabaNerve I'm talking about nimgen |
01:40:29 | * | ryuo joined #nim |
01:43:00 | * | planetis[m] joined #nim |
01:44:17 | FromGitter | <kayabaNerve> Never mind. :P |
01:44:27 | * | dyce[m] joined #nim |
01:44:55 | * | zacharycarter[m] joined #nim |
01:45:05 | * | petersjt014[m] joined #nim |
01:52:27 | AlexMax | I'm having complicated issues with --nep1 |
01:52:31 | AlexMax | it's frustrating |
01:56:37 | * | Demos[m] quit (Ping timeout: 250 seconds) |
01:57:53 | * | Demos[m] joined #nim |
01:58:52 | * | Yardanico joined #nim |
02:00:47 | * | Tongir quit (Remote host closed the connection) |
02:01:16 | * | thomasross quit (Remote host closed the connection) |
02:01:39 | * | thomasross joined #nim |
02:04:25 | * | banc quit (Quit: ZNC - http://znc.in) |
02:04:53 | * | stefanos82 quit (Quit: Quitting for now...) |
02:04:57 | FromGitter | <yyyc514> ok mac client |
02:04:59 | FromGitter | <yyyc514> that’s better |
02:05:10 | FromGitter | <yyyc514> is there a way to get rid of the “type here” help text? |
02:05:12 | FromGitter | <yyyc514> i know where to type |
02:06:16 | FromGitter | <yyyc514> sorry will take this to gitter |
02:07:33 | * | PrimHelios joined #nim |
02:08:30 | * | thomasross quit (Ping timeout: 252 seconds) |
02:08:40 | * | Tongir joined #nim |
02:19:34 | * | thomasross joined #nim |
02:20:01 | * | banc joined #nim |
02:33:07 | shashlick | @AlexMax: prepend |
02:34:27 | shashlick | I've not used --nep1 so far since it results in wrappers that are too messed up |
02:34:50 | shashlick | And need too much repair to get functional |
02:40:09 | AlexMax | shashlick: I tried that, but I was ending up with a single quote at the start of the .nim file |
02:40:42 | shashlick | Can you post the cfg |
02:40:47 | AlexMax | nah i threw it away |
02:40:59 | AlexMax | I was trying to --nep1 the config file |
02:41:09 | AlexMax | can you use just "prepend" by itself and it'll prepend to the start of the file? |
02:41:16 | shashlick | Yes |
02:41:28 | AlexMax | okay, not sure why that didn't work then |
02:41:34 | AlexMax | maybe it was because i used single quotes? |
02:41:37 | AlexMax | either way, moot point |
02:42:02 | shashlick | Ya I'm not sure parsecfg likes single quotes |
02:42:36 | AlexMax | I wish I knew enough about c2nim to try and fix its issues |
02:42:54 | AlexMax | but I'm not sure I want to go _that_ far down the layer cake |
02:44:03 | shashlick | Same here, I've opened several issues with c2nim but it's not gotten much attention |
02:44:28 | shashlick | I'm not sure I want to go that far, will be good for me but impossible to find time these days |
02:44:42 | shashlick | Keep https://github.com/nim-lang/nimble/issues/549 in mind with your nimble file |
02:44:51 | shashlick | What are you wrapping by the way |
02:45:07 | AlexMax | I was trying to fix nimnuklear to respect --nep1 |
02:45:29 | shashlick | Yep I tried that myself but it's a can of worms |
02:47:34 | AlexMax | did you see? the most bizare issue I had was that some identifiers just wouldn't get capitalized |
02:47:38 | AlexMax | no idea why |
02:47:49 | AlexMax | I figured out why some (int, char, etc.) weren't |
02:48:00 | AlexMax | but others like "cursor" wouldn't either |
02:48:34 | AlexMax | sorry for any onlookers, I do complain about c2nim and friends a lot, but only because Nim has been such a pleasure in most other respects |
02:49:35 | AlexMax | ya know |
02:49:40 | AlexMax | there's also cimgui |
02:50:44 | AlexMax | cimgui seems like it was designed to be generated |
02:52:29 | shashlick | Well none of this would be possible without c2nim |
02:53:30 | shashlick | That being said, I'd love to see Nim interop with C directly |
02:53:30 | AlexMax | https://github.com/cimgui/cimgui/tree/master/generator/output |
02:53:55 | AlexMax | This is very interesting |
02:56:11 | shashlick | It's only for imgui? |
02:57:35 | AlexMax | Yes. But I wonder how difficult it would be to parse those .json files and turn them into Nim bindings |
02:58:05 | AlexMax | It might allow skipping of c2nim entirely |
02:58:14 | AlexMax | (although as a downside, imgui seems much more complicated) |
02:59:53 | AlexMax | or I could suck it up and keep using nimnuklear in its current state :P |
03:00:03 | AlexMax | despite not respecting NEP1 |
03:00:09 | shashlick | I can give it a spin |
03:00:09 | shashlick | I can give it a spin |
03:00:23 | shashlick | But didn't we have an imgui wrapper already |
03:02:55 | AlexMax | no idea |
03:03:07 | AlexMax | shashlick: I don't want to add more to your plate if you're already busy :P |
03:03:28 | AlexMax | especially considering that right now there is a "good enough" solution already in place |
03:08:02 | FromGitter | <kayabaNerve> Does newString(1) return [0] or [0, 0]? |
03:08:24 | FromGitter | <kayabaNerve> (do I need to include the null terminator byte in the count) |
03:10:24 | FromGitter | <kayabaNerve> It appears to exclude the null terminator in the count. |
03:12:53 | shashlick | https://github.com/lmariscal/nimgl/blob/master/src/nimgl/imgui.nim |
03:13:55 | leorize | kayabaNerve: here's the internal on `newString(1)`: `{Sup = {len = 1, reserved = 7}, data = someAddress ""}` |
03:14:05 | leorize | got it through gdb |
03:14:23 | shashlick | Repo is active so seems it should be functional |
03:17:55 | FromGitter | <Varriount> @kayabaNerve The terminator byte should be thought of as an implementation detail. |
03:20:00 | * | chemist69 quit (Ping timeout: 252 seconds) |
03:22:08 | * | chemist69 joined #nim |
03:27:27 | FromGitter | <kayabaNerve> @Varriount Meaning...? |
03:27:55 | FromGitter | <Varriount> Meaning that procedures in the standard library ignore it. |
03:27:59 | FromGitter | <kayabaNerve> Got it |
03:28:24 | FromGitter | <Varriount> `newstring(1)` returns `"\0"` |
03:29:13 | FromGitter | <Varriount> The fact that the underlying string structure is actually `"\0\0"` is an implementation detail meant for optimization. |
03:44:29 | AlexMax | shashlick: dang, wow |
03:57:09 | * | PrimHelios quit (Quit: Leaving) |
04:34:11 | * | endragor joined #nim |
04:35:26 | FromGitter | <xmonader> @kaushalmodi good job (y) |
04:37:27 | FromGitter | <xmonader> Guys i tried loads of combinations and don't seem to be able to get it work ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ libssl.a exists in /usr/lib/musl/lib and all the headers are in /usr/lib/musl/include so what am I doing wrong? [https://gitter.im/nim-lang/Nim?at=5bbed38764cfc273f9ba2aad] |
04:38:53 | leorize | use `--passL:'-static -lssl -lcrypto'` |
04:39:33 | leorize | when you pass `lib.a`, you're refering to the file `lib.a` in the current location, not in the search path |
04:45:17 | FromGitter | <xmonader> i see let me try thanks @leorize |
04:45:21 | FromGitter | <kaushalmodi> @xmonader yeah, pass the absolute path to the .a files |
04:45:33 | FromGitter | <kaushalmodi> See the .nims for pcre support |
04:45:53 | FromGitter | <kaushalmodi> May be you copy paste that for ssl and send a PR? |
04:46:18 | FromGitter | <kaushalmodi> I used passC for setting the include path |
04:47:44 | FromGitter | <kaushalmodi> @timotheecour I saw my mention in issue https://github.com/nim-lang/Nim/issues/9301. Thanks for the analysis. |
04:54:52 | FromGitter | <xmonader> @kaushalmodi i tried |
04:55:09 | FromGitter | <xmonader> ```code paste, see link``` ⏎ ⏎ breaks with lots of undefined references... [https://gitter.im/nim-lang/Nim?at=5bbed7adf659e67772968f2f] |
04:57:33 | * | narimiran joined #nim |
04:57:48 | leorize | if there're undefined refs then probably you're missing some libraries |
04:58:20 | leorize | unlike dynamic linking, when you link with static archive you have to manually link with all of its dependencies |
05:02:39 | FromGitter | <xmonader> @leorize mainly ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbed96fbbdc0b25051f0749] |
05:03:12 | FromGitter | <xmonader> openssl_init sounds like the first thing should be in ssl headers i include no? |
05:04:11 | leorize | weird. Have you tried to link it my way? |
05:07:24 | FromGitter | <xmonader> @leorize exactly the same ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbeda8c38449236611c33fd] |
05:10:00 | FromGitter | <gogolxdong> Is there a library wrapped Vulkan? |
05:15:04 | FromGitter | <gogolxdong> What's the comparison of glm and ArrayMancer? |
05:18:41 | FromGitter | <kaushalmodi> @xmonader you have two --passL in your last snippet, not sure if that matters |
05:19:55 | FromGitter | <kaushalmodi> I can trying hacking with this tomorrow when at computer. But hopefully you or leorize can get to it. |
05:20:32 | FromGitter | <kaushalmodi> I have no experience with C other than what I got via Nim :) |
05:21:13 | * | chemist69 quit (Ping timeout: 252 seconds) |
05:22:21 | * | chemist69 joined #nim |
05:26:19 | FromGitter | <xmonader> can't have multiple passL? to the linker? not sure, today will be a busy morning i'll try to investigate this afternoon, please if anyone has an idea ping me |
05:29:21 | FromGitter | <bung87> guess you may specify a path for compiler search header files |
05:30:28 | FromGitter | <xmonader> @bung87 isn't that achieved here? ⏎ ⏎ ```--passC:'-I/usr/lib/musl/include'``` [https://gitter.im/nim-lang/Nim?at=5bbedff4c08b8b3067fd546b] |
05:36:06 | FromGitter | <juancarlospaco> ```code paste, see link``` |
05:36:28 | FromGitter | <juancarlospaco> https://pastebin.com/ESBepPJe |
05:37:19 | FromGitter | <juancarlospaco> I dunno were error comes from, is from installing `httpauth` and its dependencies. |
05:39:43 | FromGitter | <bung87> does your lib header files also there? |
05:42:05 | FromGitter | <juancarlospaco> Im on linux, arch 64bit, stable 0.19.0, happens on any path, the weird is that Path kinda hardcoded there. |
05:42:39 | * | nsf joined #nim |
05:47:11 | FromGitter | <timotheecour> @kaushalmodi you’re welcome :) |
05:49:18 | FromGitter | <bung87> if so ,I dunno then |
05:51:01 | FromGitter | <kayabaNerve> Thoughts on Nim compiler options to detect unused imports/things that could be `func` but aren't? |
05:52:24 | * | darithorn quit () |
05:59:55 | * | krux02 joined #nim |
06:03:14 | FromGitter | <timotheecour> hi @krux02 are you here? |
06:03:42 | * | Tongir quit (Remote host closed the connection) |
06:04:22 | krux02 | timo the courious: yes I am |
06:05:13 | FromGitter | <bung87> @xmonader have you tried --cincludes:DIR ? |
06:05:58 | FromGitter | <timotheecour> :) actually yes indeed i’m curious, on high level, is your PR almost ready or just failing on https://github.com/krux02/Nim/blob/sizeof-alignof/tests/typerel/trectuples.nim#L6 ? |
06:06:49 | * | Tongir joined #nim |
06:12:48 | * | narimiran quit (Quit: Konversation terminated!) |
06:27:29 | hohlerde | should I close the client socket in the async callback proc of AsyncHttpServer? or lets say, is it safe to do so? |
06:32:18 | krux02 | timotheecour: I fixed the test and that is the only test failing |
06:33:14 | krux02 | but that is a hard PR, whenever I fix something here something that shouldn't be related to sizeof breaks |
06:33:30 | krux02 | computesizealign was inteded to compute the size and the alignment of a type |
06:33:40 | Araq | that is the nature of the compiler |
06:33:40 | krux02 | but now it is much more than that |
06:33:59 | Araq | it's complex stuff |
06:34:43 | leorize | xmonader: This is important: What is the version of openssl you have installed there? |
06:35:12 | Araq | oh and here is another "easy" thing for the hacktober |
06:35:19 | krux02 | it is responsible to detect illegal type recursions, even those that are unrelated to the computation of the size (like in the last failed test), it is resposible to handle an "unknown size" state for imported types |
06:35:35 | Araq | "clean up the tests, merge tiny tests into one" |
06:36:49 | krux02 | and Araq: I would really like to merge tiny tests into one, but for the tests that expect a compilation error that is not possible afaik |
06:37:33 | krux02 | would be nice to have a "try catch" for compiler errors |
06:37:48 | krux02 | but I am not sure if it is worth it, it would be for test cases only |
06:37:52 | Araq | use 'nimout' and 'cmd: "nim check"' |
06:38:07 | Araq | and that's cool because "nim check" needs more testing too |
06:38:57 | krux02 | tests/async/tasyncssl.nim failed |
06:38:59 | krux02 | :/ |
06:39:28 | Araq | crash? |
06:39:31 | * | xomachine[m] quit (Ping timeout: 260 seconds) |
06:39:39 | * | xomachine[m] joined #nim |
06:40:33 | hohlerde | this code crashes with nodejs using the fetch library to do the http call, but works with curl. the culprit seems to be the client.close(). I am hesitating to file a github issue, as I am not sure if I miss something with async procs. |
06:40:34 | hohlerde | https://privatebin.tarakis.de/?c8de7db969cb8a99#t2Jq+rlSihj13gDM8xKIpC12rzjjadiPSeKP2aYwH4Q= |
06:40:39 | krux02 | assert fail in the test case |
06:42:33 | FromGitter | <timotheecour> *<krux02>* and Araq: I would really like to merge tiny tests into one, but for the tests that expect a compilation error that is not possible afaik ⏎ ⏎ it is, if https://github.com/nim-lang/Nim/issues/8803 is accepted (I or others could implement it; shouldn’t be hard) |
06:43:24 | Araq | timotheecour: I just explained how to do it without more compiler magic |
06:43:46 | Araq | and integration tests are better than unittests |
06:44:07 | Araq | hohlerde, https://nim-lang.org/docs/asynchttpserver.html doesn't close anything |
06:45:04 | hohlerde | Araq: yes, it is the close in my code at the end of the callback proc, using Request.client.close() |
06:45:35 | FromGitter | <narimiran> @Araq if you want to delegate the boring job of cleaning up the stale branches, my yesterday's offer still stands (i need to be a maintainer for a half an hour) |
06:46:50 | Araq | what's your github name? |
06:47:14 | FromGitter | <narimiran> also narimiran |
06:48:37 | * | PMunch joined #nim |
06:48:41 | Araq | done |
06:49:52 | FromGitter | <kayabaNerve> Araq If you're just handing those privs out... |
06:51:27 | leorize | hohlerde: maybe it's because of a double-close https://github.com/nim-lang/Nim/blob/master/lib/pure/asynchttpserver.nim#L275 |
06:53:25 | leorize | yep, it is |
06:53:36 | leorize | reproduced with `curl --http1.0` |
06:54:10 | leorize | basically, don't close the connection in the callback, or patch `asynchttpserver` to detect closed connection |
06:58:52 | Araq | this will be so much better with destructors... |
07:00:43 | hohlerde | leorize: thanks a lot. you're right. checked the nodejs call. it is using http1.1 and setting "Connection: close" in header, which results in a double close |
07:03:06 | FromGitter | <narimiran> ok, we're now at 35 branches (down from 107). there are several more that could be maybe deleted, but i don't want to do it before consulting here |
07:04:35 | FromGitter | <narimiran> `araq-devel`, `araq-misc`, `araq-better-docgen`are all listed as active, but they are all behind the devel, with no commits of their own. keep them? |
07:04:52 | PMunch | Hmm, if you try to use a unicode character in a character literal you get a "missing closing ' for character literal" error. That error message should be improved |
07:07:06 | FromGitter | <kayabaNerve> Destructors are broken as hell right now. |
07:08:06 | Araq | definitely for `araq-better-docgen` |
07:08:08 | FromDiscord | <cipharius> Talking about char literals, same error is thrown by `\n` character. Why is it not accepted in first place, while `\t` is fine |
07:08:23 | Araq | not sure about araq-misc and araq-devel but these should have been merged too |
07:08:35 | FromGitter | <kayabaNerve> Nope. Thinking of something else. |
07:08:38 | FromGitter | <kayabaNerve> NVM me. |
07:08:43 | FromGitter | <narimiran> besides those branches, there are several stale branches from 3+ years ago with just one commit. i also left them, as i'm not sure what to do |
07:09:05 | Araq | cipharius, \n is valid since Nim 0.18, update your Nim |
07:09:33 | FromDiscord | <cipharius> Ah, i hadn't tried it in 18.0 yet, as i remembered that being broken |
07:09:35 | FromGitter | <narimiran> Araq maybe you can take it from here, as you'll know better what (not) to delete. you can remove me now from the nim-team |
07:11:31 | Araq | I'll keep you, I trust you |
07:11:53 | FromGitter | <narimiran> shit, now i'm under pressure! |
07:13:04 | FromGitter | <narimiran> can i use these privileges to close those old issues i have commented where nim now successfully compiles/runs without an error? |
07:14:00 | Araq | usually it's better to close issues with a PR that adds a testcase in order to prevent regressions |
07:14:25 | Araq | but it's a tradeoff because we want the testsuite to remain "speedy" (cough...) |
07:14:51 | Araq | and some bugs are simply too improbable to ever return |
07:14:57 | FromGitter | <narimiran> ok, will work on testcases for (some of) them :) |
07:17:36 | FromGitter | <timotheecour> while we’re on the topic of long needed cleanups, how about https://github.com/nim-lang/Nim/issues/8576#issuecomment-411928292 ? ([git] rename git branch `devel` to `master` and `master` to `stable` ) |
07:20:00 | Araq | timotheecour, after 0.19.2 is out |
07:20:09 | FromGitter | <timotheecour> k |
07:20:18 | Araq | 0.19.2 will backport the most pressing bugfixes to the 0.19 branch, let's hope for the best |
07:20:50 | Araq | with the upcoming sizeof() changes and all the other stuff that's coming this trunk-based development can't work :-/ |
07:21:21 | FromGitter | <timotheecour> I’m so very happy to hear that. Branch based is so much cleaner. |
07:22:36 | FromGitter | <kayabaNerve> Why would devel ever be master and stable ever not be master? |
07:23:31 | leorize | because convention™ |
07:23:35 | FromGitter | <timotheecour> because 99.999% of projects on github do that |
07:23:50 | FromGitter | <kayabaNerve> Sounds like 99.999% of projects are stupid as hell. |
07:24:01 | FromGitter | <timotheecour> talk to them ;-) |
07:24:03 | FromGitter | <kayabaNerve> In my opinion, ofc, but still. :thinking: |
07:24:07 | FromGitter | <kayabaNerve> I'm talking to one right now |
07:24:11 | Araq | most projects on github are not a fullblown programming language |
07:24:11 | FromGitter | <kayabaNerve> Literally right now |
07:34:35 | FromGitter | <kayabaNerve> I feel that master should be THE master branch. The releases are the confirmed entries into the Nim Compiler, there to stay or be updated later, and declared... stable (hard to say that before 1.0) |
07:34:50 | FromGitter | <kayabaNerve> devel means cutting edge features with more bugs. |
07:35:39 | FromGitter | <kayabaNerve> I personally feel logic states master should be stable. Devel should be explicitly defined as so. |
07:44:57 | FromGitter | <alehander42> @kayabaNerve yeah but that doesn't work well if you want to maintain more than one releases (I guess?) |
07:45:20 | FromGitter | <alehander42> at least that's how i understand it after searching for both models |
07:47:37 | FromGitter | <kayabaNerve> branch 0.18 |
07:47:41 | FromGitter | <kayabaNerve> branch 0.18 |
07:47:46 | FromGitter | <kayabaNerve> stabe |
07:47:57 | FromGitter | <kayabaNerve> devel |
07:48:57 | FromGitter | <alehander42> well why would devel be not master then |
07:49:52 | FromGitter | <timotheecour> exactly @alehander42 ’s point, and the 99.999% argument above. |
07:51:20 | FromGitter | <kayabaNerve> By stable I meant master. Sorry. ⏎ ⏎ @alehander42 Because that doesn't explicitly state you're getting the version with more bugs. |
07:56:05 | PMunch | A little terminal snake: http://ix.io/1oUb/Nim |
07:56:50 | PMunch | Just playing a bit more with sub-character terminal drawings |
07:57:19 | PMunch | This uses the 1/2 block to essentially draw squares at 2x the lines in your terminal |
08:01:55 | * | onionhammer quit (Ping timeout: 244 seconds) |
08:03:35 | * | gmpreussner quit (Ping timeout: 268 seconds) |
08:04:02 | * | gmpreussner joined #nim |
08:14:21 | * | floppydh joined #nim |
08:16:14 | * | onionhammer joined #nim |
08:16:41 | FromGitter | <alehander42> @kayabaNerve well stable explicitly states you're getting the version with less bugs |
08:18:07 | FromGitter | <kayabaNerve> But you have to ask to be safe. Why not ask to be unsafe? |
08:21:40 | leorize | why not ask for both? you can certainly remove the master branch AFAIK |
08:23:03 | FromGitter | <narimiran> bikeshedding? |
08:23:10 | leorize | what color is it? |
08:25:40 | * | Zevv left #nim (#nim) |
08:32:58 | PMunch | I vote for colouring the master branch blue |
08:33:06 | PMunch | And the devel branch green |
08:45:39 | * | craigger quit (Read error: Connection reset by peer) |
08:46:18 | * | craigger joined #nim |
08:46:33 | FromGitter | <alehander42> no love for yellow |
08:49:49 | FromGitter | <narimiran> stable = black, devel = orange ---> orange is the new black! |
08:49:49 | * | abm joined #nim |
08:50:52 | * | craigger quit (Read error: Connection reset by peer) |
08:51:20 | * | craigger joined #nim |
08:54:59 | * | krux02 quit (Remote host closed the connection) |
08:55:59 | FromGitter | <kayabaNerve> Why does varargs not works with async? |
09:04:00 | Araq | Nim doesn't know how to put to the heap and/or the copies would be oh-so-expensive |
09:04:15 | FromGitter | <kayabaNerve> K |
09:04:22 | FromGitter | <kayabaNerve> Is it issue worthy or na? |
09:05:22 | FromGitter | <kayabaNerve> It seems like it should have an issue but also its a PITA and it is already known |
09:05:49 | FromGitter | <timotheecour> @ PMunch your link prints weird: "import math import strutils import sequtils im…" |
09:06:05 | leorize | I think ix.io is being broken |
09:06:14 | leorize | so just trim the `/nim` part from the URL |
09:06:29 | FromGitter | <narimiran> @timotheecour here's a better version of that link: http://ix.io/1oUb |
09:07:47 | FromGitter | <timotheecour> Thanks! (why not point to a GitHub/similar link instead?) |
09:08:31 | leorize | because ix.io is lightweight? |
09:08:44 | leorize | and you can paste from command line with just `curl`? |
09:08:46 | FromGitter | <mratsim> ^, this, I’m always wondering when people use strange pastebins |
09:09:33 | Araq | so ... was IUP ported to OSX finally? |
09:10:06 | * | craigger_ joined #nim |
09:10:48 | leorize | also your typical pastebin wouldn't let you host testresults.html ;) |
09:11:15 | * | craigger quit (Ping timeout: 250 seconds) |
09:11:35 | leorize | Araq: is this expected on 32bit OS? ```Error: unhandled exception: /home/tumble/Nim/lib/pure/math.nim(717, 14) `log(4.0, 3.0) == ln(4.0) / ln(3.0)` [AssertionError]``` |
09:15:57 | * | dddddd joined #nim |
09:15:59 | Araq | leorize, the tests are not green on a 32bit OS for unknown reasons |
09:16:10 | Araq | I think appveyor 32 is disabled :-/ |
09:16:53 | * | craigger_ quit (Ping timeout: 250 seconds) |
09:18:50 | * | endes[m] quit (Ping timeout: 276 seconds) |
09:18:58 | * | endes[m] joined #nim |
09:20:08 | * | petersjt014[m] quit (Ping timeout: 276 seconds) |
09:20:20 | * | petersjt014[m] joined #nim |
09:20:26 | leorize | Some tests fail due to overflow and/or size differences between types of different architectures |
09:21:25 | leorize | but weirdly, some fails because the `Hint:` lines weren't filtered by testament |
09:22:47 | Araq | some tests need to be fixed and probably also some things in the compiler and libraries |
09:24:22 | * | banc quit (Ping timeout: 268 seconds) |
09:24:23 | leorize | There's https://github.com/nim-lang/Nim/issues/9138 with a 10 days old log attached, if anyone want to try fixing 32 bit bugs |
09:26:23 | * | banc joined #nim |
09:28:26 | * | craigger joined #nim |
09:31:20 | * | couven92 joined #nim |
09:38:24 | FromGitter | <xmonader> @leorize OPENSSL_VERSION=1.0.2o |
09:51:14 | leorize | xmonader: that's why it didn't work |
09:52:28 | leorize | try `-d:openssl10` |
09:52:36 | floppydh | hey, I've been absent for a while, is dynamic-linking still "the-way" to go for nim? - I remember wanting to statically-link my stuff but I remember that it was very uncommon |
09:52:55 | leorize | floppydh: you can easily static link stuff now |
09:52:59 | PMunch | timotheecour, leorize, seems like ix.io doesn't like to create line numbers in my paste.. |
09:53:19 | floppydh | leorize: how? any keywords? |
09:53:31 | leorize | --dynlibOverride |
09:53:39 | leorize | then pass the link flags yourself |
09:53:48 | leorize | between modules then it has always been static-linked |
09:54:12 | PMunch | mratsim, timotheecour, because I have a keyboard shortcut that grabs whatever I have selected, creates a ix.io paste out of it, and puts the resulting link in my clipboard |
09:54:26 | PMunch | Just a lot easier than copy-pasting it into a web-page and copying the link back out |
09:54:43 | FromGitter | <xmonader> @leorize thank you will try it |
09:54:45 | FromGitter | <mratsim> I just use gitter :P |
09:55:35 | floppydh | leorize: oh I see, but I have to deal with getting the static-libs and then passing their flags all by myself no? |
09:55:45 | * | vlad1777d joined #nim |
09:55:46 | leorize | xmonader: if that doesn't work also then update your openssl to 1.1.0+ |
09:56:21 | FromGitter | <xmonader> @leorize that's perfect will try to do the whole musl flow now at work for pcre and openssl |
09:56:23 | FromGitter | <xmonader> thank you |
09:56:50 | leorize | floppydh: yes, but at least it's universally appliable to all wrappers now ("assuming they use {.dynlib.} pragma") |
09:57:04 | floppydh | leorize: I see |
09:58:22 | FromGitter | <timotheecour> for me the problem with stuff like http://ix.io/1oUb is there are no “back-links” (pointing to author or github parent repo etc) or ways to write comments, etc, unlike something like https://gist.github.com/ |
09:59:20 | leorize | ix.io is use for simple snippet sharing, and usually used with a chat service, like IRC |
09:59:33 | PMunch | Well I don't want all that stuff @timetheecour, I just want a simple way to share snippets with people on IRC |
09:59:36 | leorize | an alternative to pasting code on gitter for IRC user |
10:05:06 | FromGitter | <alehander42> i just paste stuff on gitter too |
10:05:34 | FromGitter | <alehander42> besides, i think there are similar plugins for gist, there was one for sublime |
10:08:51 | PMunch | With my system I can copy anything from anywhere into a paste and immediately have it on my clipboard as a link. No plugins to set, no nothing |
10:12:34 | * | craigger quit (Read error: Connection reset by peer) |
10:13:42 | * | craigger joined #nim |
10:16:16 | * | craigger_ joined #nim |
10:18:13 | * | craigger quit (Ping timeout: 252 seconds) |
10:19:53 | FromGitter | <tim-st> Is an RFC for Concept std types needed? https://github.com/nim-lang/Nim/issues/9289 |
10:24:29 | PMunch | https://gist.github.com/PMunch/4455921b1c35772f8a59d1e1711e43a5 |
10:25:03 | PMunch | Cleaned the code up a bit, fixed some bugs, and made the timing better |
10:25:19 | planetis[m] | how can I compile runnableExamples? nim c -r module doesn't run them |
10:25:39 | FromGitter | <timotheecour> nim doc foo.nim |
10:26:31 | FromGitter | <kaushalmodi> planetis: nim doc .. |
10:27:08 | planetis[m] | thx |
10:31:11 | planetis[m] | How to name a mutable string concept add `Mutable`, `Mut` as a prefix or postfix? |
10:31:23 | planetis[m] | @tim-st do you want to make an RFC? |
10:32:39 | Araq | the convention is an M prefix, 'mitems' |
10:32:49 | Araq | so it could be MStringLike |
10:33:03 | planetis[m] | ok |
10:33:19 | Araq | but I don't know what this means :P |
10:33:31 | Araq | AddableString ? |
10:34:10 | Araq | mutability is usually already encoded in the 'var'ness of the parameter type |
10:37:46 | * | hoijui joined #nim |
10:38:25 | FromGitter | <mratsim> unless it’s a ref |
10:38:43 | FromGitter | <mratsim> but yeah, why do we need a concept for var string? |
10:39:37 | planetis[m] | so I will add the `c.add(char)` directly to the StringLike concept |
10:40:14 | FromGitter | <mratsim> sounds like architecture astronauting to me :P beyond strings what kind of type would use that? |
10:41:21 | FromGitter | <mratsim> If you define the concept properly you can accept a `var MyConcept` as input |
10:42:06 | planetis[m] | sure I think it is simpler and nicer |
10:42:45 | Araq | planetis[m], which proc requires the MutableString? |
10:42:48 | FromGitter | <mratsim> Actually I think we might need something for Utf strings |
10:43:01 | FromGitter | <mratsim> but probably `add` should be part of the concept definition |
10:43:18 | planetis[m] | none it was suggested here: https://github.com/nim-lang/Nim/issues/9289 |
10:44:56 | planetis[m] | i will close the Pr so it doesn't rebuild each time |
10:45:18 | Araq | seems to me that return type concepts will be lots of fun... |
10:45:56 | Araq | the input arguments are always easy, it can be an Indexable or an Iterable |
10:46:17 | FromGitter | <tim-st> Araq: all procs that take `var string` should get the mutable StringLike I think |
10:46:24 | * | elrood joined #nim |
10:46:38 | Araq | but how the heck am I supposed to know the return type in the new shiny concept world? |
10:46:58 | FromGitter | <tim-st> planetis[m]: no, I didnt want to write one (I have no good plan for the inheritance and how many types) |
10:47:12 | FromGitter | <tim-st> Araq: return types always string? |
10:47:20 | Araq | yeah, great :P |
10:47:33 | FromGitter | <tim-st> for StringLike at least |
10:48:11 | Araq | so ... we pretend to not know the input type but the output type is string and everything ever written in Nim uses 'string' |
10:48:14 | planetis[m] | algorithm procs took openarray and returned seq. so nothing changes |
10:48:33 | Araq | ok that's fair |
10:49:05 | Araq | also, the RFC said, algorithm and sequtils are affected |
10:49:17 | Araq | not to patch 'string' everywhere else |
10:49:48 | FromGitter | <tim-st> should the concept type definition be in system.nim ? |
10:50:00 | Araq | no. |
10:50:21 | Araq | the std / baseconcepts or something |
10:50:39 | planetis[m] | at least parseutils no? |
10:50:46 | FromGitter | <tim-st> and strutils |
10:51:33 | FromGitter | <narimiran> strlikeutils :P |
10:51:36 | Araq | no in my opinion, but it's another fight I'll lose |
10:52:02 | FromGitter | <mratsim> let’s remove strings, close 1000 issue |
10:52:20 | FromGitter | <tim-st> I dont see the use case of a type StringLike when the procs for strings dont work with it |
10:52:43 | Araq | I don't see the use case of StringLike when every return type stays 'string' |
10:53:14 | FromGitter | <narimiran> what is StringLike besides string? |
10:53:25 | FromGitter | <narimiran> array[char] doesn't count |
10:53:34 | FromGitter | <mratsim> unicode string |
10:53:45 | * | Vladar joined #nim |
10:53:46 | Araq | yeah... in fact |
10:53:50 | FromGitter | <mratsim> those probably need some care |
10:53:58 | Araq | the 'char' aspect is what can be abstracted over |
10:53:59 | planetis[m] | I think strutils shouldn't be touched |
10:54:52 | FromGitter | <mratsim> type StringLike = string or seq\[Rune\] |
10:56:00 | Araq | "Rune" is wrong too, it needs to be whatever Unicode says is most letter-like |
10:56:30 | FromGitter | <tim-st> I would use something like this for StringLike :) https://github.com/status-im/nim-ranges/blob/481a3d308684cdda4ca37cf3b43239a1a69029b3/ranges/memranges.nim#L5 |
10:56:41 | FromGitter | <narimiran> @timotheecour what's the point of #9304, after it was decided that nimblepkglist.nim should stay? |
10:57:12 | FromGitter | <mratsim> @tim-st this is a workaround to toOpenArray not being a value type |
10:57:31 | FromGitter | <alehander42> ok, would the implementation of add be the same for strings and for unicode ? |
10:57:33 | FromGitter | <alehander42> i doubt it |
10:57:36 | Araq | narimiran: move nimblepkglist.nim to tools/ |
10:57:48 | FromGitter | <alehander42> concepts should be used where you can reuse an algorithm |
10:57:53 | FromGitter | <kaushalmodi> @narimiran Can you commit a quick changelog edit about the xlmdom and xlmdomparser moved out to graveyard? |
10:58:11 | FromGitter | <alehander42> add seems like something that would just need overloading |
10:58:21 | FromGitter | <mratsim> Yeah, I don’t want Nim to become the Java of procedural programming language |
10:58:21 | FromGitter | <tim-st> @mratsim does `toOpenArray` has a length (len) ? |
10:58:32 | FromGitter | <kaushalmodi> (or should I open an issue for that? It's kinda part if that cleanup issue) |
10:58:37 | FromGitter | <mratsim> @tim-st `toOpenArray` is implemented as pointer + len |
10:59:13 | FromGitter | <tim-st> so when there was a type it would be the same as array[runtimeSize, Type] ? |
10:59:59 | * | xet7 joined #nim |
11:00:02 | FromGitter | <tim-st> if that works, then openArray[char] is enough to be StringLike |
11:00:21 | FromGitter | <narimiran> @kaushalmodi changelog.md is still about 0.19.0, from what i can tell? |
11:00:25 | FromGitter | <mratsim> more like tuple\[p: ptr UncheckedArray\[T\], len: len\] |
11:00:25 | FromGitter | <alehander42> but you wouldn't represent unicode string as openArray[char] ? |
11:00:50 | FromGitter | <timotheecour> @narimiran feel free to close #9304 if nimblepkglist.nim must stay |
11:00:57 | FromGitter | <mratsim> openarray\[char\] shouldn’t match string. |
11:01:02 | FromGitter | <mratsim> or vice-versa |
11:01:10 | FromGitter | <tim-st> @mratsim it does match string |
11:01:13 | FromGitter | <tim-st> in 0.19.0 |
11:01:16 | Araq | but it does and it was added after a feature request... |
11:01:30 | FromGitter | <tim-st> and I like it :) |
11:01:32 | FromGitter | <mratsim> but it was removed after a freature request after 0.17.2 no? |
11:02:03 | Araq | I don't know, we changed that array[char] is compatible with cstring |
11:02:12 | FromGitter | <mratsim> I think we should provide a toString with a `lent` something |
11:02:17 | FromGitter | <mratsim> ah |
11:02:28 | FromGitter | <kaushalmodi> If the removal happened on devel branch, the changelog on devel branch should reflect that imo, @Araq? May be add 0.19.2 header? |
11:02:51 | planetis[m] | well sheep `StringLike` overly restrictive doesnt even fit my use case |
11:03:03 | Araq | as I said, take the 0.19 tag, apply/cherry-pick bugfixes, release 0.19 |
11:03:10 | Araq | *0.19.2 |
11:03:45 | FromGitter | <mratsim> @Araq: https://github.com/nim-lang/Nim/issues/6350 |
11:04:33 | Araq | yeah, implicit conversions can hurt |
11:05:24 | FromGitter | <narimiran> @timotheecour there's another solution: to move it to tools, i'm working on it |
11:06:09 | FromGitter | <timotheecour> lol ya, i just posted that on that issue |
11:07:49 | FromGitter | <mratsim> I’m gonna write a RFC “The meaning of string” :P |
11:07:51 | FromGitter | <timotheecour> `more like tuple\[p: ptr UncheckedArray\[T\], len: len\]` => openArray should just be that |
11:08:36 | FromGitter | <mratsim> with a lifetime and “lent”-checker attached to it :P |
11:09:06 | Araq | write an RFC instead, "how to program" |
11:09:56 | FromGitter | <timotheecour> I’ve said it before but string should be implemented in terms of seq, with string litterals being special in that they add a trailing 0 for cstring compatibility just in that case. So we only need to define seq, and string is a regular `seq[char]` |
11:10:25 | Araq | you've said it before, I disagreed back then and still do :P |
11:10:32 | FromGitter | <mratsim> seq\[char\] and string should be separate |
11:10:38 | FromGitter | <narimiran> bug-FIXES, guys! ;) |
11:10:46 | FromGitter | <mratsim> it’s semantically quite different. |
11:11:08 | FromGitter | <mratsim> worse is conflating string with seq\[byte\] |
11:11:10 | Araq | yup and with Unicode it became hopeless to abstract over and keep performance |
11:11:12 | * | gangstacat quit (Quit: Ĝis!) |
11:12:19 | FromGitter | <timotheecour> for unicode all we just need iterators, eg `byGrapheme` etc |
11:13:52 | Araq | a grapheme itself is of variable length, no? |
11:15:17 | FromGitter | <timotheecour> 1 grapheme = variable number of characters indeed |
11:22:33 | Araq | timotheecour, any opinion on my compiler/pathutils? I think we should move large parts from it to ospaths |
11:25:02 | FromGitter | <timotheecour> how about ospaths2 according to “tradition” for other modules ? |
11:30:01 | Araq | huh? we would patch ospaths to use my PathIter primitive |
11:30:26 | Araq | and I would keep the strongly typed variants for the compiler |
11:30:55 | Araq | because there would be endless discussions about these 4 distinct string types |
11:31:18 | FromGitter | <timotheecour> which ones? AbsoluteFile … RelativeDir? |
11:31:23 | Araq | yes |
11:31:58 | FromGitter | <timotheecour> as a user I’d like to have an entirely typesafe alternative to ospaths (eg ospaths2) |
11:32:40 | FromGitter | <timotheecour> likewise with stuff like writeFile(path:Path, contents: string) which would be impossible to type in wrong order (unlike what we have now) |
11:33:35 | Araq | I agree but this is a larger change and also related to the "remove system.nim RFC" |
11:34:11 | FromGitter | <timotheecour> so basically it deserves an RFC |
11:34:20 | FromGitter | <timotheecour> (also its 4am here, need to crash…) |
11:34:28 | Araq | oh sorry, good night |
11:34:35 | Araq | no RFC please :P |
11:34:44 | Araq | just an implementation change for now |
11:36:05 | FromGitter | <timotheecour> well can u just write a blurb in an issue of what’s ur intent with moving compiler/pathutils into ospaths? will look tmrw |
11:36:18 | FromGitter | <timotheecour> ok thanks gtg |
11:38:40 | * | krux02 joined #nim |
11:40:59 | * | vlad1777d_ joined #nim |
11:41:43 | * | vlad1777d quit (Ping timeout: 245 seconds) |
11:47:49 | krux02 | it seems like implementing sizeof in the compiler was much more work than I ever thought it would be. |
11:48:11 | krux02 | but it works now, tests run through |
11:51:40 | FromGitter | <mratsim> @tim-st: https://github.com/nim-lang/Nim/issues/9312 |
11:52:07 | FromGitter | <mratsim> @timotheecour as well, for good dreams :P |
11:53:10 | FromGitter | <mratsim> @araq, I think contributing.rst should be top level |
11:55:54 | Araq | no, I can set that in the github settings somewhere, I think |
11:56:34 | FromGitter | <mratsim> you should also add “add an empty line at the end of your file”, this can be configured in your code editor |
11:57:01 | Araq | argh... moar RFCs, that's it |
11:57:11 | Araq | gonna create nim-lang/rfcs |
11:57:59 | FromGitter | <mratsim> nim-lang/specs. Once a RFC is accepted it becomes a spec ;) |
11:58:05 | FromGitter | <mratsim> welcome to bureaucracy! |
11:58:33 | FromGitter | <mratsim> though if you require those specs to be written in RST instead of Markdown I’m sur it will cut those in half :P |
11:59:14 | Araq | sounds like a feature to me |
12:07:23 | FromGitter | <kaushalmodi> (and pandoc downloads shoot through the roof) |
12:24:47 | FromGitter | <narimiran> re: code owners: i want to see more of LemonBoy there! |
12:28:15 | FromGitter | <narimiran> sweet jesus, there are 89 open issues labeled RFC! |
12:33:50 | * | fangs joined #nim |
12:38:07 | * | stefanos82 joined #nim |
12:40:56 | * | fangs left #nim (#nim) |
12:41:24 | FromGitter | <kayabaNerve> So I found a bug. |
12:41:32 | FromGitter | <kayabaNerve> It's weird as hell. |
12:42:07 | FromGitter | <kayabaNerve> I try not to directly link my project but I have this file which works fine. https://github.com/EmberCrypto/Ember/blob/master/src/MainGlobals.nim |
12:42:36 | * | gangstacat joined #nim |
12:42:57 | FromGitter | <kayabaNerve> I changed the last part to https://gist.github.com/kayabaNerve/1aac9f97cf7964fa0936bfe0a29eab29 |
12:43:02 | FromGitter | <kayabaNerve> Generally, I would say I f***ed up and move on. Here's the error though. |
12:43:15 | FromGitter | <kayabaNerve> MainGlobals.nim(24, 13) template/generic instantiation from here ⏎ MainGlobals.nim(26, 9) Error: unreachable statement after 'return' |
12:43:47 | * | Yardanico quit (Ping timeout: 252 seconds) |
12:43:52 | FromGitter | <kayabaNerve> I'm 99.9% sure I don't have any return statement there. |
12:44:23 | FromGitter | <kayabaNerve> It only appeared when I switched to async. I assume I should create a GH issue for this but honestly I would love validation this isn |
12:44:34 | FromGitter | <kayabaNerve> *isn't a me-problem and is actually a problem with the language. |
12:50:23 | FromGitter | <kayabaNerve> I minimized it; definitely asyncdispatch; creating an issue; NVM. |
12:50:28 | Araq | async maybe injects a return for you |
12:50:46 | Araq | but sure, report it |
12:50:58 | FromGitter | <kayabaNerve> It's because of quit in async |
12:51:02 | FromGitter | <kayabaNerve> If I remove that, it's fine |
12:56:07 | * | Yardanico joined #nim |
13:11:41 | * | endragor quit (Remote host closed the connection) |
13:13:24 | FromGitter | <bung87> @mratsim https://github.com/nim-lang/Nim/issues/9312#issuecomment-428930747 I commented. |
13:13:45 | FromGitter | <kaushalmodi> I am trying to do something like this: ⏎ ⏎ ```proc mapconcat*[T](s: openArray[T]; op: proc(x: T): string = `$`; sep = " "): string =``` [https://gitter.im/nim-lang/Nim?at=5bbf4c89ae7be940163b66fd] |
13:14:01 | FromGitter | <kaushalmodi> what's a valid way so that the `op` defaults to `$` |
13:14:02 | FromGitter | <kaushalmodi> ? |
13:14:25 | FromGitter | <mratsim> the propername is concatmap by the way |
13:14:40 | FromGitter | <kaushalmodi> ah! |
13:14:46 | FromGitter | <kaushalmodi> that's why I couldn't find it :P |
13:14:55 | FromGitter | <kaushalmodi> wait |
13:14:58 | FromGitter | <kaushalmodi> does that exist? |
13:15:02 | FromGitter | <mratsim> Here you go: https://github.com/mratsim/Arraymancer/blob/v0.1.0/src/arraymancer/utils/functional.nim#L88-L90 |
13:15:16 | FromGitter | <mratsim> that was like 1.5 years ago, I’ve removed it since then |
13:15:25 | FromGitter | <kaushalmodi> cool |
13:15:27 | FromGitter | <kaushalmodi> why? |
13:15:39 | FromGitter | <kaushalmodi> I was missing elisp functions like those in nim: https://www.gnu.org/software/emacs/manual/html_node/elisp/Mapping-Functions.html |
13:15:48 | FromGitter | <kaushalmodi> it's `mapconcat` in elisp |
13:15:58 | FromGitter | <mratsim> it’s called concatmap in Haskell |
13:16:03 | FromGitter | <kaushalmodi> that name makes sense because you first map through all elements and then concat them |
13:16:04 | krux02 | kaushalmodi: overloading |
13:16:08 | FromGitter | <mratsim> mostly because I didn’t need it |
13:16:23 | FromGitter | <kaushalmodi> krux02: what do you mean by that comment? |
13:16:35 | FromGitter | <mratsim> function are done from inner to outer concat(map(…)) |
13:16:45 | krux02 | the op = `$` |
13:16:55 | FromGitter | <kaushalmodi> that's what I did |
13:16:59 | FromGitter | <kaushalmodi> doesn't compile |
13:17:17 | FromGitter | <kaushalmodi> here's the rudimentary code that I expected to compile: https://ptpb.pw/vpXm/nim |
13:17:26 | krux02 | I think mapconcat is a stupid name |
13:17:28 | * | tdc quit (Ping timeout: 268 seconds) |
13:17:33 | FromGitter | <kaushalmodi> @mratsim I am looking for a way to set a default proc for the `op` param |
13:17:36 | FromGitter | <mratsim> can you try adding a generic `$` that is unexported? |
13:18:10 | FromGitter | <mratsim> proc `$`T (x: T): string = system.`$`(x) |
13:18:17 | krux02 | it is for string creation |
13:18:32 | krux02 | with mapconcat I would assume that it also works for Seq type |
13:18:43 | krux02 | but that isn't the case it can only produce a string |
13:18:52 | FromGitter | <kaushalmodi> @mratsim thanks trying it out |
13:19:12 | krux02 | you can look in system and see how $ on seq is implemented |
13:19:47 | FromGitter | <mratsim> otherwise there is this weird ```varargs[T, `$`]``` syntax |
13:20:07 | FromGitter | <kaushalmodi> @mratsim it's not yet clear how to set that proc as the default in the signature |
13:20:12 | FromGitter | <kaushalmodi> I get: Error: '$' cannot be passed to a procvar |
13:20:20 | FromGitter | <kaushalmodi> so what can I pass instead? |
13:20:21 | FromGitter | <mratsim> Like here: https://nim-by-example.github.io/varargs/ |
13:20:39 | FromGitter | <mratsim> you have to use a template then magics cannot be passed as proc param |
13:21:16 | krux02 | the problem is `$` is more than a syngle proc |
13:21:27 | FromGitter | <kaushalmodi> krux02: hmm, ok |
13:21:46 | FromGitter | <kaushalmodi> @mratsim I don't understand "magics". I'll hold off on this till I understand all that |
13:22:00 | FromGitter | <kaushalmodi> problem with that varargs example is that it is hard-coding the `$` |
13:22:07 | krux02 | magic means it is implemented in the compiler. |
13:22:09 | * | vegax87 quit (Changing host) |
13:22:09 | * | vegax87 joined #nim |
13:22:09 | * | vegax87 quit (Changing host) |
13:22:09 | * | vegax87 joined #nim |
13:22:23 | FromGitter | <mratsim> magic are proc that are not really Nim proc but directly implemented in the compiler or in C |
13:22:26 | FromGitter | <kaushalmodi> in above proposed mapconcat sig, I want `op` to be any proc that take T and returns string |
13:22:28 | FromGitter | <mratsim> like + - |
13:22:38 | FromGitter | <kaushalmodi> hmm |
13:23:28 | FromGitter | <bung87> that would depends whether T has a $ proc implement. |
13:23:45 | FromGitter | <kaushalmodi> it would be in general |
13:24:16 | krux02 | kaushalmodi, I don't think nim has a sytax to get a function pointer by name and signature |
13:24:52 | FromGitter | <bung87> a type T has repr proc is general. |
13:25:15 | FromGitter | <mratsim> you can cast a proc() to a ByteAddress or an int |
13:27:33 | krux02 | kaushalmodi: this is the problem http://ix.io/1oVn |
13:31:25 | krux02 | http://ix.io/1oVo |
13:31:28 | krux02 | with output |
13:32:36 | * | endragor joined #nim |
13:32:39 | FromGitter | <Vindaar> @kaushalmodi like this? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf50f7600c5f64238ec6e3] |
13:33:57 | * | elrood quit (Quit: Leaving) |
13:35:51 | FromGitter | <kaushalmodi> @Vindaar woh! yes :) |
13:36:53 | * | endragor quit (Ping timeout: 250 seconds) |
13:37:19 | FromGitter | <Vindaar> :) |
13:37:29 | FromGitter | <kaushalmodi> thanks |
13:37:39 | FromGitter | <kaushalmodi> wonder if this simple proc can make into sequtils |
13:39:19 | FromGitter | <kaushalmodi> krux02: I *still* don't understand macros.. I don't know what I should expect out of that snippet |
13:40:13 | FromGitter | <kaushalmodi> @Vindaar I am starting to collect emacs-lisp fns in a sep nim lib |
13:40:33 | FromGitter | <kaushalmodi> This was the first fn that I sorely missed |
13:41:06 | FromDiscord | <deech> I'm trying to grok concepts and I can't understand why the example in this issue doesn't work. https://github.com/nim-lang/Nim/issues/9289 |
13:41:07 | FromDiscord | <deech> I reduced the working example to: |
13:41:07 | FromDiscord | <deech> ``` |
13:41:07 | FromDiscord | <deech> type |
13:41:07 | FromDiscord | <deech> StringLike*[T] = concept c |
13:41:07 | FromDiscord | <deech> c[int] is T |
13:41:07 | FromDiscord | <deech> |
13:41:09 | FromDiscord | <deech> proc test(s: StringLike) = |
13:41:11 | FromDiscord | <deech> echo s[0] == '2' |
13:41:11 | FromDiscord | <deech> |
13:41:12 | FromDiscord | <deech> test("Hello") |
13:41:13 | FromDiscord | <deech> ``` |
13:41:14 | FromGitter | <kaushalmodi> I didn't like manually making sure that spaces were present in snippets like these: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf52fac7bf7c3662f26940] |
13:41:15 | FromDiscord | <deech> and the failing one to: |
13:41:16 | FromDiscord | <deech> ``` |
13:41:17 | FromDiscord | <deech> type |
13:41:19 | FromDiscord | <deech> StringLike = concept c |
13:41:20 | FromDiscord | <deech> c[int] is char |
13:41:21 | FromDiscord | <deech> |
13:41:23 | FromDiscord | <deech> proc test(s: StringLike) = |
13:41:24 | FromDiscord | <deech> echo s[0] == '2' |
13:41:25 | FromDiscord | <deech> |
13:41:26 | FromGitter | <kaushalmodi> woh, deech! |
13:41:27 | FromDiscord | <deech> test("Hello") |
13:41:28 | FromDiscord | <deech> ``` |
13:41:30 | FromDiscord | <deech> The only difference is the failing one doesn't take a type parameter. What's the difference? |
13:41:57 | FromGitter | <tim-st> @mratsim thanks! btw I didnt meant that openArray[char] matching was reintroduced in 0.19.0 I just meant that it works in the current version |
13:41:59 | FromGitter | <Vindaar> @kaushalmodi oh, that's a good idea! :) do you have that online already? |
13:42:14 | FromGitter | <kaushalmodi> no, I just did nimble init |
13:42:45 | FromGitter | <kaushalmodi> I got into a rabbit hole |
13:42:55 | FromGitter | <kaushalmodi> was working on something else and NIm errored: ⏎ ⏎ > ../../../stow/pkgs/nim/devel/lib/system/nimscript.nim(237, 7) Error: unhandled exception: FAILED: ./configure --prefix=/home/kmodi/sandbox/nim/hello_musl/openssl/1.1.1 no--sharedno-zlib-fPIC |
13:43:18 | FromGitter | <kaushalmodi> turns out I forgot to manually put space between "no-shared" and "no-zlib" and "-fPIC" |
13:43:30 | FromGitter | <kaushalmodi> and made me wish that Nim had mapconcat |
13:43:31 | FromGitter | <kaushalmodi> :P |
13:43:42 | * | vlad1777d_ quit (Ping timeout: 252 seconds) |
13:47:33 | * | SenasOzys quit (Ping timeout: 245 seconds) |
13:49:19 | krux02 | kaushalmodi: you know emacs lisp, maybe you should look at macros there |
13:49:29 | krux02 | for example the rx macro |
13:49:33 | krux02 | and then see what it does |
13:49:51 | krux02 | and then you can try to reproduce something similar with nim macros |
13:50:16 | FromGitter | <narimiran> @Araq when you said this morning "clean up the tests, merge tiny tests into one" (https://irclogs.nim-lang.org/11-10-2018.html#06:35:35), did you mean something like this: https://github.com/narimiran/Nim/commit/fe3b5ec5a8f08bd9d744c68a5b2dc999a706f5a9 |
13:50:42 | FromGitter | <narimiran> i've done that for three folders, but would like to know if this is the way to go before i continue |
13:51:43 | FromGitter | <kaushalmodi> krux02: Yes, I will eventually learn the Nim macros, but am just procrastinating because I haven't yet needed to tinker with it |
13:51:49 | krux02 | @narimiran: in his name I can say yes |
13:51:52 | Araq | narimiran: seems ok |
13:52:02 | krux02 | ah you are back |
13:52:08 | FromGitter | <narimiran> thanks guys, will continue to work on these before sending PR |
13:52:17 | FromGitter | <kaushalmodi> krux02: Even without macros, I spend lot of time tinkering in other Nim things :P |
13:52:33 | FromGitter | <alehander42> ah the fact that you need to escape with `""` in `"""` strings is so confusing |
13:53:37 | FromGitter | <alehander42> surprises are bad :( |
13:53:50 | Araq | huh? there is no need for that |
13:54:36 | FromGitter | <alehander42> strange |
13:54:57 | FromGitter | <alehander42> i tried it normally the first time |
13:55:57 | FromGitter | <alehander42> ah i am sorry |
13:56:08 | FromGitter | <alehander42> i meant in <stuff>".." not in triple " strings |
13:56:28 | krux02 | let myRawStr = r" Hello""World!\" |
13:57:02 | krux02 | this is where you have to escape the " with " |
13:57:18 | * | Snircle joined #nim |
13:58:13 | FromGitter | <alehander42> ok, this makes sense |
13:58:28 | FromGitter | <alehander42> and i need `\` to escape in `&".."` |
13:58:38 | FromGitter | <alehander42> but then i need `""` to escape in `sql".."` |
14:00:46 | * | Snircle quit (Client Quit) |
14:01:21 | * | abm quit (Read error: Connection reset by peer) |
14:01:56 | leorize | alehander42: `"..".sql` |
14:02:03 | krux02 | alehander42: I have sql syntax highlighting in the sql string literals :P |
14:02:49 | krux02 | did you ever try to do: sql""" |
14:03:14 | FromGitter | <alehander42> yes, but for shorter queries i typically use sql".." |
14:03:29 | krux02 | doesn't sql support single quotes as well? |
14:03:37 | FromGitter | <alehander42> "..".sql is a ok workaround, it's just i don't get the inconsistency |
14:04:23 | krux02 | “single quotes are to ‘quote’ within double quote without creating nesting confusion” |
14:05:09 | krux02 | alehander42: It is super consistent |
14:05:27 | FromGitter | <alehander42> i mean i get why r".." might take `\` literally |
14:05:28 | krux02 | it's a raw string made for regular expressions |
14:05:40 | FromGitter | <alehander42> but all other <stuff>".." |
14:05:44 | FromGitter | <alehander42> usually don't need it |
14:06:24 | FromGitter | <alehander42> so I guess because originally r".." syntax was for regexes and later generalized, sql".." fmt".." etc also escape differently? |
14:06:26 | leorize | alehander42: here is an another way: `sql ".."` (mind the space between sql and "..") |
14:06:50 | krux02 | especially for the other stuff it is important to have the raw string literals |
14:07:22 | FromGitter | <alehander42> the confusing thing is |
14:07:27 | FromGitter | <alehander42> `&".."` escape with `\` |
14:07:45 | krux02 | echo"Hello\nWorld" |
14:07:48 | krux02 | mind the space |
14:08:05 | leorize | because `&` is a operator |
14:08:37 | leorize | the rule for raw literals only exists for identifier AFAIK |
14:08:48 | * | UxerUospr joined #nim |
14:08:53 | * | Snircle joined #nim |
14:08:53 | Araq | yup, that's also clearly covered by the spec |
14:09:08 | FromGitter | <narimiran> can anybody explain why we have these: https://github.com/nim-lang/Nim/tree/devel/tests/benchmarks ? their syntax is quite wrong, i guess they are not run |
14:09:18 | FromGitter | <alehander42> i think 90% of new users would just try different things until their escape compilers |
14:09:48 | Araq | that's ok as long as the other 10% become valuable contributors |
14:09:51 | Araq | :P |
14:10:01 | Araq | and as long as the absolute numbers are high |
14:10:07 | FromGitter | <alehander42> valuable contributors need users :D |
14:10:18 | FromGitter | <alehander42> otherwise they don't find it valuable to contribute |
14:10:28 | leorize | narimiran: they don't start with `t` so I assume they aren't run |
14:10:51 | FromGitter | <kaushalmodi> @Vindaar This is just the beginning https://github.com/kaushalmodi/nimy_lisp |
14:10:58 | FromGitter | <alehander42> ok, at least it would be cool to improve the error somehow |
14:11:00 | * | SenasOzys joined #nim |
14:11:11 | FromGitter | <alehander42> as currently it doesn't even seem to have anything to do with the string |
14:11:17 | FromGitter | <alehander42> but that might be hard |
14:12:05 | FromGitter | <narimiran> leorize: then another question is: even if they were ok (which they are not), why are they in the tests folder? |
14:12:48 | leorize | Araq: ^ |
14:13:10 | FromGitter | <alehander42> @krux02 postgres supports single quotes for strings, but double for identifiers (afaik) |
14:13:26 | * | jhorwitz_ joined #nim |
14:13:36 | * | jhorwitz_ quit (Client Quit) |
14:13:51 | * | jhorwitz_ joined #nim |
14:15:13 | FromGitter | <kaushalmodi> Araq: Would would be good answers to these questions? https://github.com/nim-lang/Nim/issues/9288#issuecomment-428907045 |
14:15:22 | FromGitter | <kaushalmodi> the PR that closed that issue doesn't answer those |
14:15:53 | * | jhorwitz_ quit (Client Quit) |
14:16:40 | leorize | kaushalmodi: the manual describes the spec, so it doesn't specify the exact number |
14:16:55 | FromGitter | <kaushalmodi> apart from the number.. |
14:17:00 | FromGitter | <kaushalmodi> the other 2 questions |
14:17:13 | FromGitter | <kaushalmodi> so the TRM just dies because it inflooped the first time? |
14:19:29 | Araq | yeah I'm looking at it, it's a bug, I think |
14:19:50 | Araq | but the bailout should be based on scoping, hmmm |
14:20:39 | FromGitter | <kaushalmodi> thanks. can you please reopen that issue then? |
14:21:51 | * | krux02_ joined #nim |
14:22:07 | * | krux02_ quit (Remote host closed the connection) |
14:23:49 | * | hoijui_ joined #nim |
14:27:42 | * | hoijui quit (Ping timeout: 252 seconds) |
14:30:00 | * | NimBot joined #nim |
14:30:18 | * | PMunch quit (Quit: Leaving) |
14:35:47 | FromGitter | <stvnfx> Just asking a dumb question here but if I interface with a cpp static library file, nimsnappy in my case and I use the c backend the linker cant fine the symbols. is there anyway around this? |
14:37:29 | FromGitter | <stvnfx> I am sure this has been asked but maybe my google fu is a bit lacking :) |
14:38:36 | FromGitter | <stvnfx> It does work when I use the nim cpp backend when I staticaly link it |
14:52:36 | FromGitter | <mratsim> {.passC:”-DSYMBOL”.} or {.passl:”-LSYMBOL”.} is the great escape hatch |
15:01:20 | * | floppydh quit (Quit: WeeChat 2.2) |
15:04:03 | FromGitter | <stvnfx> hmmm let me read more about that, I did something similar where I added {.passL:"alibsnappy.a”.} when I compile to a static lib file but the linker would complaint about missing symbols. I was hoping there was some sort of way to demangle the cpp snappy lib file. I am not the best with cpp and its the only dependency that is compiled with cpp |
15:04:59 | FromGitter | <stvnfx> @mratsim thanks for the response 😄 |
15:06:38 | FromGitter | <stvnfx> just making one fat executable for work to ship easily |
15:06:55 | FromGitter | <mratsim> you probably need a dynlibOverride somewhere |
15:07:38 | FromGitter | <tim-st> @stvnfx do you use this library? https://github.com/NimCompression/nimsnappyc |
15:07:56 | FromGitter | <mratsim> Here is how I statically link to Intel MKL in my library: https://github.com/mratsim/Arraymancer/blob/master/nim.cfg#L72-L82 |
15:08:06 | FromGitter | <bung87> is there pragma `{.this: self.}` for initObj ? has many properties to init |
15:08:26 | FromGitter | <mratsim> "this" is deprecated |
15:08:28 | leorize | I think it's being deprecated |
15:08:55 | leorize | so `result = Obj(field1: val1, field2: val2)` |
15:09:14 | FromGitter | <stvnfx> @tim-st no, I found this https://github.com/dfdeshom/nimsnappy I did not see that one |
15:09:39 | FromGitter | <tim-st> that should fix your problem I assume :) |
15:10:12 | FromGitter | <stvnfx> @tim-st yes defenitly :) |
15:10:13 | FromGitter | <bung87> hmm if I use `result = ` should I also need `{.noinit.}` ? |
15:10:25 | FromGitter | <stvnfx> thanks @tim-st @mratsim |
15:10:55 | FromGitter | <mratsim> @bung87 noInit is for arrays mainly |
15:10:57 | FromGitter | <tim-st> @bung87 I think `{.noInit.}` goes to the return type definition of the proc |
15:11:09 | FromGitter | <tim-st> (when you want it for result) |
15:12:03 | FromGitter | <tim-st> maybe not useful anymore for strings? |
15:12:12 | FromGitter | <tim-st> and seq |
15:12:15 | FromGitter | <bung87> ok I accept that |
15:12:34 | FromGitter | <mratsim> Tracked in that issue: https://github.com/nim-lang/Nim/issues/8745 |
15:12:53 | FromGitter | <mratsim> but it’s been seriously improved for all heap types |
15:13:29 | * | narimiran joined #nim |
15:21:23 | ryuo | I've been watching Nim for awhile and I was curious. What makes it worthwhile to people here compared to more mainstream languages? |
15:22:06 | FromGitter | <rokups> any idea why nim would fail to execute vccexe.exe on windows? https://pastebin.com/ZNCR7Kx5 |
15:23:38 | leorize | ryuo: it's simple, clean |
15:24:10 | FromGitter | <mratsim> it’s complex, with lots of architecture astronauting potential ;) |
15:24:39 | FromGitter | <mratsim> Also it looks good in Meetups and other social gatherings ;) |
15:25:31 | FromGitter | <stvnfx> and it makes tiny binaries :) |
15:26:37 | ryuo | to date i've primarily used C and few other scripting languages. it's weird how I knew exactly what I wanted back then but now I feel kinda... paralyzed by all the choices available. |
15:27:12 | FromGitter | <mratsim> Pralysis of choice is a real thing, it’s like “better alone than in bad company" |
15:27:44 | FromGitter | <mratsim> anyway if you used C you’ll be right at home there. No OOP madness, sane proc. |
15:28:06 | FromGitter | <mratsim> memory representation is the same as well, C interop is easy. |
15:28:30 | ryuo | yea... but i figure i'll have to learn a language like Python at some point for other reasons. |
15:28:48 | ryuo | C... very common yet hardly a skill that people ask for. |
15:28:58 | FromGitter | <mratsim> You can even get goodness like OpenMP or computed gotos |
15:29:26 | FromGitter | <mratsim> my company is looking into C and C++ devs for Nim positions. |
15:29:35 | ryuo | Doesn't nim inherit the same concept of whitespace being meaningful for scope? |
15:29:56 | ryuo | Huh. Interesting. I've spent like 8 years with C, primarily with userspace work. |
15:30:09 | ryuo | I learned a great deal writing some distribution software in the past. |
15:30:32 | FromGitter | <mratsim> yes, scope is white-space aware |
15:30:45 | * | stevenfx joined #nim |
15:30:59 | ryuo | I've also used C++, but i'm hardly as fluent it in as with C. |
15:31:26 | ryuo | It's like with modern C++ they decided to throw in the kitchen sink for good measure. |
15:32:24 | ryuo | mratsim: Is your company still looking then? |
15:33:00 | FromGitter | <mratsim> You bet: https://status.im/open-positions.html?gh_jid=1196154 |
15:33:41 | FromGitter | <mratsim> Networking and/or low-level cryptography experience are what we’re looking for the most. |
15:33:43 | * | Snircle quit (Read error: Connection reset by peer) |
15:34:12 | FromGitter | <mratsim> Embedded devices experience as well. |
15:34:31 | * | Snircle joined #nim |
15:35:29 | ryuo | Most of my networking experience is with configuring networks and sometimes when I wrote web applications... And I've only used cryptography libraries. |
15:36:25 | ryuo | mratsim: thanks for the information. |
15:38:28 | * | stevenfx quit (Quit: stevenfx) |
15:42:00 | FromGitter | <iffy> Can I get a sanity check? Am I barking up the wrong tree here? https://forum.nim-lang.org/t/4300#26770 |
15:45:47 | FromGitter | <mratsim> @iffy, not really. When you use quote do you get back into the “runtime” domain and Nim compiler has to do a symbol resolution pass again so you get symbols and not identifiers |
15:46:00 | FromGitter | <mratsim> You can use the replaceNodes proc I mentionned here: https://github.com/nim-lang/Nim/pull/8531#issuecomment-410436458 |
15:46:11 | FromGitter | <mratsim> or don’t use quote. |
15:46:38 | FromGitter | <mratsim> Build the AST by hand or use a DSL like breeze: https://github.com/alehander42/breeze |
15:46:50 | krux02 | mratsim: sometimes I wished that ``quote do`` wouldn't do symbol resolution |
15:47:18 | FromGitter | <mratsim> 100% agree: https://github.com/nim-lang/Nim/issues/7719 |
15:47:26 | krux02 | it is quite annoying when local identifiers that are not supposed to be used in the DSL get injected there |
15:47:36 | FromGitter | <mratsim> I basically have this `replaceNodes` proc in all my projects |
15:48:35 | FromGitter | <iffy> I read somewhere that breeze doesn't work on newer versions (but I didn't actually verify) |
15:48:45 | * | FromGitter * iffy looks at replaceNodes |
15:51:07 | krux02 | mratsim: That's interesting |
15:51:22 | FromGitter | <iffy> hehe... it literally just replaces the nodes I don't like. Why didn't I think of that :) |
15:51:55 | FromGitter | <iffy> I'll give it a shot in my program; thank you @mratsim ! |
15:52:03 | krux02 | I think you can create a quote that creates a `newTree` expression and has an untyped argument |
15:52:20 | FromGitter | <kaushalmodi> leorize: Any help with that ssl static linking. I tried it on ssl 1.1.1: |
15:52:23 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf71b7600c5f64238fe2b6] |
15:52:50 | FromGitter | <kaushalmodi> I have the ssl compilation .nims online here: https://github.com/kaushalmodi/hello_musl/blob/ssl/config.nims#L96-L106 if you want to review |
15:52:50 | krux02 | iffy, you can comment in that thread and give some feedback |
15:53:02 | leorize | kaushalmodi: link with libcrypto also |
15:53:08 | FromGitter | <kaushalmodi> I did |
15:53:14 | FromGitter | <kaushalmodi> see that snippet |
15:53:31 | FromGitter | <iffy> krux02: 7719 or 8531? |
15:54:46 | leorize | kaushalmodi: have you checked if `COMP_CTX_free` exists in `libcrypto.a`? |
15:55:05 | FromGitter | <iffy> 7719 |
15:55:37 | FromGitter | <kaushalmodi> let me grep |
15:56:10 | FromGitter | <kaushalmodi> that's in include file |
15:56:12 | FromGitter | <kaushalmodi> ```1.1.1/include/openssl/comp.h ⏎ 29:void COMP_CTX_free(COMP_CTX *ctx);``` [https://gitter.im/nim-lang/Nim?at=5bbf729c600c5f64238fe8ef] |
15:56:28 | FromGitter | <kaushalmodi> and I am adding `switch("passC", "-I" & sslIncludeDir) ` |
15:56:54 | leorize | no, check for it in the archive |
15:56:59 | leorize | use `nm libcrypto.a | grep ...` |
15:57:16 | FromGitter | <kaushalmodi> TIL about `nm`.. trying it out |
15:57:55 | FromGitter | <kaushalmodi> seems to be there: `00000000000000d0 T COMP_CTX_free` |
15:58:26 | FromGitter | <kaushalmodi> if you are on a GNU/Linux system and have musl installed, you can try it out |
15:58:31 | leorize | can you make Nim prints out the command it runs? |
15:58:34 | FromGitter | <kaushalmodi> i.e. cloning the repo |
15:58:45 | FromGitter | <kaushalmodi> sure, one min |
15:59:24 | FromGitter | <kaushalmodi> wait, I don't know how, if you meant expanding the pass\* switches |
15:59:52 | FromGitter | <iffy> @mratsim After adding this to your `replaceNodes` proc it works! ⏎ ⏎ ```of nnkOpenSymChoice: ⏎ return inspect(node[0])``` [https://gitter.im/nim-lang/Nim?at=5bbf7378600c5f64238ff38e] |
16:00:13 | leorize | kaushalmodi: like making Nim prints out the command it uses in `Link: ` |
16:00:20 | FromGitter | <iffy> I don't really know what I'm doing, though (who knows if choosing the first node is always the right thing to do) |
16:01:16 | FromGitter | <kaushalmodi> leorize: sorry, I am at loss there.. let me see if increasing verbosity prints those |
16:01:46 | FromGitter | <mratsim> @iffy you’re not choosing actually, the compiler will redo the symbol resolution pass |
16:02:31 | FromGitter | <iffy> I wish I knew enough about compilers to know what that meant :) My C experience is years ago |
16:02:39 | leorize | kaushalmodi: hang on, I'm testing your `config.nims` here |
16:02:44 | leorize | this might take awhile... |
16:03:22 | FromGitter | <mratsim> @iffy you have “identifier” —> “existing symbol” —> “overloading resolution” —> “calling the correct proc" |
16:03:32 | FromGitter | <mratsim> OpenSymChoice is step 2 |
16:03:38 | FromGitter | <mratsim> replace nodes reverts to step 1 |
16:03:56 | FromGitter | <iffy> oh, that makes sense |
16:04:02 | FromGitter | <iffy> each of those things is operating on the AST, right? |
16:04:08 | FromGitter | <mratsim> yes |
16:04:21 | FromGitter | <iffy> okay, that's a very clear explanation; thank you! |
16:05:00 | FromGitter | <kaushalmodi> leorize: may be this error helps? https://ptpb.pw/49jV/text |
16:05:04 | FromGitter | <kaushalmodi> thanks for testing |
16:05:28 | FromGitter | <kaushalmodi> leorize: clone the repo, checkout ssl branch, run `nim musl -d:ssl src/hello_musl_ssl.nim` |
16:05:52 | leorize | doing it atm, but openssl build is kinda slow |
16:06:19 | FromGitter | <kaushalmodi> musl task will build automatically |
16:06:23 | FromGitter | <kaushalmodi> takes about a min or 2 |
16:06:23 | * | SenasOzys quit (Ping timeout: 276 seconds) |
16:06:36 | leorize | depends on what machine you're building on |
16:06:56 | FromGitter | <kaushalmodi> I am in no hurry. I am glad you opted to help out |
16:08:01 | FromGitter | <stvnfx> does anyone have a nimble task/command that they use to package a mac .app folder? |
16:09:24 | FromGitter | <mratsim> you probably can reuse how people package C/C++ with xcode cli tools :? |
16:09:35 | FromGitter | <mratsim> or compile to obj-C :P |
16:09:38 | leorize | kaushalmodi: `async.c:(.text+0x36): undefined reference to `setcontext'` |
16:09:42 | leorize | that's from libcrypto |
16:10:02 | leorize | setcontext should be provided by the libc |
16:10:09 | leorize | but musl might have got rid of them |
16:10:44 | FromGitter | <stvnfx> @mratsim yes very true, just wondering if anyone uses something they added to their nimble builds :) |
16:11:12 | leorize | kaushalmodi: https://www.openwall.com/lists/musl/2016/02/04/5 |
16:12:12 | FromGitter | <kaushalmodi> leorize: Thanks for the investigation. So musl + ssl seems like a no-go :( |
16:12:18 | leorize | not really |
16:12:24 | leorize | you just need to build openssl correctly |
16:12:28 | * | Trustable joined #nim |
16:12:54 | FromGitter | <kaushalmodi> i.e. build ssl using gcc and then the nim bin using musl-gcc? |
16:13:37 | leorize | no of course |
16:14:17 | leorize | I'll take a look at this |
16:14:50 | * | SenasOzys joined #nim |
16:14:58 | FromGitter | <kaushalmodi> thanks, I am really at the edge of mindless hacks that I can do with this without understanding that root cause |
16:20:47 | * | darithorn joined #nim |
16:24:03 | leorize | kaushalmodi: first thing first: move `-lcrypto` to after `-lssl` |
16:24:44 | leorize | second thing: use http://www.libressl.org/index.html |
16:24:54 | leorize | since it's saner and works |
16:25:18 | * | hdias joined #nim |
16:26:09 | * | hdias quit (Client Quit) |
16:26:20 | FromGitter | <kaushalmodi> leorize: thanks, and the build command stays the same? |
16:26:28 | leorize | yep |
16:26:34 | FromGitter | <kaushalmodi> ` sslConfigureCmd = ["./Configure", sslSeedConfigOsCompiler, "no-shared", "no-zlib", "-fPIC", "--prefix=" & sslInstallDir]` |
16:26:37 | leorize | actually not |
16:26:45 | FromGitter | <kaushalmodi> will look at INSTALL |
16:26:47 | leorize | it uses `autoconf` so it's more friendly |
16:27:02 | leorize | exactly like pcre |
16:27:15 | * | rokups joined #nim |
16:28:18 | leorize | kaushalmodi: `sslConfigureCmd = ["./configure", "--prefix=" & sslInstallDir, "--disable-shared"]` |
16:28:23 | leorize | simple as that |
16:29:10 | leorize | also, you might want to parallelize your `make` invocation |
16:29:26 | leorize | use `make -j<number of processor cores>` |
16:31:29 | * | zama_ joined #nim |
16:32:00 | FromGitter | <kaushalmodi> thanks! trying it out |
16:34:03 | leorize | small tips: |
16:34:13 | leorize | build only the components that you use |
16:34:15 | leorize | like this |
16:34:21 | leorize | `make -C crypto` |
16:34:25 | leorize | `make -C ssl` |
16:34:29 | * | zama quit (Remote host closed the connection) |
16:34:33 | * | zama_ is now known as zama |
16:34:56 | leorize | then install them with `make -C crypto install` |
16:35:01 | FromGitter | <kaushalmodi> ok, trying that once I see the current attempt work |
16:37:47 | * | craigger joined #nim |
16:38:27 | * | craigger_ quit (Ping timeout: 250 seconds) |
16:39:03 | FromGitter | <kaushalmodi> leorize: I am getting a different error this time: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf7ca7ae7be940163d038a] |
16:39:34 | * | Vladar quit (Remote host closed the connection) |
16:40:04 | leorize | congrats, you've built libressl with glibc instead of musl |
16:40:28 | leorize | have you set `CC=musl-gcc` before running `./configure`? |
16:40:53 | FromGitter | <kaushalmodi> :facepalm: |
16:41:28 | leorize | speaking of which, your pcre might have been built with glibc instead |
16:41:33 | leorize | also openssl... |
16:42:28 | FromGitter | <arnetheduck> haha, cross compiling is always such a PITA.. I used to think it was a viable solution in the past, but I've started warming to the idea that `chroots` or `dockers` are much easier, in terms of getting things right.. there are so many small details needed to avoid leaks between host and target that it becomes an almost inhuman task |
16:42:29 | FromGitter | <kaushalmodi> pcre build was fine.. I was like I am not compiling until configure finishes.. so just let me move that setenv |
16:42:48 | FromGitter | <kaushalmodi> I did that move yest |
16:43:48 | leorize | confirmed that openssl were built with glibc, since you can't build openssl without patches on musl :P |
16:46:11 | FromGitter | <kaushalmodi> I don't know if I should pursue this further (could be some other stupid mistake): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf7e5382893a2f3bcb7471] |
16:46:40 | * | platoff joined #nim |
16:46:51 | leorize | have you moved `-lcrypto` to after `-lssl`? |
16:47:34 | leorize | this is because of `ld` dependency resolution rules |
16:47:42 | leorize | it loads libssl |
16:48:05 | leorize | then try to find required symbols from libraries loaded **after** it |
16:48:51 | FromGitter | <kaushalmodi> it compiles! but.. |
16:48:59 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf7efaef4afc4f28585050] |
16:49:06 | FromGitter | <kaushalmodi> 😆 |
16:49:31 | FromGitter | <kaushalmodi> such an informative error |
16:49:37 | leorize | clean the cache and everything |
16:51:52 | FromGitter | <kaushalmodi> got the same error.. but trying everything from scratch starting with the libressl download |
16:52:10 | FromGitter | <kaushalmodi> btw does it work for you locally? |
16:52:18 | * | elrood joined #nim |
16:52:25 | leorize | it does |
16:52:36 | FromGitter | <kaushalmodi> that's comforting at least :) |
16:52:57 | leorize | what kernel are you on? |
16:53:04 | FromGitter | <kaushalmodi> I have committed the latest config.nims to the ssl branch |
16:53:35 | FromGitter | <kaushalmodi> `uname -r`: 2.6.32-642.6.2.el6.x86_64 |
16:53:38 | FromGitter | <kaushalmodi> it's RHEL 6.8 .. |
16:54:12 | FromGitter | <xmonader> guys i got it to work |
16:54:36 | FromGitter | <kaushalmodi> leorize: same issue after clearing cache, rebuilding, etc. |
16:54:49 | FromGitter | <xmonader> ```code paste, see link``` ⏎ ⏎ I'm sure there's some useless flag here [https://gitter.im/nim-lang/Nim?at=5bbf8059bbdc0b2505243061] |
16:54:51 | FromGitter | <kaushalmodi> @xmonader awesome! looks like my machine is then to blame |
16:55:13 | leorize | I do know that libressl might SIGKILL if your system is too bad :P |
16:55:16 | FromGitter | <xmonader> i will go to my german course now and later will try to cleanly build against newer version from ssl |
16:55:36 | FromGitter | <kaushalmodi> leorize: Oh well, let me see how Travis fares |
16:56:03 | FromGitter | <xmonader> can you check if the flags makes sense @kaushalmodi ? @leorize? |
16:56:18 | leorize | no, sorry :) |
16:56:37 | leorize | `musl-gcc` already include those paths, so you may omit them |
16:56:38 | FromGitter | <xmonader> Also, my demo went fine and the project compiled `dynamically linked` and people were happy.. and have 20 issues in my backlog now |
16:56:56 | FromGitter | <xmonader> yeah i was trying to be more explicit about it :D |
16:57:14 | leorize | and that `--out` is actually passed to the program instead of the compiler |
16:57:29 | leorize | kaushalmodi: working here |
16:57:43 | leorize | your latest commit |
16:57:58 | * | aziz joined #nim |
16:59:36 | FromGitter | <kaushalmodi> leorize: thanks for confirming! |
16:59:48 | FromGitter | <kaushalmodi> waiting to see this work on Travis.. just pushed out that commit |
16:59:53 | leorize | if you still want to use openssl |
17:00:02 | leorize | pass `"no-async"` to the configure |
17:00:08 | leorize | that should take care of it |
17:02:56 | * | aziz quit (Ping timeout: 276 seconds) |
17:05:36 | * | craigger_ joined #nim |
17:05:58 | * | craigger_ quit (Read error: Connection reset by peer) |
17:06:20 | FromGitter | <alehander42> @iffy ah i haven't looked at breeze, but even if it's broken, it should be easy to fix for 0.19 |
17:06:57 | * | couven92 quit (Read error: Connection reset by peer) |
17:07:05 | FromGitter | <iffy> @alehander42 wait, didn't you write breeze? |
17:07:08 | * | craigger quit (Ping timeout: 245 seconds) |
17:07:35 | FromGitter | <alehander42> yes, I meant I haven't tested if it's compatible with newest versions of Nim |
17:08:09 | FromGitter | <iffy> oh, gotcha |
17:08:20 | * | craigger joined #nim |
17:09:06 | FromGitter | <alehander42> did your CLI params macro work out btw |
17:09:48 | FromGitter | <iffy> It's working out slowly :) My questions today were about that, too. |
17:10:16 | FromGitter | <bung87> if a cpp function return const pointer how to implement in nim? |
17:10:29 | FromGitter | <iffy> My first working version is going to be garbage, but it will work. Here's what I have so far: https://github.com/iffy/nim-argparse |
17:10:36 | leorize | bung87: it returns a pointer |
17:11:40 | FromGitter | <bung87> what if a cpo function return ref |
17:12:24 | FromGitter | <bung87> cpp |
17:12:30 | leorize | I don't think a cpp function can return a `ref` |
17:12:53 | * | craigger_ joined #nim |
17:13:13 | FromGitter | <bung87> sorry I mean address |
17:13:20 | * | craigger quit (Ping timeout: 276 seconds) |
17:13:55 | leorize | address is just a pointer so... `ptr something` or `pointer` |
17:15:36 | * | craigger joined #nim |
17:15:54 | * | aziz joined #nim |
17:16:01 | FromGitter | <bung87> ah so that means I can actually make it work but loss many compiler check? |
17:16:11 | leorize | yes |
17:16:31 | leorize | `const pointer` means a pointer to a constant |
17:16:51 | FromGitter | <bung87> wow thanks !helpful |
17:17:33 | * | craigger_ quit (Ping timeout: 245 seconds) |
17:18:15 | * | aziz quit (Client Quit) |
17:19:19 | FromGitter | <kaushalmodi> leorize: building openssl, this time correctly using musl-gcc, showed me another issue |
17:19:20 | * | craigger quit (Read error: Connection reset by peer) |
17:19:26 | FromGitter | <kaushalmodi> this is a never ending rabbit hole |
17:19:37 | FromGitter | <kaushalmodi> workaround: https://github.com/openssl/openssl/issues/7207#issuecomment-420814524 |
17:19:39 | leorize | have you passed `no-async` to configure? |
17:19:44 | FromGitter | <kaushalmodi> yes |
17:20:04 | FromGitter | <kaushalmodi> this time, I got "missing linux/mman.h" |
17:20:21 | FromGitter | <kaushalmodi> .. and travis build fails while building libressl |
17:20:29 | leorize | confirmed libressl is saner |
17:20:36 | * | craigger joined #nim |
17:20:38 | FromGitter | <kaushalmodi> https://travis-ci.org/kaushalmodi/hello_musl/builds/440247816#L1414 |
17:20:43 | FromGitter | <kaushalmodi> said too soon :P |
17:21:19 | FromGitter | <kaushalmodi> it worked!!!!!!!!!!!!!!!!!!!!!!! |
17:21:31 | FromGitter | <kaushalmodi> openssl with that insecure memory workaround |
17:21:34 | FromGitter | <kaushalmodi> on my machine |
17:21:47 | leorize | ofc, given how old RHEL is... |
17:21:55 | leorize | I'm not surprised that libressl doesn't work |
17:22:05 | leorize | someone complained abt it once IIRC |
17:22:48 | * | craigger quit (Read error: Connection reset by peer) |
17:22:51 | FromGitter | <kaushalmodi> I cannot believe my eyes! |
17:22:55 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf86eff659e677729bf52b] |
17:23:14 | leorize | if you want to compile stuff with musl libc, probably you'll have better luck with running an actual cross-compiler |
17:23:28 | FromGitter | <kaushalmodi> leorize: I owe you your `(favBeverage or "beer")` if we ever meet |
17:23:28 | leorize | btw, `ldd` isn't the best way to check |
17:23:35 | * | craigger joined #nim |
17:23:49 | FromGitter | <kaushalmodi> then? |
17:23:59 | leorize | `file` |
17:24:03 | leorize | or `readelf -d` |
17:24:13 | leorize | `ldd` is a security hell |
17:24:34 | FromGitter | <kaushalmodi> `file` is nice, tells exactly what it is |
17:24:35 | FromGitter | <kaushalmodi> thanks |
17:25:07 | FromGitter | <kaushalmodi> you deserve so many thanks! There were great TIL moments today. |
17:25:13 | FromGitter | <kaushalmodi> all due to your patience |
17:25:54 | leorize | np :) |
17:26:03 | * | craigger_ joined #nim |
17:28:27 | * | craigger quit (Ping timeout: 268 seconds) |
17:30:31 | * | craigger joined #nim |
17:30:31 | * | craigger_ quit (Ping timeout: 252 seconds) |
17:34:29 | * | nsf quit (Quit: WeeChat 2.2) |
17:39:44 | FromGitter | <kaushalmodi> leorize: If I may bother you one more time.. that build works locally but fails on Travis: https://travis-ci.org/kaushalmodi/hello_musl/builds/440264561#L1367 |
17:40:05 | FromGitter | <kaushalmodi> I'd have to guess `openSslSeedConfigOsCompiler = "linux-x86_64"` doesn't apply for openssl builds on Travis? |
17:41:13 | FromGitter | <kaushalmodi> may be it's as simple as this: https://github.com/mirage/mirage-block-unix/issues/45#issuecomment-196892988 |
17:41:43 | FromGitter | <Varriount> Anyone know if -fPIC is a default option for GCC? |
17:42:02 | leorize | kaushalmodi: you need `linux-libc-dev` installed for Ubuntu |
17:42:07 | leorize | Varriount: it depends |
17:42:32 | leorize | but most of the time, no |
17:43:15 | leorize | unless the distributor enable `-pie` by default |
17:43:55 | FromGitter | <Varriount> Why not? Isn't position-independent code more memory efficient? |
17:44:12 | FromGitter | <Varriount> (At least for dynamic libraries) |
17:44:47 | leorize | because you don't build executable with `-fPIC` |
17:44:54 | leorize | unless, `-pie` is used |
17:46:12 | leorize | back in the time an executable won't run if you build it with `-fPIC` |
17:47:26 | * | opi_ quit (Ping timeout: 260 seconds) |
17:47:45 | * | opi_ joined #nim |
17:50:06 | * | Death916 quit (Ping timeout: 252 seconds) |
17:50:06 | * | EastByte quit (Ping timeout: 252 seconds) |
17:51:30 | * | Araq quit (Ping timeout: 264 seconds) |
17:52:29 | * | Death916_ joined #nim |
17:52:42 | * | EastByte joined #nim |
17:53:09 | * | Araq joined #nim |
17:59:17 | FromGitter | <kaushalmodi> leorize: that package didn't help, tried a linux-header pkg, that too didn't work. |
17:59:19 | FromGitter | <kaushalmodi> https://travis-ci.org/kaushalmodi/hello_musl/builds/440273887#L1364 |
18:00:17 | leorize | no idea how ubuntu does this kind of thing |
18:00:35 | FromGitter | <kaushalmodi> wrong line: https://travis-ci.org/kaushalmodi/hello_musl/builds/440273887#L1377 |
18:00:35 | leorize | your problem is that `gcc` ignored `/usr/include` as an system include path |
18:01:08 | FromGitter | <kaushalmodi> hmm.. so probably that needs to be added manually? you mean `musl-gcc`? |
18:01:32 | leorize | no, the `musl-gcc` _should_ already did it |
18:01:39 | leorize | adding it manually will make it worse |
18:01:58 | leorize | since glibc symbols will override musl ones |
18:02:27 | FromGitter | <kaushalmodi> ah, yes |
18:03:40 | leorize | I think I looked at this the wrong way |
18:06:30 | leorize | those headers aren't accesible with `musl-gcc` on my machine either |
18:07:14 | * | flaviu quit (Ping timeout: 250 seconds) |
18:07:54 | FromGitter | <kaushalmodi> hmm, I wonder how it got built on our local machines then |
18:07:58 | leorize | kaushalmodi: it doesn't compile on mine machine with openssl |
18:08:00 | * | TheLemonMan joined #nim |
18:08:07 | FromGitter | <kaushalmodi> ?! |
18:08:20 | leorize | I tested with libressl the last time, remember? |
18:08:34 | leorize | died at the same spot as travis |
18:08:37 | FromGitter | <kaushalmodi> so the old RHEL 6.8 is special in some way? |
18:09:21 | leorize | try this `echo '#include <linux/version.h>' | musl-gcc -x c -` |
18:09:30 | leorize | does it spits out any include error? |
18:09:37 | leorize | ignore the undef ref to main |
18:10:18 | FromGitter | <kaushalmodi> got: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf920a384492366121d859] |
18:10:43 | TheLemonMan | I just saw I now own parts of the compiler, yay |
18:10:43 | FromGitter | <kaushalmodi> musl version mismatch? |
18:10:57 | * | flaviu joined #nim |
18:11:01 | leorize | wow, your gcc actually able to find that file |
18:11:09 | leorize | try this `echo '#include <linux/version.h>' | musl-gcc -x c -v -` |
18:11:14 | narimiran | TheLemonMan: and, if you ask me, you should "own" more things ;) |
18:11:24 | leorize | kaushalmodi: I would like to know your include paths |
18:11:51 | TheLemonMan | narimiran, land, money and beer |
18:12:00 | narimiran | haha |
18:12:46 | FromGitter | <kaushalmodi> leorize: https://ptpb.pw/P9iZ/text |
18:13:31 | leorize | looks like you got away due to how RHEL people configure the compiler |
18:14:08 | narimiran | btw, TheLemonMan, where are you from? (my guess is italy) |
18:15:19 | TheLemonMan | yep, how did you find that out? |
18:15:55 | FromGitter | <kaushalmodi> leorize: so RHEL has some backup include paths to look into if the usual ones fail? |
18:16:16 | leorize | yes, completely breaking how gcc treats `-nostdinc` |
18:17:50 | leorize | kaushalmodi: here's a "hack" to make libressl work |
18:18:29 | leorize | add `#undef SYS__sysctl` to the beginning of `libressl-src/crypto/compat/getentropy_linux.c` |
18:18:58 | leorize | I've no idea where that symbol is actually defined, and how come Ubuntu's gcc define it |
18:19:08 | leorize | but that hack should work™ |
18:23:13 | narimiran | TheLemonMan: the way you wrote somewhere 1st, 2nd, etc. -> you used that small circle (like for degrees) |
18:24:08 | TheLemonMan | narimiran, hah it was WhiteDuke who wrote that test case |
18:25:31 | FromGitter | <kaushalmodi> leorize: you mean work on RHEL? The executable simply dies on my machine. |
18:26:02 | leorize | I mean it should make libressl work on travis |
18:26:38 | FromGitter | <kaushalmodi> ok, will try that next |
18:26:44 | leorize | f |
18:27:07 | leorize | for your RHEL, can you strap a debugger to it and see why was it killed? |
18:29:24 | FromGitter | <kaushalmodi> as you might have guessed, my gdb "skills" are almost non-existent as I am not a C coder: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf9683f659e677729c6fd3] |
18:29:56 | FromGitter | <kaushalmodi> and bt gives "no stack" |
18:30:10 | FromGitter | <kaushalmodi> *may be should run non-release build* |
18:30:16 | leorize | oh yea, cus your `config.nims` kindly stripped the entire executable... |
18:33:31 | FromGitter | <kaushalmodi> no luck without striping or any other optimization too |
18:33:36 | FromGitter | <kaushalmodi> "no stack" |
18:33:49 | leorize | `--debugger:native`? |
18:34:25 | FromGitter | <kaushalmodi> "gdb: unrecognized option '--debugger:native'" |
18:34:38 | FromGitter | <kaushalmodi> I think I should take a break today and allow you one too |
18:35:02 | leorize | :P |
18:49:56 | FromGitter | <kaushalmodi> ok, fwiw, that switch didn't work with nim |
18:50:35 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbf9b7bc7bf7c3662f4d542] |
19:04:15 | * | craigger_ joined #nim |
19:05:47 | * | craigger quit (Ping timeout: 250 seconds) |
19:06:28 | * | abm joined #nim |
19:08:09 | * | rnrwashere joined #nim |
19:08:29 | * | rnrwashere quit (Client Quit) |
19:08:52 | * | rnrwashere joined #nim |
19:11:26 | * | craigger_ quit (Ping timeout: 268 seconds) |
19:12:22 | * | craigger joined #nim |
19:21:48 | * | xylef joined #nim |
19:22:47 | FromDiscord | <An unconspicuous looking friend> what's the easiest way to check the return type of a function call? |
19:22:54 | FromDiscord | <An unconspicuous looking friend> some macro like: result_type(foo(int, string)) |
19:23:02 | FromDiscord | <An unconspicuous looking friend> where you don't need to put in the actual values |
19:23:11 | FromDiscord | <An unconspicuous looking friend> just the types |
19:24:16 | FromGitter | <kaushalmodi> leorize: I forgot to implement the hack you suggested for libressl on travis. But I am getting the same error after that too: https://travis-ci.org/kaushalmodi/hello_musl/builds/440311276#L1420, https://github.com/kaushalmodi/hello_musl/commit/399a2752f69f340c82afb054da4bd53fdec87591 |
19:26:35 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
19:29:59 | FromGitter | <zetashift> @An unconspicuous looking friend maybe `type.name`? https://nim-lang.org/docs/typetraits.html#name%2Ctypedesc |
19:32:00 | * | flaviu quit (Remote host closed the connection) |
19:32:26 | * | flaviu joined #nim |
19:36:46 | * | rokups quit (Quit: Connection closed for inactivity) |
19:48:28 | FromGitter | <stvnfx> is there a way to prevent nimble from adding —noNimblePath |
19:48:48 | FromGitter | <stvnfx> it seems to be adding it to my tasks when I use setCommand |
19:50:48 | FromGitter | <yyyc514> anyway to do a postfix operation like “unless” in ruby with macros? |
19:50:58 | FromDiscord | <An unconspicuous looking friend> zerashift: I need something like this to run: |
19:50:59 | FromDiscord | <An unconspicuous looking friend> func foo(a: int, b: string): float = discard |
19:50:59 | FromDiscord | <An unconspicuous looking friend> func foo(a: int, b: float): string = discard |
19:50:59 | FromDiscord | <An unconspicuous looking friend> |
19:50:59 | FromDiscord | <An unconspicuous looking friend> type T = type(foo(int, string)) |
19:51:08 | FromDiscord | <An unconspicuous looking friend> I suppose I'll just need to create a macro |
19:51:09 | FromGitter | <yyyc514> “kill(alien) unless alien.super() |
19:51:11 | FromDiscord | <An unconspicuous looking friend> shouldn't be too hard |
19:51:22 | dom96 | An unconspicuous looking friend: Don't paste code in here please |
19:51:37 | FromDiscord | <An unconspicuous looking friend> ok |
19:51:46 | FromGitter | <yyyc514> unless as an if like operator was pretty easy |
19:51:56 | dom96 | stvnfx: if you don't want --noNimblePath then execute `nim` with ``exec`` |
19:52:47 | FromGitter | <stvnfx> @dom96 does nimble add it automatically? I was looking at the nimble test files https://github.com/nim-lang/nimble/blob/master/tests/nimscript/nimscript.nimble as examples :) |
19:53:21 | UxerUospr | leorize: dumb question... What does RHEL stand for in this context? |
19:53:39 | FromGitter | <stvnfx> I really like the `—` template, very cool |
19:53:47 | dom96 | stvnfx: yes, that's the point of calling `nimble` :) |
19:53:57 | dom96 | Why do you not want --noNimblePath? |
19:56:18 | FromGitter | <stvnfx> Unless I am wrong but thats where the compiler is getting some of the imports I use. I could be completely wrong here. I just stumbled on it now |
19:56:45 | dom96 | Nimble reads your .nimble file and passes dependencies explicitly |
19:57:07 | dom96 | This ensures others can build your package |
19:57:28 | dom96 | if you just use `nim` then you can use any package you have installed |
19:57:41 | dom96 | which won't work for others if they haven't installed them |
19:58:47 | FromGitter | <stvnfx> ah ok I see, that makes sense, I have been doing a lot of static linking of small libs and trying to reduce the size of a app for work. just spending some time making the project build with nimble |
19:59:06 | FromGitter | <stvnfx> so mostly I have been using a make file |
19:59:33 | * | darithorn quit () |
20:01:52 | FromGitter | <stvnfx> Btw, your talk on youtube was amazing. I hope in the next month or two if time allows it to give a dev talk on it at work. right now we have nim in one app |
20:02:24 | FromDiscord | <deech> Any help with this appreciated, or even juat a pointer to the code in the compiler that does concept resolution. https://discordapp.com/channels/371759389889003530/371759389889003532/499939505487347715 |
20:03:11 | FromGitter | <yyyc514> shorter way to write `result = result & rna©` ? |
20:03:20 | FromGitter | <yyyc514> hahaha, silly markdown |
20:03:31 | FromGitter | <kaushalmodi> `result.add(..)` |
20:03:41 | FromGitter | <yyyc514> ah &= works too |
20:03:54 | FromGitter | <kaushalmodi> I've seen `.add` to be more canonical |
20:08:26 | FromGitter | <yyyc514> thanks |
20:10:45 | * | vlad1777d_ joined #nim |
20:17:20 | * | hoijui_ quit (Quit: Leaving) |
20:22:51 | * | narimiran quit (Ping timeout: 252 seconds) |
20:26:08 | dom96 | stvnfx: Thanks! Glad you enjoyed it :) |
20:26:24 | * | Trustable quit (Remote host closed the connection) |
20:26:33 | shashlick | dom96: I think you missed my point on the nimble issue |
20:26:41 | dom96 | Oh? |
20:27:22 | shashlick | What you said works for installing the files but I still have the nimgen dependency issue that's been there since the beginning |
20:27:32 | shashlick | After install solved both |
20:31:43 | FromGitter | <yyyc514> "mgetOrPut - either way returning a value which can be modified” am I misunderstanding this? modifying the returend value doesn’t seem to update the table |
20:42:50 | FromGitter | <xmonader> @kaushalmodi why r u doing libressl? didn't openssl already works fine for you? |
20:43:20 | FromGitter | <xmonader> for me now i get ⏎ ⏎ ```ldd /tmp/dmdm 18:58:09 ⏎ not a dynamic executable``` [https://gitter.im/nim-lang/Nim?at=5bbfb5e8c7bf7c3662f5a4c4] |
20:43:37 | FromGitter | <kaushalmodi> Doesn't work on Travis |
20:43:51 | FromGitter | <kaushalmodi> Neither does openssl work on Travis |
20:43:53 | FromGitter | <xmonader> it works on my archlinux |
20:44:13 | FromGitter | <kaushalmodi> Yeah some issue with Ubuntu on Travis |
20:44:16 | FromGitter | <xmonader> doesn't travis use a pretty old machines? |
20:44:22 | FromGitter | <xmonader> ah i see |
20:44:30 | FromDiscord | <An unconspicuous looking friend> Is type `None` a thing? |
20:44:33 | FromGitter | <xmonader> i would suggest u can boot docker in travis instead |
20:45:02 | FromDiscord | <An unconspicuous looking friend> because that's what I get when I do `type foo` if foo is an overloaded `proc` |
20:45:02 | FromGitter | <kaushalmodi> Can you provide a PR? |
20:45:28 | FromGitter | <xmonader> i can tinker around with it tonight yes |
20:45:45 | FromGitter | <xmonader> this would be amazing for people to have @kaushalmodi ! |
20:46:09 | FromGitter | <kaushalmodi> See the latest Travis logs, I'm stuck with if_alg.h not found |
20:46:29 | FromGitter | <kaushalmodi> It was already a pain to get the version.h found |
20:46:45 | * | rnrwashere quit (Remote host closed the connection) |
20:47:16 | dom96 | shashlick: yes, so if it solved both there is no other problem, right? |
20:47:21 | dom96 | What am I missing? |
20:49:05 | * | rnrwashere joined #nim |
20:51:59 | FromGitter | <yyyc514> "mgetOrPut - either way returning a value which can be modified” am I misunderstanding this? modifying the returend value doesn’t seem to update the table |
20:58:42 | FromGitter | <dom96> Oooh https://twitter.com/travisci/status/1050475566770589697?s=19 |
21:01:27 | * | craigger_ joined #nim |
21:02:27 | * | craigger quit (Ping timeout: 252 seconds) |
21:03:12 | * | SenasOzys__ joined #nim |
21:03:42 | shashlick | dom96: I thought you said `after install` was a workaround and it wasn't recommended |
21:04:39 | * | SenasOzys quit (Ping timeout: 252 seconds) |
21:05:14 | * | UxerUospr quit (Quit: Lost terminal) |
21:09:43 | FromGitter | <yyyc514> ok this syntax confuses me a little: `result.mgetOrPut(word, 0) += 1` |
21:09:44 | FromGitter | <yyyc514> but ti works |
21:09:54 | FromGitter | <yyyc514> is that the only way to get at the returned value’s reference? |
21:10:10 | * | darithorn joined #nim |
21:11:18 | * | zama quit (Ping timeout: 245 seconds) |
21:12:16 | * | zama joined #nim |
21:15:22 | * | flaviu quit (Remote host closed the connection) |
21:17:19 | * | flaviu joined #nim |
21:20:49 | Calinou | https://blog.travis-ci.com/2018-10-11-windows-early-release |
21:24:01 | federico3 | oh that's good |
21:24:30 | dom96 | shashlick: huh? What makes you think that? |
21:26:33 | FromGitter | <yyyc514> `v = addr result.mgetOrPut(word, 0)` |
21:26:39 | FromGitter | <yyyc514> just betting that isn’t idiomatic thought :) |
21:30:53 | FromGitter | <mratsim> use result\[word\].unsafeAddr |
21:31:16 | FromGitter | <yyyc514> or should i just write `result.mgetOrPut(word, 0) += 1` |
21:31:30 | FromGitter | <mratsim> if you want to increment in place yes |
21:32:06 | FromGitter | <yyyc514> does that work in C if you return a &ref ? |
21:32:44 | FromGitter | <yyyc514> just reads different than what i’m used to… where i’m from you’d pass an update proc or something to set/update the value :) |
21:33:12 | FromGitter | <mratsim> reusing your code you can do `v[] += 1` afterwards but that is definetely not idiomatic |
21:33:29 | FromGitter | <mratsim> `v[]` is the dereference operator |
21:33:32 | FromGitter | <yyyc514> yeah i figured that syntax out :) |
21:34:09 | * | Sembei joined #nim |
21:34:10 | FromGitter | <yyyc514> acutally i guess you can do that in C.. isn’t that how they write [] functions? return a ref to value? |
21:34:25 | FromGitter | <yyyc514> array[x] = 32; // array[x] being a &int |
21:50:39 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:57:02 | * | elrood quit (Quit: Leaving) |
21:58:47 | * | craigger joined #nim |
22:00:54 | * | craigger_ quit (Ping timeout: 252 seconds) |
22:01:34 | * | rnrwashere quit (Remote host closed the connection) |
22:07:10 | * | gmpreussner_ joined #nim |
22:07:43 | * | gmpreussner quit (Ping timeout: 252 seconds) |
22:10:27 | * | rnrwashere joined #nim |
22:18:22 | * | rnrwashere quit (Remote host closed the connection) |
22:19:01 | FromGitter | <zacharycarter> does anyone use kakoune with Nim? |
22:26:43 | * | rnrwashere joined #nim |
22:30:57 | * | craigger_ joined #nim |
22:31:23 | FromGitter | <yyyc514> do we have anything like ruby’s IOString? |
22:31:55 | * | craigger quit (Ping timeout: 252 seconds) |
22:35:01 | FromGitter | <citycide> in a macro, how would I constrain a typedesc parameter to one of 2 types, and then get the name of whichever type is given? |
22:38:39 | FromGitter | <mratsim> @citycide `macro foo(T: typedesc[int or uint]): untyped = echo $T; result = newStmtList()` |
22:39:11 | FromGitter | <mratsim> that’s assuming the macro is called directly with idents |
22:39:36 | FromGitter | <mratsim> if it’s called with foo(type x) you will have to use getType |
22:39:58 | FromGitter | <mratsim> @yyyc514 you would have to explain what Ruby’s IOString are |
22:42:30 | FromGitter | <citycide> I'm aware of `typetraits.name` but if I constrain like `typedesc[A or B]` I just get `A or B` when I want to know which of the two it was |
22:42:37 | FromGitter | <mratsim> going to sleep though |
22:43:09 | FromGitter | <mratsim> @citycide you should get the actual type with `getTypeInst` at the very least |
22:43:25 | FromGitter | <mratsim> it will give you the instantiated type |
22:43:50 | FromGitter | <mratsim> if it’s generic it will do it after generic symbol resolution |
22:43:59 | FromGitter | <citycide> @mratsim thanks, let me try it out |
22:45:35 | FromGitter | <mratsim> For example: https://github.com/status-im/nim-stint/blob/master/stint/private/datatypes.nim#L172-L175 |
22:45:54 | FromGitter | <mratsim> the input is “typed” but it would work with generics as well |
22:48:20 | * | xet7 quit (Quit: Leaving) |
22:51:07 | * | krux02 quit (Remote host closed the connection) |
22:53:16 | * | rnrwashere quit (Remote host closed the connection) |
22:53:24 | FromGitter | <yyyc514> what’s the new syntax for `for x in 0 .. <i:`? |
22:55:59 | FromGitter | <kaushalmodi> `for x in 0 ..< i:` |
22:56:09 | FromGitter | <kaushalmodi> See the change in space |
22:57:02 | FromGitter | <citycide> @mratsim nice thanks, ended up being `getTypeInst(typ)[1].strVal.toLowerAscii` |
22:57:34 | FromGitter | <yyyc514> @kaushalmodi NICE thanks |
22:57:42 | * | rnrwashere joined #nim |
22:57:45 | FromGitter | <kaushalmodi> https://scripter.co/notes/nim/#space-around-dot-dot |
22:57:47 | FromGitter | <citycide> well, the `toLowerAscii` is specific to my use case |
23:00:13 | * | rnrwashere quit (Remote host closed the connection) |
23:00:50 | * | rnrwashere joined #nim |
23:14:39 | * | seni quit (Quit: Leaving) |
23:28:37 | shashlick | dom96: here you commented about the `after install` and `before uninstall` method |
23:28:38 | shashlick | https://github.com/nim-lang/nimble/issues/549#issuecomment-428757516 |
23:33:47 | * | rnrwashere quit (Remote host closed the connection) |
23:34:07 | * | rnrwashere joined #nim |
23:44:22 | * | craigger joined #nim |
23:45:24 | * | craigger_ quit (Ping timeout: 252 seconds) |
23:45:25 | * | stefanos82 quit (Quit: Quitting for now...) |
23:47:40 | * | craigger_ joined #nim |
23:48:55 | * | craigger quit (Ping timeout: 252 seconds) |