00:01:16 | * | donlzx joined #nim |
00:03:10 | * | find0x90 quit (Quit: find0x90) |
00:09:08 | FromDiscord | <Epictek> I have a stupid question about Jester, how the hell to I get the unprocessed query string? translating the query back in to a string seems like a waste of time if I can just use the original string. |
00:22:36 | * | dddddd quit (Remote host closed the connection) |
00:31:24 | * | thomasross quit (Remote host closed the connection) |
00:31:45 | * | thomasross joined #nim |
00:35:31 | * | smt quit (Read error: Connection reset by peer) |
00:35:42 | * | smt joined #nim |
00:46:34 | * | find0x90 joined #nim |
01:06:45 | * | find0x90 quit (Quit: find0x90) |
01:07:08 | * | stefanos82 quit (Quit: Quitting for now...) |
01:09:39 | * | krux02 quit (Remote host closed the connection) |
01:16:26 | * | rosshadden quit (Quit: WeeChat 2.1) |
02:08:44 | FromGitter | <Quelklef> Any Kakoune users here that want to help me on a quest to make the kakoune nim syntax highlighting actually usable? |
02:11:26 | FromDiscord | <2vg> Epictek: https://github.com/dom96/jester/blob/master/readme.markdown#request-object |
02:11:42 | FromDiscord | <2vg> maybe, request.path? |
02:59:10 | * | zahary quit (Quit: Connection closed for inactivity) |
03:06:28 | * | smt quit (Ping timeout: 244 seconds) |
03:25:42 | cornfeedhobo | searching around leaves me wondering ... is there a resolution to how to setup a workspace / vendor / virtualenv like configuration with nimble and packages? |
03:50:26 | shashlick | You can use choosenim |
03:50:50 | shashlick | Helps setup multiple versions of Nim and switch quickly |
04:14:29 | * | NamPNQ joined #nim |
04:21:04 | * | lompik joined #nim |
04:22:41 | * | NamPNQ quit (Remote host closed the connection) |
04:35:47 | * | endragor joined #nim |
04:54:23 | cornfeedhobo | well, what if my concern is not versions, which imho everyone should just adopt the popular *env suite, I'm talking more about isolating project dependencies. similar to golang's issue, which is why i use govendor |
04:55:56 | shashlick | you could use `--nimbleDir:dirname` under nimble to install in a different path |
04:56:46 | shashlick | and then use `--NimblePath:PATH` for nim to look in this different directory |
04:59:24 | cornfeedhobo | s/suite/approach/ |
05:00:03 | cornfeedhobo | okay i did see some mention of that, but nothing seemed to say that was the only approach. thanks |
05:07:29 | * | nsf joined #nim |
05:09:45 | shashlick | i'm not sure if it works but you could potentially have a per-project nimcache with a nim.cfg using the above flag |
05:10:03 | shashlick | only nim would pick it up though, you'd still have to pass the flag to nimble to install locally |
05:10:58 | * | miran joined #nim |
05:17:09 | * | rockcavera quit (Remote host closed the connection) |
05:19:47 | FromGitter | <data-man> @tim-st: I added the procs for strings, although I'm against storing binary data in strings. ;-) |
05:26:57 | CodeVance | nimble is basically a virtualenv if you set its directory |
05:45:39 | * | rockcavera joined #nim |
06:09:44 | * | miran quit (Ping timeout: 260 seconds) |
07:14:19 | * | leorize quit (Quit: WeeChat 2.1) |
07:33:09 | * | ehmry_ is now known as ehmry |
07:34:51 | * | yglukhov[i] quit (Remote host closed the connection) |
07:35:05 | * | yglukhov[i] joined #nim |
07:36:30 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
07:37:05 | * | yglukhov[i] joined #nim |
07:41:57 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
07:42:09 | * | PMunch joined #nim |
07:42:30 | * | yglukhov[i] joined #nim |
08:01:16 | FromGitter | <tim-st> @data-man perfect, thanks! |
08:21:33 | Araq | "The go tool will now use the path from which it was invoked to attempt to locate the root of the Go install tree. This means that if the entire Go installation is moved to a new location, the go tool should continue to work as usual." |
08:22:13 | Araq | so Go now does what Nim always did. |
08:27:23 | FromGitter | <mratsim> @shashlick I don’t mind you changing clblast, but I need to see the proc exported. |
08:30:42 | FromGitter | <mratsim> @tim-st apart from stuff like access to LLVM intrinsics and maybe concurrency (even then a GC can actually increase performance) I don’t see any area where the perf you can achieve in Rust cannot be achieved in Nim |
08:31:00 | * | rokups joined #nim |
08:31:57 | FromGitter | <tim-st> yes, this also was my impression |
08:32:24 | FromGitter | <tim-st> Araq: GOROOT=$HOME/go ; I think this is different from nim |
08:32:46 | FromGitter | <tim-st> it would be more similiar if nim would cache inside nimble folder |
08:36:51 | * | noonien joined #nim |
08:39:45 | FromGitter | <mratsim> I prefer if nim cache it in .cache |
08:39:59 | FromGitter | <mratsim> I know I can delete .cache without issue |
08:40:19 | FromGitter | <mratsim> I don’t want to have to inspect .nimble to make sure I don’t delete something I needed |
08:43:13 | FromGitter | <tim-st> @mratsim maybe an extra folder inside nimble with the same structure? you could delete it without problems |
08:44:58 | FromGitter | <mratsim> just use ~/.cache/nim{,ble} |
08:48:03 | FromGitter | <tim-st> so you would prefer a shared path in $HOME too? |
08:50:57 | FromGitter | <mratsim> temporary files should be in normal temporary paths so that it’s picked up by automated cleanup scripts and tools |
08:52:02 | FromGitter | <mratsim> When I need a couple GBs, I don’t want to think “mmm where does Python puts temp files again, what about Nim, what about Rust, what about Firefox …" |
08:52:57 | FromGitter | <tim-st> sure, I just thought that's important to have the best possible way of caching especially if your data has this size |
08:58:42 | PMunch | Put it in /tmp/nimcache-{uid} |
09:03:48 | Araq | again, /tmp doesn't exist on Android |
09:04:08 | Araq | but I'll change it to $HOME/nimcache/project_flags |
09:04:35 | Araq | where flags distinguishes between release and debug builds |
09:04:38 | FromGitter | <mratsim> $HOME/.cache/nimcache/project_flags |
09:04:55 | Araq | is $HOME/.cache a thing? |
09:04:59 | FromGitter | <mratsim> it is |
09:05:33 | Araq | meh, I still need to look at the produced C code too often |
09:06:15 | FromGitter | <mratsim> I checked my .cache folder on OSX: ⏎ ⏎ drwxr-xr-x 4 username staff 128 26.10.2017 21:14 livestreamer/ ⏎ drwxr-xr-x 3 username staff 96 27.03.2016 15:29 youtube-dl/ [https://gitter.im/nim-lang/Nim?at=5b45c887bd92d80782a63c66] |
09:08:24 | FromGitter | <mratsim> I do check the produced C code a lot as well but since it’s “ignored” it doesn’t appear in VScode anyway I still have to have a separate terminal window or file browser to open the file. |
09:08:43 | FromGitter | <mratsim> ignored — gitignored |
09:10:17 | PMunch | Please don't put it directly in home |
09:10:22 | PMunch | .cache is better |
09:11:56 | Araq | mratsim: but if in HOME it doesn't have to be .gitignored at all |
09:12:06 | FromGitter | <mratsim> yes |
09:12:16 | Araq | and you can just add this directory to your VS Code setup |
09:12:43 | FromGitter | <mratsim> my point is that whether it’s in home or in gitignored, I need an extra file browser/terminal window to access it. |
09:12:49 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
09:13:15 | FromGitter | <mratsim> so even though I like to check the C file, the workflow to check them out is the same |
09:13:22 | * | yglukhov[i] joined #nim |
09:16:24 | FromGitter | <tim-st> The way in $HOME is good (never heard of .cache/ but dont care of another subfolder) but still doesnt solve the problem of same named files in project if my assumption is correct |
09:17:10 | FromGitter | <tim-st> but I havent tested it yet, maybe it works |
09:20:37 | * | TheLemonMan joined #nim |
09:21:53 | TheLemonMan | Araq, following https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html is good practice (at least on the linux/bsd side of the moon) |
09:22:00 | FromGitter | <mratsim> requiring not to use the same name in a single project is reasonable |
09:22:27 | FromGitter | <mratsim> $XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used. |
09:23:00 | FromGitter | <tim-st> but these files come from different folder like main.nim or test.nim |
09:23:20 | FromGitter | <tim-st> this is just an assumption, I had from a look at my wrapped c sources |
09:23:37 | FromGitter | <tim-st> they have plain name without folder strucutre or prefix filename structure |
09:24:16 | Araq | TheLemonMan: yeah ok. |
09:24:46 | Araq | I might remove the nimcache/ part then, I like flat |
09:24:51 | FromGitter | <tim-st> some have, some dont, and those which have are likely not sufficient |
09:25:11 | FromGitter | <tim-st> (https://files.gitter.im/nim-lang/Nim/HrEG/folder.PNG) |
09:26:10 | * | ng0 joined #nim |
09:27:32 | TheLemonMan | Araq, hm? I hope you don't plan on throwing all the .c and .o in $XDG_CACHE_HOME and not in a nim/ subdirectory |
09:27:58 | FromGitter | <tim-st> even a nim subdirectoy is not enough from what I assume |
09:28:07 | FromGitter | <tim-st> I think golangs way is the only safe one |
09:28:32 | Araq | I'm thinking of .cache/nim_$project_$flags |
09:28:53 | FromGitter | <tim-st> that's similar to go, but doesnt include arch of os |
09:29:07 | FromGitter | <tim-st> ah, in flags maybe |
09:29:08 | * | stefanos82 joined #nim |
09:29:11 | Araq | nimcache/ doesn't buy us much, it's obviously a "cache" and it needs to be project specific anyway |
09:29:31 | stefanos82 | greetings folks |
09:29:39 | Araq | I mean it's obviously a cache since it's in .cache |
09:29:59 | FromGitter | <tim-st> but when it's again for each project a cache than that probably reuses to few things |
09:30:08 | TheLemonMan | redundancy is always good, isn't it? |
09:30:25 | FromGitter | <tim-st> seriously, the golang version is the best I'm pretty sure |
09:31:28 | FromGitter | <mratsim> department of redundancy department :P |
09:31:32 | stefanos82 | Araq: what a coincidence. Last night I was working on a demo project and have noticed I had two separate nimcaches; one for src and one for tests. Is it difficult to have one central nimcache that could contain subdirectories that resemble the project's structure? that is, nimcache/{src,tests,something-else} ? |
09:31:59 | FromGitter | <tim-st> that's what golang does |
09:32:11 | FromGitter | <mratsim> I always compile from the project root and pass —nimcache:nimcache |
09:32:48 | Araq | TheLemonMan: no. :-) |
09:33:00 | FromGitter | <mratsim> $ nim c -r --nimcache:nimcache -o:build/tests tests/foo.nim |
09:33:18 | FromGitter | <mratsim> then binaries are always in build and nimcache is always at the same place |
09:33:25 | Araq | but I'm probably the biggest hater of directories... |
09:33:46 | stefanos82 | yes, but this way it will place all generated files under nimcache |
09:34:02 | FromGitter | <tim-st> @mratsim but this will recompile too much things |
09:34:05 | stefanos82 | what happens when you have two different directories that contain the same module name? |
09:34:22 | FromGitter | <mratsim> Nim doesn’t allow that |
09:34:25 | FromGitter | <tim-st> exactly, then there is unneeded recompilation |
09:34:43 | FromGitter | <mratsim> @tim-st why? it only compiles things that changed |
09:35:14 | FromGitter | <tim-st> I meant when they having the same name, and I have already tested it and it doesnt work |
09:35:22 | FromGitter | <tim-st> It even gave the wrong result |
09:35:31 | FromGitter | <mratsim> but module with the same name are not allowed |
09:35:32 | FromGitter | <tim-st> then people told me not to use nimcache for now |
09:36:03 | FromGitter | <mratsim> within a single project you can’t have 3 files called “utils” for example |
09:36:12 | stefanos82 | personally I have noticed a peculiar behavior with compilation. If I have a module that needs to get removed from my code and re-run "nim c ...", it will throw an error, like 95% of my total attempts, which forces me to delete the whole nimcache and attempt again to recompile. |
09:36:23 | FromGitter | <tim-st> do you have an example where it's not allowed in nim and at the same time allowed in golang? |
09:36:25 | TheLemonMan | Araq, speaking of nimcache, can this https://github.com/nim-lang/Nim/blob/32441d01e597ff0c94ca037d10a0d2674d4012b3/compiler/extccomp.nim#L436,L439 be enabled? |
09:36:52 | FromGitter | <mratsim> I don’t use go, I don’t have suchh example. |
09:37:22 | FromGitter | <mratsim> @stefanos, is it a linker error? |
09:37:39 | FromGitter | <mratsim> The only error I get with nimcache is if I compile to C++ and then I compile to C |
09:38:32 | FromGitter | <tim-st> does anyone can name serious downside of the cache golang uses? |
09:38:32 | FromGitter | <tim-st> I dont see a single one |
09:38:32 | Araq | TheLemonMan: huh? isn't that in devel... oh |
09:38:32 | stefanos82 | I don't really remember the exact error @mratsim, but it throws a couple of lines with numbers and then the red error message |
09:38:32 | Araq | it's still in my branch that I can't merge. so sure, go ahead |
09:38:32 | FromGitter | <mratsim> yeah that’s a linker issue |
09:39:26 | stefanos82 | in other words @mratsim it attempts to link the already generated C files to parts of code that do not exist anymore, something like that? |
09:40:48 | TheLemonMan | what's the usual workflow for developing a library using nimble? I mean, `nimble build` doesn't work since it's not a bin... |
09:41:08 | FromGitter | <mratsim> mmmmh, it’s been a while since I wrote wrappers, maybe you have include issue, like a nim filed included a necessary header, but you don’t compile it in anymore or something. |
09:41:09 | stefanos82 | nimble init? |
09:41:31 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
09:41:59 | FromGitter | <mratsim> start writing a `nimble test` |
09:42:22 | FromGitter | <mratsim> write code, a `nimble test` away |
09:42:30 | TheLemonMan | gotcha, gotta move stuff into the test dirs |
09:43:35 | * | dddddd joined #nim |
09:43:48 | stefanos82 | @mratsim: for instance, I have a generic project that I use for general purposes, thus the name. Right now I have the following generated files: generic.c stdlib_algorithm.c stdlib_cpuinfo.c stdlib_cpuload.c stdlib_linux.c stdlib_locks.c stdlib_math.c stdlib_os.c stdlib_ospaths.c stdlib_parseutils.c stdlib_pcre.c stdlib_posix.c stdlib_re.c stdlib_rtarrays.c stdlib_sharedlist.c stdlib_strutils.c stdlib_system.c stdlib_threadpool.c |
09:43:48 | stefanos82 | stdlib_times.c |
09:44:01 | stefanos82 | guess what modules I have imported in it: times and os |
09:44:17 | stefanos82 | why do I have to retain those unnecessary C files? |
09:45:31 | FromGitter | <mratsim> they are needed by os and times |
09:45:48 | stefanos82 | all these? |
09:45:50 | FromGitter | <tim-st> but only if they arent compiled already to o-files ? |
09:45:51 | stefanos82 | no way lol |
09:46:55 | FromGitter | <mratsim> https://nim-lang.org/docs/os.html ⏎ ⏎ > strutils, times, winlean, ospaths |
09:47:36 | FromGitter | <mratsim> ospaths uses posix cpuinfo and cpuload and linux I guess |
09:47:37 | stefanos82 | I removed nimcache and recompiled. it's only 10 files, not 19 |
09:48:38 | FromGitter | <mratsim> @tim-st, Nim reuses the .o if the imported procs from the module did not change (no new one or no new unused one) |
09:49:50 | FromGitter | <tim-st> and does it find out if they change? |
09:50:03 | FromGitter | <mratsim> the file is hashed |
09:50:10 | FromGitter | <tim-st> against what? |
09:50:20 | FromGitter | <tim-st> c source or nim source |
09:50:29 | FromGitter | <mratsim> C source |
09:50:41 | FromGitter | <tim-st> so the s souce has to be compile first by nim? |
09:51:12 | FromGitter | <mratsim> the C file can change if you used foo\float\ (x) vs foo\int\ (y) |
09:51:12 | FromGitter | <tim-st> that's obviously not the best way of caching regarding performance |
09:51:45 | FromGitter | <mratsim> Araq is working on incremental compilation to solve this |
09:52:06 | FromGitter | <tim-st> also is it possible that two different x.o file are in the cache folder? |
09:52:13 | FromGitter | <tim-st> from different folders? |
09:52:55 | FromGitter | <mratsim> no |
09:53:08 | FromGitter | <tim-st> in the screenshot I posted above one can see that the c files wrapped doesnt have a prefix, if they have the same name in another wrapper I use what happens? |
09:53:21 | FromGitter | <tim-st> e.g. mdb.o is there |
09:53:22 | FromGitter | <mratsim> currently file are renamed with the parent folder name or the git project name as prefix |
09:53:40 | FromGitter | <tim-st> no it's just called mdb.o nothing more |
09:53:52 | Araq | tim-st: you can also use the .compile pragma with patterns to tell Nim which .o file to produce |
09:54:21 | FromGitter | <tim-st> yes, I used the compile pragma and it works |
09:54:24 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/sbQD/2018-07-11_11-54-16.png) |
09:54:38 | FromGitter | <mratsim> @tim-st ^ C lib imported from other project are properly prefixed |
09:54:43 | FromGitter | <tim-st> I'm just curious if this wont fail for bigger projects |
09:54:49 | FromGitter | <mratsim> rocksdb and secp256k1 are c lib |
09:55:05 | FromGitter | <tim-st> yes, the imported ones, but not the wrapped ones using compile pragma |
09:55:19 | FromGitter | <tim-st> also I doubt that these prefixes are sufficient long enough |
09:55:33 | FromGitter | <tim-st> because of this I suggested to use the golang way, this is bulletproof |
09:56:04 | FromGitter | <mratsim> You can make one package per wrapper or are you trying to have a single package as a collection of multiple wrappers? |
09:56:17 | Araq | hardly. on plenty of systems there is a MAX_PATH limit |
09:56:27 | FromGitter | <mratsim> you can RFC it on Github with your use cases so we can compare |
09:56:47 | FromGitter | <tim-st> yes, but golang would have this MAX_PATH limit too, and noone of there big userbase had problems I think |
09:56:51 | FromGitter | <mratsim> windows 256 char limit on path is silly ... |
09:57:10 | Araq | nothing is bulletproof about a Java-esce long.stuff.nested.until.the.universe.collapses |
09:57:35 | FromGitter | <tim-st> I just want to show that it's much more bulletproof than a prefix like stdlib_ |
09:57:44 | Araq | tim-st: I had that problem on Java projects with Windows CE. now what? |
09:57:44 | FromGitter | <mratsim> —> RFC |
09:58:01 | Araq | are you seriously suggesting Java is not used widely enough? |
09:58:32 | FromGitter | <tim-st> no, I just think this will be a problem in future, but we will see, for most projects of course the current way will work |
09:59:04 | FromGitter | <mratsim> I’ll probably be the first to complain :P |
09:59:22 | FromGitter | <tim-st> yes, people with bigger source code |
10:00:16 | stefanos82 | thus, my original question about nimcache/{src,tests,...} |
10:00:49 | FromGitter | <mratsim> the file names within nimcache are orthogonal to the location of nimcache |
10:01:24 | stefanos82 | orthogonal or polygonal, the issue remains the same. there will be file collisions |
10:01:38 | FromGitter | <mratsim> having just “nimcache” works but I’d like to mode it to $XDG_HOME_CACHE (aka ~/.cache/) |
10:02:26 | FromGitter | <mratsim> @stefanos82, can you file a Github issue with a test case. |
10:02:42 | FromGitter | <mratsim> move* |
10:12:16 | stefanos82 | sure thing, I will do it now |
10:12:35 | stefanos82 | before I do it though, let me ask Araq something first mratsim |
10:12:56 | stefanos82 | Araq: when two files with the same name, do they generate a concatenate C file? |
10:13:00 | FromGitter | <mratsim> I’m not Araq’s gatekeeper :D |
10:13:19 | stefanos82 | you are a wizard Harry |
10:13:32 | * | Vladar joined #nim |
10:13:48 | Araq | concatenate C file? that's crazy talk |
10:13:59 | stefanos82 | well, that's what seems to happening right now lol |
10:14:19 | stefanos82 | I have created a demo project with the following directories: bin, src, misc, tests |
10:14:45 | stefanos82 | in src/ I have a demo.nim that greets you with echo("Hello from src/demo.nim") |
10:15:08 | stefanos82 | in misc/ I have a demo.nim that greets you with echo("Hello from misc/demo.nim") |
10:16:05 | stefanos82 | in src/ I have a demo.nims with switch("out", "bin/demo") and in misc/ I have a demo.nims with switch("out", "bin/misc-demo") |
10:16:36 | stefanos82 | also in src/ and misc/ I have two nim.cfg with --nimcache:nimcache |
10:17:01 | stefanos82 | all I get from nimcache is the following files: demo.c demo.json demo.o stdlib_system.c stdlib_system.o |
10:17:09 | stefanos82 | now the question is: which demo is which?! |
10:17:59 | Araq | what you compiled last overwrites the old stuff. |
10:20:12 | stefanos82 | OK, is there a way to compile both src/demo.nim and misc/demo.nim at the same time? |
10:25:22 | Araq | with some shell script sure, but you're then summoning the inherit limitations of a file system under concurrency |
10:25:43 | Araq | and that's not a Nim problem. |
10:26:48 | FromDiscord | <2vg> GC Warning comes out with boehmGC. |
10:26:48 | FromDiscord | <2vg> This is memory leak? |
10:26:48 | FromDiscord | <2vg> https://github.com/2vg/mofuw/issues/49 |
10:28:24 | stefanos82 | Araq: OK. Is there a way to retain the source path it comes from? That is, to get either a nimcache/src/demo.o or nimcache/src-demo.o? |
10:28:42 | stefanos82 | this way we wouldn't have any collision problem |
10:50:57 | * | skrylar quit (Ping timeout: 240 seconds) |
10:52:02 | * | yglukhov[i] quit () |
10:55:09 | FromGitter | <mratsim> Nim doesn’t allow the same filename within the same project |
10:55:26 | * | yglukhov[i] joined #nim |
10:55:30 | FromGitter | <mratsim> so there is no collision |
11:04:54 | TheLemonMan | hmm, what happened to the CI? is it stuck or something? |
11:08:44 | TheLemonMan | also, is this a bug? https://gist.github.com/LemonBoy/54e377c033f2a0f161f2f0c857827b68 |
11:09:04 | TheLemonMan | it works just fine if I remove the generic parameter [T] |
11:29:51 | FromGitter | <mratsim> yes it’s a bug, it’s because when you have generics, the semantic checks is done before macro/templates in certain situations |
11:30:05 | FromGitter | <mratsim> this is why {.this: self.} doesn’t work with generics |
11:31:33 | * | BitPuffin joined #nim |
11:31:40 | FromGitter | <mratsim> @TheLemonMan Cause: https://nim-lang.org/docs/manual.html#generics-symbol-lookup-in-generics Similar issue : https://github.com/nim-lang/Nim/issues/5053, https://github.com/nim-lang/Nim/issues/7632, https://github.com/mratsim/Arraymancer/issues/62 |
11:37:23 | * | dddddd quit (Ping timeout: 256 seconds) |
11:38:48 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
11:39:55 | * | krux02 joined #nim |
11:47:02 | endragor | Is there a way to get _Alignof operator behaviour in Nim (without using .emit)? https://en.cppreference.com/w/c/language/_Alignof |
11:47:49 | Yardanico | https://github.com/nim-lang/Nim/pull/5664 https://github.com/nim-lang/Nim/issues/5493 |
11:53:25 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
11:53:59 | * | yglukhov[i] joined #nim |
11:54:49 | FromGitter | <tim-st> when I have a proc open(... v: static[bool]) and I need to check v to decide which proc I use, can I do this with some easy way like making v constant in a global scope? |
11:54:57 | * | leorize joined #nim |
11:55:13 | FromGitter | <tim-st> because it's static? |
12:01:04 | * | dddddd joined #nim |
12:01:56 | FromGitter | <tim-st> or behaves the following var like a const one? |
12:01:58 | FromGitter | <tim-st> static: ⏎ var x = 0 |
12:03:40 | FromGitter | <mratsim> when v: callFoo() else: callBar() |
12:04:12 | FromGitter | <tim-st> yes, but v is in local scope, I need it in global scope |
12:04:34 | FromGitter | <tim-st> I could integrate it in all my objects, but then I needed to rewrite the code |
12:04:35 | FromGitter | <mratsim> var v {.compileTime.} = true |
12:04:43 | FromGitter | <mratsim> or const v = True |
12:04:47 | FromGitter | <mratsim> if it’s constant |
12:05:05 | FromGitter | <tim-st> it's static and only changed one time at compile time |
12:05:13 | FromGitter | <tim-st> has this the same performance like const? |
12:05:20 | FromGitter | <tim-st> I mean: var v {.compileTime.} = true |
12:05:44 | FromGitter | <mratsim> it has no runtime implication, the variable only exists at compile time |
12:06:05 | FromGitter | <tim-st> so it is a const that is editable at compile time? |
12:06:23 | FromGitter | <mratsim> yes |
12:06:36 | FromGitter | <tim-st> perfect, exactly what I need :D |
12:06:39 | FromGitter | <tim-st> thanks |
12:06:50 | FromGitter | <tim-st> and no downside at runtime? |
12:07:02 | FromGitter | <tim-st> if the performance is effected I would rewrite it |
12:07:14 | FromGitter | <mratsim> the variable doesn’t exist in the C code |
12:07:22 | FromGitter | <tim-st> perfect, very cool |
12:09:50 | FromGitter | <tim-st> yes, it works, that's extremely useful |
12:11:19 | FromGitter | <tim-st> hm, maybe it wont work, if the user calls open one time with true and once with false |
12:14:16 | FromGitter | <mratsim> Tell Araq then because he is still on the fence whether to keep it as it is now or revert to the previous static: v = foo() system. |
12:16:16 | FromGitter | <tim-st> I need to test it, the problem I guess is that it maybe uses the last state of the var so that when open was called with true and later with false also the first opened type get the procs for false |
12:20:09 | FromGitter | <tim-st> exactly the thing happened like I thought |
12:20:42 | FromGitter | <tim-st> https://gist.github.com/tim-st/32d9acacb20eec33575c32dffc2cae8d |
12:21:12 | FromGitter | <tim-st> oh, there is a bug |
12:21:42 | FromGitter | <tim-st> now compile time error on c level |
12:23:00 | FromGitter | <tim-st> `undeclared (first use in this function)` |
12:29:46 | FromGitter | <mratsim> you are not changing handleCompression value though |
12:30:13 | FromGitter | <tim-st> see the updated code |
12:39:30 | FromGitter | <mratsim> This seems to work but it seems like you have to pass globals as parameters: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b45fa8270efc60660bfb425] |
12:39:43 | * | floppydh quit (Remote host closed the connection) |
12:40:33 | * | floppydh joined #nim |
12:40:34 | FromGitter | <mratsim> in your case it might be easier to use templates that wraps the withCompression and withoutCOmpression procs |
12:41:09 | FromGitter | <mratsim> I couldn’t add the {.compileTime.} pragma to the “open” proc so I add to use static: as a workaround |
12:48:47 | * | tzekid quit (Quit: Page closed) |
12:57:26 | * | ng0 joined #nim |
13:05:40 | Yardanico | yay, obscure C compiler errors :) |
13:09:50 | PMunch | Yardanico, those are the best |
13:09:54 | Yardanico | PMunch, yeah, https://github.com/nim-lang/Nim/issues/8280 |
13:10:18 | PMunch | Well, maybe apart from the random SEGFAULTS I now get when using nimrtl.. Those are even worse |
13:10:29 | Yardanico | I'm just trying to port some Python-like functions to Nim (ab)using generics, concepts, etc :P |
13:11:59 | PMunch | Oh wow, incompatible type errors even |
13:25:39 | FromGitter | <kaushalmodi> I miss using advices in Nim: https://en.m.wikipedia.org/wiki/Advice_(programming) |
13:26:07 | FromGitter | <kaushalmodi> Advices can be used to completely if partially override already defined functions |
13:26:23 | FromGitter | <kaushalmodi> *or partially |
13:26:33 | Araq | you can override templates fwiw |
13:27:56 | FromGitter | <kaushalmodi> Yes, I learned that just recently in that issue :) |
13:28:01 | FromGitter | <kaushalmodi> https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html |
13:28:55 | FromGitter | <kaushalmodi> ^Above link better explains the use and benefits of advices. |
13:29:05 | Araq | "However, these were dropped from C++." |
13:29:11 | Araq | think about that. |
13:29:19 | Araq | C++ dropped the feature. |
13:29:40 | stefanos82 | Araq: such as obscure C compiler errors Yardanico mentioned before, can they be kind of reduced or eliminated if we choose C++ as our output? |
13:29:46 | Araq | can't imagine a better argument against them. |
13:29:49 | Araq | ;-) |
13:29:56 | Yardanico | stefanos82, same error happens with C++ backend :) |
13:30:02 | Yardanico | well, not the same error |
13:30:06 | stefanos82 | Yardanico: so it's a GCC bug? |
13:30:10 | Yardanico | but C/C++ backends are almost similar |
13:30:12 | Yardanico | afaik |
13:30:31 | FromGitter | <kaushalmodi> The lisp advices are more find tuned based on the description I read for how they worked in C |
13:30:39 | Yardanico | stefanos82, no, same error happens in clang, so that's probably a codegen bug |
13:30:57 | stefanos82 | Yardanico: ah I see. |
13:31:49 | FromGitter | <kaushalmodi> You can choose to tweak just the input args, or just the return values, or redefine the whole fn, or glue another fn to run immediately before/after the adviced fn. |
13:32:08 | Araq | I choose to not do any of these things. |
13:32:11 | FromGitter | <kayabaNerve> I get speedups with the C++ backend |
13:32:37 | FromGitter | <kaushalmodi> Araq: OK |
13:32:59 | FromGitter | <kayabaNerve> I'm sure it depends on the project though |
13:33:00 | FromGitter | <kaushalmodi> I need to find ways of yaingyths template overriding feature. |
13:33:44 | FromGitter | <kaushalmodi> Some weird autocorrect there.. I meant *using the template.. |
13:35:16 | Araq | for a start, it breaks Nim's effect system. you have a proc {.noSideEffect.} and then you on proc entry you want to *log* something (it's always logging, aspect oriented programming is justified with one example only) |
13:35:38 | Araq | and the proc is not noSideEffect anymore |
13:36:01 | Araq | "ah", you say, "logical it is still noSideEffect" |
13:37:02 | Araq | ok, so we have the "real" effects and the "logical" effects. |
13:38:43 | Araq | and noSideEffect is nothing an optimizer can take advantage off anymore. Nor can it be used for effective reasoning about a program anymore. Killing the effect system and replacing it with faith-based programming practices. |
13:40:45 | FromGitter | <alehander42> well you need aspect dimension for the effects: the "main" aspect is pure, but the logging aspect is not |
13:41:03 | Araq | or take the following statement. "This is an immutable data structure. It caches the most recent entries for performance, but logically it's all immutable." |
13:41:33 | Araq | -- "So I still get races in a multi threaded environment?" |
13:41:44 | Araq | -- "Yes, but logically it's all immutable" |
13:41:52 | Araq | -- "Great." |
13:44:05 | FromGitter | <mratsim> “Faith-based programming” lol |
13:44:42 | FromGitter | <kayabaNerve> @mratsim This is a good Christian language! |
13:45:06 | FromGitter | <kayabaNerve> I know 2/3rds evaluates to 0.66666 but I always hard code it as 0.777 to praise the lord. |
13:45:35 | FromGitter | <mratsim> Lord Las Vegas? |
13:45:52 | FromGitter | <kayabaNerve> As said in Leviticus, never have uncommented code over 500 lines, for if you do, your peers will see you as a dick. |
13:46:17 | Araq | Not to mention that the idea of "injecting" logging statements into a serious project is quite offensive to anybody who ever put some effort into logging. |
13:46:20 | FromGitter | <kayabaNerve> And as said in John, use f***ing version control. |
13:46:37 | stefanos82 | I "like" how people abuse, attack, or mocking Christianity but don't dare nor have the balls to do the same with Islam or any other spiritual faith. |
13:46:48 | FromGitter | <kayabaNerve> Araq: You mean just adding `echo x`? |
13:48:05 | FromGitter | <tim-st> @mratsim Nice, thanks for the help |
13:48:25 | FromGitter | <alehander42> :( |
13:48:43 | FromGitter | <kayabaNerve> stefanos82: I'm Christian myself, so I'm not targeting solely a different group. The joke is generally `Saying heck in a Christian Minecraft server, so it's a reference. Muslims/Jews are attacked often enough. I also make a ton of jokes about the... stricter... religions (Mormonism, Christian Scientists, Jehovah's Witnesses, Scientology). |
13:48:46 | federico3 | @mratsim: well, most development is far from evidence-driven |
13:48:46 | FromGitter | <mratsim> that’s like white vs minorities, able-bodied vs handicapped, men vs women, rich vs poor. In one case you can be ironic/sarcastic in the other it’s discrimination. |
13:49:04 | FromGitter | <kayabaNerve> And Christianity isn't a religion as much as Abrahamic isn't. It's a group of faiths. |
13:49:36 | Araq | stop it already, no religion or politics in #nim. |
13:49:45 | FromGitter | <kayabaNerve> Sorry, moving on |
13:49:56 | stefanos82 | Araq: I was about to ask the same thing, like what it has to do with Nim |
13:52:15 | FromGitter | <kayabaNerve> Araq: When are we looking at 1.0? |
13:52:29 | FromGitter | <kayabaNerve> Not from a time standpoint; from a major version standpoint. |
13:52:44 | FromGitter | <kayabaNerve> Do you have plans for 0.19, 0.20, 0.21, 1.0? Will 0.20 be 1.0? |
13:52:58 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/milestone/2 |
13:53:30 | Araq | the plan is always the same |
13:54:07 | Araq | 0.19 will be crap but also the RC for v1 |
13:54:10 | federico3 | when we run out of integers in 0.x.y |
13:55:49 | * | Trustable joined #nim |
13:56:03 | FromGitter | <mratsim> why crap? It’s good for me |
13:56:17 | FromGitter | <tim-st> @mratsim now I have a good idea: I make two types: Database and CompressedDatabase and overload all procs for both, and for the critical ones I check if T is CompressedDatabase |
13:56:38 | FromGitter | <tim-st> *when |
13:56:43 | Araq | mratsim: what do you think a new implementation for strings and seqs implies? |
13:56:55 | FromGitter | <mratsim> joy |
13:57:48 | FromGitter | <kayabaNerve> 1) 9.9.9.9.9 |
13:58:05 | FromGitter | <kayabaNerve> Or 99... |
13:58:12 | endragor | Is there a way to specify C include paths relative to a nim module? The use case is that a nimble package uses third-party C sources that have a bunch of their own header files. One way is to modify the C sources to use relative includes, but was wondering if there is something like {.compile.}, but for include paths |
13:58:48 | FromGitter | <mratsim> passL: -I “stringwith relative path”.} |
13:59:04 | Araq | yeah, it's pretty bad |
13:59:15 | FromGitter | <tim-st> endragor: yes like `{.compile: "../private/liblmdb/mdb.c".}` |
14:00:28 | stefanos82 | Araq: one thing I like about Ubuntu releases is how they use year and month as their version number |
14:01:04 | FromGitter | <narimiran> what does the new implementation for string and seqs imply?? further delays? :D |
14:01:06 | endragor | tim-st: that's compile and I'm talking about include paths. mratism: that wouldn't be relative to the module it's used in. Nim would just pass the string as is, so it doesn't solve the problem. |
14:02:26 | Araq | try this, but no guarantees: |
14:02:45 | Araq | {.passC: "-I$projectDir/path".} |
14:03:20 | Araq | nah, doesn't work |
14:03:30 | endragor | Araq: it would be in nimble package. I assume $projectDir would be project dir and not the package's dir? |
14:03:41 | Araq | ah |
14:04:25 | Araq | we need a .cincludeDir pragma |
14:04:26 | * | nuxdie joined #nim |
14:05:49 | endragor | Araq: that would be nice for this use case. For now it seems the workaround is to modify the third-party sources to use relative paths |
14:07:17 | FromGitter | <kayabaNerve> Actual question. What happens if we `import ~/file.nim` |
14:07:45 | FromGitter | <kayabaNerve> How does that map? Because all my imports are based on the current file location, and I would love a way, but not a default, to be able to import from where I compile |
14:08:45 | FromGitter | <mratsim> @endragor, I agree that the current situation is not great but this would work for you no? https://github.com/status-im/nim-secp256k1/blob/master/secp256k1.nim#L4 |
14:09:01 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b460f7de534eb69a5db57a6] |
14:10:01 | FromGitter | <mratsim> i.e. currentSourcePath + passC -I |
14:10:18 | stefanos82 | Araq: can @kayabaNerver use expandTilde() with import? |
14:12:16 | PMunch | kayabaNerve, you can easily write a macro that grabs the current directory and expands your imports |
14:14:24 | endragor | mratsim: oh yeah, nice trick, thank you |
14:14:35 | FromGitter | <kayabaNerve> A macro would be best but tbh I would want it at the compiler level, not project level (not importing ../../importMacro.nim) with every command. |
14:14:41 | FromGitter | <kayabaNerve> I could setup a nim alias though |
14:14:52 | FromGitter | <kayabaNerve> The question is would it work |
14:15:20 | stefanos82 | Araq: are you a vegetarian or a Tyrannosaurus Rex like me that devours anything? I'm asking in case I meet you some day in person, so I know what to buy you for food and drink...unless you would like to choose for both of us! LOL |
14:15:39 | FromGitter | <kayabaNerve> Chooses for boths, eats both |
14:15:42 | FromGitter | <kayabaNerve> Araq-style |
14:16:25 | Araq | I'm German, give me potatoes. |
14:16:27 | FromGitter | <mratsim> @kayabaNerve you can use a config.cfg or config.nims file which tell the compiler the root dir: https://github.com/status-im/nim-eth-p2p/blob/master/tests/config.nims |
14:16:39 | FromGitter | <kayabaNerve> @mratsim But can I import with it? |
14:16:41 | Araq | though I don't mind meat either. |
14:16:53 | FromGitter | <kayabaNerve> Araq I was in Germany last month or so. Great place. |
14:17:05 | FromGitter | <mratsim> @kayabaNerve no, but all your import will be implicitely prefixed with what is inside |
14:17:16 | FromGitter | <kayabaNerve> Instead of prefixed to the current file? |
14:17:21 | FromGitter | <mratsim> yes |
14:17:32 | FromGitter | <kayabaNerve> So that's close but worse. I need an option, not a default. Thanks though. |
14:18:04 | stefanos82 | Araq: then I will arrange a traditional feast for you |
14:18:12 | stefanos82 | any preference around beer? |
14:18:18 | FromGitter | <kayabaNerve> How many potatoes does it take to kill an Irishman? |
14:18:21 | FromGitter | <kayabaNerve> 0 |
14:18:36 | stefanos82 | that was a dark joke |
14:19:05 | FromGitter | <kayabaNerve> Agreed |
14:19:09 | FromGitter | <kayabaNerve> Sorry if I offended anyone |
14:19:12 | stefanos82 | it's like going to a person without hands and tell it "hey, let me give you a hand with what you are doing" |
14:19:35 | FromGitter | <mratsim> for option you can use a template: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4611f63c5abf52b64eebd7] |
14:19:35 | FromGitter | <kayabaNerve> "tell it" |
14:20:02 | FromGitter | <kayabaNerve> And if you actually help, that's bad wording but helpful/kind |
14:20:45 | FromGitter | <kayabaNerve> And did you die in the Irish Potato Famine or did your nearby family? I won't say immediate. You may have known a great grandfather as kid. But it did kinda end 160 years ago. |
14:20:57 | FromGitter | <kayabaNerve> more like 168 |
14:21:11 | FromGitter | <kayabaNerve> Thank you @mratsim |
14:21:22 | FromGitter | <kayabaNerve> How is import defined? |
14:21:29 | FromGitter | <kayabaNerve> Is it a method, proc, func, template... |
14:24:40 | FromGitter | <kayabaNerve> Or just where is it defined. That's the better question...\ |
14:26:19 | FromGitter | <mratsim> probably compiler magic |
14:27:08 | FromGitter | <kayabaNerve> Found it sortof. nkImportStmt |
14:28:38 | Araq | stefanos82: no dark beer please |
14:29:12 | stefanos82 | Araq: HAHAHAHA ^_^ I was about to ask whether you drink Guinness or not! |
14:29:14 | FromGitter | <kayabaNerve> /compiler/modulepaths.nim getModuleName |
14:29:31 | Araq | I drink it as a kind of last resort |
14:29:47 | FromGitter | <kayabaNerve> Araq: If I want to have a symbol correlate to the project directory for imports, so I'm not constantly using ../../, is getModuleName the best place to do that? |
14:29:54 | stefanos82 | but it's good...anyway, I will buy you some local beer to taste then |
14:31:08 | stefanos82 | I can't find such proc |
14:31:29 | FromGitter | <kayabaNerve> stefanos82: Talking to me? https://github.com/nim-lang/Nim/blob/master/compiler/modulepaths.nim |
14:33:02 | FromGitter | <kayabaNerve> @mratsim Do you think ~ is good since: ⏎ 1) It shouldn't work on Windows ⏎ 2) Few people keep source they directly import in their home dir (assuming it works on Linux anyways) ⏎ Or should I pick a more explicit symbol? [https://gitter.im/nim-lang/Nim?at=5b46151e9b82c6701bb5949a] |
14:33:18 | Araq | shashlick: can you work on the better --nimcache default? |
14:33:32 | Araq | it will make travis green as a nice sideeffect, I think |
14:34:02 | FromGitter | <kayabaNerve> Also looks like I actually want checkModuleName... |
14:38:12 | FromDiscord | <Epictek> @2vg request.path doesn't include the querys |
14:38:52 | * | nsf quit (Quit: WeeChat 2.1) |
14:39:43 | FromDiscord | <2vg> hmm, |
14:39:44 | FromDiscord | <2vg> Why do you want a query before being parsed? |
14:45:41 | * | PMunch quit (Quit: Leaving) |
14:46:02 | stefanos82 | @kayabaNerve: yeah mate, I looked here https://nim-lang.org/docs/lib.html and could not find it anything. Araq, shouldn't getModule fetch getModuleName and point me at the right direction? |
14:47:16 | FromGitter | <kayabaNerve> getModuleName gets the symbol to import it as. ⏎ import File ⏎ import ../src/lib/File ⏎ It claims to be File and ../src/lib/File (no Nim) but it's referred to as just File. [https://gitter.im/nim-lang/Nim?at=5b4618740a17e01fccd809f9] |
14:47:24 | FromGitter | <kayabaNerve> *it appears to me to actually be just file. |
14:48:00 | FromGitter | <kayabaNerve> The full "canonical" path is checkModuleName according to the comments |
14:55:17 | FromDiscord | <Epictek> @2vg using jester to proxy some requests to an api |
14:56:30 | FromDiscord | <Epictek> https://0x0.st/sf6G.png |
14:57:25 | FromDiscord | <Epictek> Just sort of confused why I can't seemm to get the raw url used for the request, Flask allows me to do that |
14:59:44 | * | miran joined #nim |
15:00:21 | FromGitter | <tim-st> when I use `discard existsOrCreateDir("a/b")` in nim, is it required that a exists already? |
15:00:34 | FromGitter | <tim-st> at least it seems |
15:01:31 | FromGitter | <tim-st> ah, the docs say, parent dir must exists |
15:03:24 | * | Perkol joined #nim |
15:04:56 | FromGitter | <tim-st> `createDir` works how I assumed `existsOrCreateDir` works^^ |
15:08:40 | * | miran quit (Quit: Konversation terminated!) |
15:13:19 | * | miran joined #nim |
15:19:01 | * | endragor quit (Remote host closed the connection) |
15:19:11 | shashlick | @mratsim: what do you mean by "proc should be exported" in the context of clblast? |
15:34:20 | shashlick | endragor: I do relative includes in nimgen - jyapayne improved it recently using curentSourcePath() |
15:34:36 | * | smt joined #nim |
15:34:38 | FromGitter | <mratsim> @shashlick, I want to see the proc signature like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46238d3c5abf52b64f2d3e] |
15:37:31 | FromGitter | <genotrance> do you mean you want to see the generated nim files in the repo? |
15:37:32 | FromGitter | <mratsim> in your wrapper, the proc generated are not in the github repo or available when you do git clone, it’s important for libraries |
15:37:35 | FromGitter | <mratsim> yes |
15:37:57 | FromGitter | <genotrance> cause all wrappers now have the generated nim and docs posted on http://nimgen.genotrance.com/ |
15:38:38 | FromGitter | <genotrance> E.g. http://nimgen.genotrance.com/nimarchive/ |
15:39:57 | shashlick | links are posted on each wrapper's github page |
15:40:02 | shashlick | does this meet your requirement? |
15:41:04 | FromGitter | <mratsim> I would prefer if it was at least in a .md file in the repo so that people can use their search function (from Github or VS code) to get the proc relevant to their type |
15:41:20 | FromGitter | <mratsim> a .nim file being the best |
15:42:50 | shashlick | so the docs along with source (in html and raw form) are on the site above |
15:43:00 | shashlick | if you click the source link it takes you to the html |
15:43:01 | shashlick | http://nimgen.genotrance.com/nimarchive/archive.nim.html |
15:43:21 | shashlick | remove the html and you can download the .nim file itself if you want |
15:44:44 | FromGitter | <mratsim> That’s too much friction. It should be directly in the repo |
15:45:50 | shashlick | Araq: i read the --nimcache conversation but unclear what's the requirement |
15:50:39 | zacharycarter | I keep getting this error in karax |
15:50:57 | * | zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/iXIrzSVKJiWBaJbVpJbXhYjH > |
15:51:37 | zacharycarter | https://gist.github.com/zacharycarter/f4aa62b06c156408e3bdecf13e4a7bea |
15:52:30 | zacharycarter | seems to happen when this event handler is invoked - https://gist.github.com/zacharycarter/f4aa62b06c156408e3bdecf13e4a7bea#file-welcome-nim-L6 |
15:59:14 | shashlick | @mratsim: will have to think about that - i'm already up to 11 wrappers and keeping them up to date with generated source will get old fast |
16:02:03 | FromGitter | <mratsim> My use case is not to keep them updated with upstream but to fix to a specific version and only expose functions that are deployed in common windows/homebrew/linux distros |
16:02:38 | FromGitter | <mratsim> Also I wrap a lot of library, and it’s important to be able to git clone and have everything needed in the repo |
16:03:15 | FromGitter | <mratsim> and for prospective devs that want to use the library they should be able to see from the Github repo what is wrapped and what it looks like |
16:03:34 | shashlick | okay so instead of staying up to date with the upstream repo, you want to stay with a particular version |
16:03:39 | FromGitter | <mratsim> yes |
16:03:44 | shashlick | is using nimble with tags not good? |
16:04:04 | shashlick | well, actually that only tags the nimgen wrapper repo, not upstream |
16:04:07 | shashlick | i need to look into that |
16:04:19 | shashlick | to tag to a particular version of upstream |
16:05:21 | shashlick | need to think of a way to accomplish snapshots in an automated fashion |
16:07:41 | FromGitter | <mratsim> If you look into how I wrapped nimblast, I go brute force way. I remove offending procs after the fact: https://github.com/numforge/nim-clblast/blob/master/clblast_nimgen.cfg#L65 |
16:17:15 | * | donlzx quit (Quit: Leaving) |
16:27:40 | shashlick | okay I agree there's value in being able to stabilize on particular version of a wrapper + upstream |
16:28:15 | shashlick | i think nimble already solves this for pure nim packages but need a way to do the same for nimgen |
16:31:15 | dom96 | zacharycarter: my guess is: setForeignID (or whatever the function is called) on the editor element should fix it |
16:31:40 | dom96 | also, why are you creating the editor every time the DOM is rendered? |
16:32:15 | dom96 | Epictek: the fact that you can't do this sounds like a bug to me, please report it. |
16:32:28 | shashlick | @mratsim: https://github.com/genotrance/nimgen/issues/21 |
16:48:00 | * | nsf joined #nim |
16:49:31 | * | Perkol quit (Ping timeout: 244 seconds) |
16:54:32 | * | chemist69 joined #nim |
17:00:17 | chemist69 | style guide question: I have a sequence type that can either contain some values or no values. |
17:00:25 | chemist69 | would you rather use (A) the uninitialized seq (nil), (B) an empty sequence or (C) an Option type (from the options module) for the no-value case? |
17:02:39 | dom96 | B |
17:03:52 | chemist69 | Ok, thanks dom96. |
17:09:48 | * | Perkol joined #nim |
17:10:56 | zacharycarter | dom96: thanks - hrmmm I thought that would just be called after the setRenderer call - I didn't realize it was called after every render, but that makes sense. thanks for pointing that out! |
17:14:34 | * | ng0 quit (Remote host closed the connection) |
17:15:09 | * | ng0 joined #nim |
17:30:53 | FromGitter | <Bennyelg> Hey all |
17:31:04 | FromGitter | <Bennyelg> What do I miss here: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b463ed826aa91065e89db1b] |
17:31:18 | FromGitter | <Quelklef> what do you mean? What's wrong? is there an error? |
17:32:31 | * | miran quit (Quit: Konversation terminated!) |
17:35:25 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b463fdc641ecc065f98bc30] |
17:36:22 | FromGitter | <Quelklef> uh |
17:36:34 | FromGitter | <Bennyelg> Heheh |
17:36:35 | FromGitter | <Quelklef> the line `var c: ConnectionT (cur: T.open("test.db", nil, nil, nil))` makes no sense |
17:36:40 | FromGitter | <Bennyelg> I know |
17:36:44 | FromGitter | <Quelklef> > > |
17:37:00 | FromGitter | <Quelklef> ...Why did you put it, then? |
17:37:01 | FromGitter | <Bennyelg> I am trying to figure out how I am opening connection by the type I gives |
17:37:10 | FromGitter | <Bennyelg> it's result of playing |
17:37:13 | FromGitter | <Quelklef> hmm |
17:37:19 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46404fc02eb83d7c696ad3] |
17:37:21 | FromGitter | <Quelklef> It's still wrong in that case |
17:37:40 | FromGitter | <Quelklef> it should be `var c: Connection[T] = ConnectionT (cur: T.open("test.db", nil, nil, nil))` |
17:37:47 | FromGitter | <Quelklef> or just `var c = ConnectionT (...)` |
17:38:02 | FromGitter | <Quelklef> You just did `: ` instead of ` = ` |
17:40:55 | FromGitter | <kaushalmodi> Can someone help understand the reason this test on PR https://github.com/nim-lang/Nim/pull/8282 is failing: https://travis-ci.org/nim-lang/Nim/jobs/402708022 |
17:41:14 | FromGitter | <Vindaar> @Bennyelg aside from what @Quelklef is already saying: if you want to hand an actual type, your proc signature is wrong: ⏎ ⏎ ```proc initializeConnection*(db_type: typedesc): Connection =``` ⏎ ⏎ and then you'll see the issue Quelklef is talking about [https://gitter.im/nim-lang/Nim?at=5b464139897d514b3c442442] |
17:41:47 | FromGitter | <Vindaar> from there just use `db_type` instead of `T` |
17:42:17 | FromGitter | <Bennyelg> I don't know what is typedesc :O |
17:42:34 | FromGitter | <Quelklef> It's the "type type" |
17:42:43 | FromGitter | <Quelklef> it signifies that the value given represents a type |
17:43:07 | FromGitter | <Bennyelg> oh pretty handy |
17:44:31 | FromGitter | <Bennyelg> but it still not working ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4641fe1c0f906b14489f16] |
17:44:55 | FromGitter | <Quelklef> no |
17:45:20 | FromGitter | <Bennyelg> in-light me :D |
17:45:47 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46424a1c0f906b14489fac] |
17:46:01 | FromGitter | <Quelklef> wait, nope |
17:46:03 | FromGitter | <Quelklef> nope nope |
17:46:06 | FromGitter | <Quelklef> hold on |
17:46:12 | FromGitter | <Quelklef> where are you getting the `open` proc from |
17:46:44 | FromGitter | <Quelklef> you need to do this: |
17:47:33 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4642b51c0f906b1448a07a] |
17:50:33 | FromGitter | <xDotDash> there is a lot wrong with that snippet |
17:50:59 | FromGitter | <kayabaNerve> Nim doesn't store what folder it's being executed from? |
17:51:32 | FromGitter | <Quelklef> @xDotDash Mine? |
17:52:11 | FromGitter | <Vindaar> I think this is what you want? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ you can alternatively go the way @Quelklef showed in terms of no proc argument -> generic type [https://gitter.im/nim-lang/Nim?at=5b4643cb6534bc5d2e50f16d] |
17:52:26 | FromGitter | <Vindaar> which would be nicer here |
17:52:28 | FromGitter | <Vindaar> imo |
17:52:36 | FromGitter | <Bennyelg> @Vindaar no |
17:52:38 | FromGitter | <Bennyelg> this is wont work |
17:52:52 | FromGitter | <Vindaar> why not? |
17:53:01 | FromGitter | <Vindaar> it compiles anyways :P |
17:53:30 | FromGitter | <Bennyelg> Because I want it to be generic proc for any type of database |
17:53:34 | FromGitter | <Quelklef> Hm, was under the impression you can't use `typedesc` formal params to instantiate other paramters, cool |
17:53:43 | FromGitter | <Bennyelg> so when I intialize the variable I'll get it depends on my request |
17:53:51 | FromGitter | <Bennyelg> will get = get the DbConn |
17:55:12 | FromGitter | <Bennyelg> So I want something like let dbdb_postgres.DbConn (connection: Properties) |
17:56:19 | FromGitter | <Quelklef> should be `initConnection` to follow conventions |
17:59:17 | FromGitter | <Vindaar> So you want to be able to use two different kinds of types in the same module? If yes, then you're right. My example doesn't work, because the `open` call isn't resolved. If however you want to provide a generic interface, which works regardless of which sql module the user imports, it works |
17:59:41 | FromGitter | <Bennyelg> This is what Im trying to do. |
17:59:55 | FromGitter | <Bennyelg> I know i need generic but It seems I can make it right. |
18:04:30 | FromGitter | <Quelklef> Can you give us some feedback? Did you try my solution? |
18:05:07 | * | drazan joined #nim |
18:07:41 | FromGitter | <tim-st> is there a way to pass a proc p `proc (a, b: string): int`as ptr p ? |
18:08:06 | FromGitter | <tim-st> I tried addr(p) but didnt work |
18:08:15 | FromGitter | <kayabaNerve> Is it proc p? |
18:08:28 | FromGitter | <kayabaNerve> And why not just pass the proc? |
18:08:44 | FromGitter | <Quelklef> can you `var x: ptr proc(a, b: string): int; x[] = p` |
18:09:32 | FromGitter | <kayabaNerve> !eval proc p(a,b:string): int = result = 2; var a: ptr (proc (a,b:string): int); a = addr p; echo a() |
18:09:33 | NimBot | Compile failed: in.nim(1, 43) Error: type expected |
18:09:50 | FromGitter | <Bennyelg> @Quelklef Your solution not work. |
18:09:55 | CodeVance | @kayabaNerve politics/religion #nim-offtopic kthx XD |
18:09:55 | FromGitter | <tim-st> @Quelklef thanks, it works |
18:10:02 | FromGitter | <Quelklef> @Bennyelg And the error was? |
18:10:04 | FromGitter | <Quelklef> sure @tim-st |
18:10:13 | FromGitter | <kayabaNerve> CodeVance: I already was told that and stopped a while ago |
18:10:16 | FromGitter | <tim-st> I didnt know I have to create the proc at runtime |
18:10:40 | FromGitter | <Quelklef> @kayabaNerve oh, did you? sorry |
18:10:42 | CodeVance | kayabaNerve. I saw |
18:10:55 | FromGitter | <kayabaNerve> So why tell me that now? |
18:11:01 | FromGitter | <kayabaNerve> @Quelklef What's up? |
18:11:13 | FromGitter | <kayabaNerve> !eval type proc p(a,b:string): int = result = 2; var a: ptr proc (a,b:string): int; a = addr p; echo a() |
18:11:14 | NimBot | Compile failed: in.nim(1, 6) Error: identifier expected, but found 'keyword proc' |
18:11:31 | FromGitter | <Quelklef> @kayabaNerve Oh, I think I misunderstood you. NEvermind |
18:11:32 | FromGitter | <kayabaNerve> I'll get it to work first |
18:11:33 | FromGitter | <kayabaNerve> Yeah |
18:11:35 | CodeVance | I saw afterwards |
18:13:24 | FromGitter | <kayabaNerve> Got it lol |
18:13:35 | FromGitter | <kayabaNerve> @tim-st Don't use pointers |
18:13:37 | FromGitter | <kayabaNerve> Use reg vars |
18:13:37 | FromGitter | <kayabaNerve> proc p(a, b: string): int = ⏎ ⏎ ```result = 2``` ⏎ ⏎ var a: proc (a, b: string): int ... [https://gitter.im/nim-lang/Nim?at=5b4648d19a612333aa56e221] |
18:13:52 | FromGitter | <kayabaNerve> That works, with proper tabbing, and can be assigned to any matching declaration |
18:14:28 | * | noonien quit (Quit: Connection closed for inactivity) |
18:15:01 | FromGitter | <tim-st> @kayabaNerve I imlement a wrap that want a ptr to a proc I cannot say I dont like it |
18:15:19 | FromGitter | <tim-st> @Quelklef Do you know why only `var` works and not `let` ? |
18:15:36 | FromGitter | <kaushalmodi> Can I get help understanding a Nim syntax in https://nim-by-example.github.io/arrays/ |
18:15:57 | FromGitter | <kaushalmodi> What is `static[int]` called in: ⏎ ⏎ ```type ⏎ Matrix[W, H: static[int]] = array[1 .. W, array[1 .. H, int]]``` [https://gitter.im/nim-lang/Nim?at=5b46495dc2d95c60f4d032e7] |
18:16:12 | FromGitter | <Quelklef> @tim-st Yeah, `let` variables cannot be mutated. `[]=` is a mutation. |
18:16:24 | FromGitter | <Quelklef> @kaushalmodi What's the confusion? |
18:16:54 | FromGitter | <tim-st> @Quelklef I didnt use `[]=` I used `var p = ...` and passed `addr(p)` |
18:16:57 | FromGitter | <Quelklef> the `array[1.. W,<x>]`? |
18:17:02 | FromGitter | <kaushalmodi> If I have just `int` instead of `static[int]`, it does not work.. |
18:17:15 | FromGitter | <Vindaar> @kaushalmodi `static` here refers to the fact that `W` and `H` are known at compile time |
18:17:20 | FromGitter | <kaushalmodi> so what is that "static[..]" called? so that I can learn more in manual |
18:17:29 | FromGitter | <Quelklef> Just look up static type |
18:17:34 | FromGitter | <Vindaar> Since the array size needs to be known at compile time, it cannot work without `static` |
18:17:48 | FromGitter | <Quelklef> @tim-st Dunno a lot about addr; I just suggested a possible different fix |
18:17:58 | FromGitter | <Vindaar> https://nim-lang.org/docs/manual.html#special-types-static-t |
18:18:03 | FromGitter | <kaushalmodi> I already read https://nim-lang.org/docs/manual.html#static-type_1, but couldn't link that piece with manual |
18:18:07 | FromGitter | <Quelklef> @Vindaar `[X: int]` is also just invalid, innit? Regardless of whether or not it actually needs to be static |
18:18:08 | FromGitter | <kayabaNerve> Just forked Nim to an org by accident :/ |
18:18:09 | FromGitter | <tim-st> @Quelklef I think it's a bug that `let` doesnt work here |
18:18:23 | FromGitter | <kaushalmodi> @Vindaar Thanks! |
18:18:30 | FromGitter | <Quelklef> @tim-st If you think it's a bug, can you send me a minified gist real quick so I can take alook? |
18:18:36 | FromGitter | <tim-st> yes |
18:19:03 | FromGitter | <tim-st> https://gist.github.com/tim-st/07f3f4ae29b025ab7e3316d3b4134b9e |
18:19:27 | FromGitter | <Quelklef> Minified, my friend |
18:19:28 | FromGitter | <tim-st> line 2, var works, let doesnt |
18:19:34 | FromGitter | <Quelklef> Boiled down to its essential elements |
18:19:44 | FromGitter | <tim-st> it's only line 2 |
18:19:56 | FromGitter | <tim-st> and line 3 last param |
18:20:02 | FromGitter | <Quelklef> it's because |
18:20:17 | FromGitter | <Quelklef> `addr` type is `procT (x: var T): ptr T` |
18:20:25 | FromGitter | <Quelklef> `addr` isn't defined for `let` variables |
18:20:26 | FromGitter | <Quelklef> not a bug |
18:20:43 | FromGitter | <tim-st> ah, ok, makes sense, but why isnt for `let`? |
18:21:00 | FromGitter | <Quelklef> If you want to use it on let, use `unsafeAddr` |
18:21:00 | FromGitter | <Quelklef> https://nim-lang.org/docs/system.html#unsafeAddr,T |
18:21:16 | FromGitter | <tim-st> ok, thanks for your help! |
18:21:25 | FromGitter | <Quelklef> But it has `unsafe` in its name, so I'd avoid it... |
18:21:28 | FromGitter | <Quelklef> No problem |
18:21:31 | FromGitter | <tim-st> yes^^ |
18:21:45 | FromGitter | <tim-st> I already check exceptions, my code is safe |
18:23:08 | dom96 | Checking exceptions doesn't make your code safe |
18:23:12 | dom96 | This is about memory safety |
18:23:38 | FromGitter | <tim-st> but the wrapper code checks it and returns a success number |
18:23:45 | FromGitter | <tim-st> and I check the returning code |
18:24:02 | FromGitter | <tim-st> and it's defined in local scope |
18:24:21 | FromGitter | <kayabaNerve> ` ⏎ modulepaths.nim(123, 41) Error: type mismatch: got <TLineInfo> ⏎ but expected one of: ⏎ proc toFullPath(conf: ConfigRef; fileIdx: FileIndex): string ⏎ template toFullPath(conf: ConfigRef; info: TLineInfo): string ... [https://gitter.im/nim-lang/Nim?at=5b464b55b5efcd5aeef2b8f5] |
18:24:22 | Yardanico | why won't you just change "let" to "var"? |
18:24:45 | FromGitter | <tim-st> Yardanico: I did, but I prefer `let` when to show it's not changed |
18:25:08 | Yardanico | @tim-st but why do you need the address of `let` if you don't change it? |
18:25:34 | FromGitter | <tim-st> because the wrapper expects the addr of the proc, dunno why |
18:26:09 | FromGitter | <kayabaNerve> proc (a, b: cint): cstring {.cdecl.} |
18:26:24 | FromGitter | <kayabaNerve> If it's a Nim wrapper around C, and you must pass a proc, use that |
18:27:07 | FromGitter | <tim-st> how is this better? |
18:27:13 | FromGitter | <kayabaNerve> TBH, I haven't read that much, sorry. I suggested something similar earlier and others have been helping you. Justt trying to help again |
18:27:38 | FromGitter | <kayabaNerve> When you use proc as a type for a var, it is a function pointer |
18:27:40 | FromGitter | <tim-st> ok, thanks, just thought there is something about cstring |
18:27:47 | FromGitter | <kayabaNerve> When you use it with C, just cdecl everything |
18:28:03 | FromGitter | <kayabaNerve> No. cint/cstring is for passing to C. That said, string will autoconvert to cstring. |
18:29:18 | dom96 | nope |
18:29:40 | FromGitter | <kayabaNerve> ? |
18:29:40 | dom96 | that's why you need to take `addr str[0]` |
18:29:50 | dom96 | string -> cstring isn't implicit |
18:30:08 | FromGitter | <kayabaNerve> That works too but I'm 99% sure I can pass a string to a function labelled cstring... |
18:30:20 | FromGitter | <tim-st> I always used "".cstring or $cstring |
18:30:22 | FromGitter | <kayabaNerve> I have code that does |
18:30:28 | FromGitter | <kayabaNerve> $cstring for the reverse |
18:31:02 | FromGitter | <kayabaNerve> proc test(a: cstring): bool = ⏎ ⏎ ```result = true``` ⏎ ⏎ var b: string = "abc" ... [https://gitter.im/nim-lang/Nim?at=5b464ce5897d514b3c444ecd] |
18:31:09 | FromGitter | <kayabaNerve> dom96: That works on the Nim playground |
18:31:17 | FromGitter | <kayabaNerve> Outputs true |
18:31:28 | dom96 | Interesting. Maybe I got it the wrong way around myself :) |
18:31:44 | Yardanico | dom96, it's converted implicitly |
18:31:47 | Yardanico | dom96, https://github.com/nim-lang/Nim/blob/devel/lib/system/widestrs.nim#L117 and line 122 |
18:32:22 | Yardanico | if you do a newWideCString with string, newWideCString(s: string) will be called and it will call newWideCString(source: cstring, L: int) |
18:34:33 | FromGitter | <kayabaNerve> dom96 Pretty sure I own everything you used to own know |
18:34:50 | FromGitter | <kayabaNerve> Something something beat a Nim developer on a trivial thing, get all their stuff? |
18:35:00 | FromGitter | <kayabaNerve> The UN passed it last month... |
18:36:18 | zacharycarter | is there any good way to execute code once the vdom has been built in karax? |
18:37:25 | zacharycarter | other than using runLater ? |
18:37:30 | zacharycarter | other than using `runLater` ? |
18:41:40 | FromGitter | <kayabaNerve> So if I compile from Desktop, and I'm compiling Desktop/src/main.js, and I have another Nim file in Desktop/lib/ (say test.nim), instead of ../lib/test.nim, I can now use ~/lib/test.nim. Fun. |
18:44:40 | FromGitter | <kayabaNerve> And it still has compatibility with ../, folder.file, ./folder/file |
18:44:52 | FromGitter | <kayabaNerve> No idea if it works on every OS yet. Anyone here on Linux want to do me a favor? |
18:47:10 | FromGitter | <kayabaNerve> Here's the link if anyone wouldn't mind testing this for me: https://github.com/kayabaNerve/Nim |
18:48:04 | FromGitter | <Quelklef> I'm on linux. What am I testing? |
18:48:30 | FromGitter | <kayabaNerve> My edited Nim compiler |
18:48:35 | FromGitter | <kayabaNerve> If you're compiling src/main |
18:48:45 | FromGitter | <kayabaNerve> And have a file in lib/ called test (lib/test.nim) |
18:49:14 | FromGitter | <kayabaNerve> Instead of writing ../lib/test.nim (relative to the location of main.nim), you can now write ~/lib/main.nim which will work off wherever the compiler was called from |
18:49:34 | FromGitter | <Quelklef> oh, cool! |
18:49:52 | FromGitter | <Quelklef> does it require it just be in src/, or be a part of a nimble package? |
18:50:17 | FromGitter | <kayabaNerve> `import ~/file.nim` will import file.nim in the directory you called it from |
18:50:20 | FromGitter | <kayabaNerve> use it however you want |
18:50:26 | FromGitter | <kayabaNerve> I just want to confirm it works on Linux |
18:50:33 | FromGitter | <Quelklef> Wait |
18:50:34 | FromGitter | <kayabaNerve> Then I'll make a PR |
18:50:44 | FromGitter | <Quelklef> I'm not quite understanding |
18:50:57 | FromGitter | <Quelklef> The path is relative to where I called `nim c` from? |
18:51:01 | FromGitter | <Bennyelg> @kayabaNerve are you a liberland citizen ? |
18:51:06 | FromGitter | <kayabaNerve> Relative, yes |
18:51:12 | FromGitter | <kayabaNerve> @Bennyelg Eligible and a volunteer |
18:51:19 | FromGitter | <Bennyelg> Add me :P |
18:51:23 | FromGitter | <Bennyelg> I want to join |
18:51:28 | FromGitter | <kayabaNerve> But from a file perspective, it's not relative. It's standard. |
18:51:32 | FromGitter | <kayabaNerve> Join what? |
18:51:41 | FromGitter | <kayabaNerve> How'd you find that out btw? Just my GitHub profile? |
18:51:45 | FromGitter | <Bennyelg> Ya |
18:51:48 | FromGitter | <Bennyelg> Organization |
18:52:14 | FromGitter | <Quelklef> @kayabaNerve Still seems strange, I'd expect the paths to be independent of "my" location. Anyway, I'll test in a sec |
18:52:15 | FromGitter | <kayabaNerve> What do you want me to add you to? |
18:52:38 | Yardanico | is "char name[16]; " in C is the same as array[16, char] in Nim? |
18:52:40 | FromGitter | <kayabaNerve> From a file perspective, currently import is relative to that file. This provides an OPTIONAL way to act relative to the project directory, without breaking existing functionality. |
18:52:44 | Yardanico | (it's in a struct) |
18:52:47 | FromGitter | <Bennyelg> I Applied for citizenship 1.5 year ago. still not respones |
18:52:49 | FromGitter | <kayabaNerve> Yardanico: Should be. |
18:53:15 | FromGitter | <kayabaNerve> @Bennyelg This is not for here. I already got chastised for talking politics |
18:53:25 | FromGitter | <kayabaNerve> Thanks @Quelklef |
18:53:33 | FromGitter | <kayabaNerve> Tell me if you need test files. I can send you a zip |
18:53:34 | * | Ven`` joined #nim |
18:53:41 | dom96 | Bah, I missed --threads:on in TechEmpower benchmarks |
18:54:29 | * | chemist69 quit (Ping timeout: 260 seconds) |
18:55:45 | FromGitter | <kayabaNerve> How much of a difference does it make? |
18:56:24 | * | chemist69 joined #nim |
18:58:35 | FromGitter | <Quelklef> Working. There's an edge case when doing `~/filename.nim` instead of `~/filename`, though |
18:58:49 | FromGitter | <Quelklef> `~/one/one.nim` is interpreted as `~/one/one/nim` |
18:59:17 | FromGitter | <Quelklef> Dunno if that's because of you or not |
18:59:33 | FromGitter | <Quelklef> Worked fine for `~/top.nim`, though |
18:59:51 | FromGitter | <Quelklef> (or `~/top`, which also worked) |
19:00:37 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Nim/commit/816f58b9869612d82707405513cd2b863b44ba4a |
19:00:49 | * | skrylar joined #nim |
19:01:06 | FromGitter | <Quelklef> hm, `~/~/~/~/top` works as well as `~/top`. Dunno if this is desired behavior or not |
19:01:21 | FromGitter | <kayabaNerve> There's the commit. I delete all ~ and prefix it and set the current path to the root folder |
19:01:34 | FromGitter | <Quelklef> That feels iffy to me |
19:01:49 | FromGitter | <kayabaNerve> You can also do ////top or folder/../folder../ |
19:01:59 | FromGitter | <Quelklef> blehhh |
19:02:09 | FromGitter | <Quelklef> Well, it's up to Araq/dom |
19:02:18 | FromGitter | <kayabaNerve> I don't touch the extension at all though |
19:02:30 | FromGitter | <kayabaNerve> Sounds like a bug to report. |
19:03:25 | FromGitter | <Quelklef> Wait, you have `m = m.replace(commandPrefix)` which is allowing `~/~/~/top` to work |
19:03:45 | FromGitter | <Quelklef> Anyway, I very much doubt this will ever lead to a real-world problem, so whatever |
19:04:56 | FromGitter | <kayabaNerve> Yeah. Is there a way to say only replace once:? |
19:05:12 | FromGitter | <Quelklef> just do |
19:05:28 | FromGitter | <Quelklef> wait, I think so |
19:05:29 | FromGitter | <Quelklef> hol on |
19:05:43 | FromGitter | <kayabaNerve> Not in strutils? I could just delete the first two chars... |
19:05:49 | FromGitter | <kayabaNerve> Or first one really |
19:05:52 | FromGitter | <Quelklef> (alternatively just do `if m.startswith(commandprefix): m = m[len(commandprefix) .. ^0]` |
19:06:03 | FromGitter | <kayabaNerve> Slice or delete? |
19:06:08 | FromGitter | <Quelklef> uh |
19:06:13 | FromGitter | <Quelklef> /shrug |
19:06:22 | FromGitter | <kayabaNerve> Lol |
19:06:34 | FromGitter | <Quelklef> slice because it's pure and performance isn't important here |
19:08:59 | dom96 | kayabaNerve: A huge difference. |
19:09:13 | dom96 | Case of using 1 core vs. 256 or something crazy like that |
19:09:21 | FromGitter | <kayabaNerve> dom96: Which one is better? |
19:09:25 | FromGitter | <kayabaNerve> I just added .delete |
19:09:38 | FromGitter | <kayabaNerve> `m.delete(0, 0)` |
19:09:38 | dom96 | ? |
19:09:55 | FromGitter | <kayabaNerve> I have to delete a single char from a string. |
19:09:59 | FromGitter | <kayabaNerve> That char is the first one. |
19:10:46 | FromGitter | <kayabaNerve> Quelkef suggested using [1 .. *end*]. strutils has a delete method. I just edited the code to contain `m.delete(0, 0)`. Should I have used a different method? |
19:11:01 | FromGitter | <Quelklef> I really don't think this is this important, man |
19:11:20 | FromGitter | <Quelklef> And if it is it'll prolly get caught in the code review before the PR is merged |
19:11:24 | FromGitter | <kayabaNerve> I don't either but then dom96 said it's a huge difference |
19:11:33 | FromGitter | <kayabaNerve> Yeah but it's my first and I really want to do well lol |
19:11:36 | FromGitter | <Quelklef> Was that referring to this? |
19:11:51 | FromGitter | <Quelklef> Oh, cool first! |
19:11:55 | dom96 | I was referring to me missing --threads:on |
19:11:57 | dom96 | Not anything else |
19:12:00 | FromGitter | <kayabaNerve> Oh lol |
19:12:04 | FromGitter | <kayabaNerve> Never mind |
19:12:15 | FromGitter | <kayabaNerve> You can no longer do ~/~/; submitting PR |
19:12:18 | FromGitter | <Quelklef> My only PR Araq said that one of my funcs is poor performance but I'm not sure how he wanted me to do it lol |
19:12:21 | FromGitter | <Quelklef> Nice |
19:14:42 | Yardanico | ah, so the main issue is that on delphi side it's "Name: packed array[0..15] of Char;" and apparently that's not the same as "name: array[0..15, char]" in Nim. (however C struct with "char name[16];" works correctly) |
19:14:47 | Yardanico | probably it's the alignment issue |
19:15:37 | * | nsf quit (Quit: WeeChat 2.1) |
19:16:04 | FromGitter | <kayabaNerve> https://github.com/nim-lang/Nim/pull/8285 |
19:16:11 | FromGitter | <kayabaNerve> :D |
19:16:32 | Yardanico | It works if I add "empty1, empty2, empty3: byte" to the Nim object, so yeah, that's an alignment issue |
19:16:43 | Yardanico | or I just don't know C/delphi good enough |
19:16:58 | dom96 | Lookup what `packed` means |
19:17:05 | Yardanico | yeah, I did |
19:17:18 | FromGitter | <Quelklef> @kayabaNerve What's the use-case for this? |
19:17:25 | Yardanico | but how the C code (which interfaces with the same library) uses simple "char name[16];" and still works? |
19:17:25 | dom96 | Yardanico: Create a macro that does the same in Nim :D |
19:17:48 | FromGitter | <kayabaNerve> @Quelklef Getting rid of ../ |
19:18:21 | FromGitter | <Quelklef> But, why are imports relative to cwd desirable over those relative to the nim file? |
19:18:29 | FromGitter | <Quelklef> Or when are they? |
19:18:31 | FromGitter | <kayabaNerve> Because of the level of nesting |
19:18:53 | FromGitter | <Quelklef> come again? |
19:19:02 | FromGitter | <kayabaNerve> My project, Ember, has all the code in the src/ directory. There's 6 folders in there. The Blockchain part, in the Merit folder, uses the Address code from Wallet folder. |
19:19:10 | FromGitter | <kayabaNerve> So that file must call ../Wallet/Address |
19:19:17 | FromGitter | <kayabaNerve> It'd just be nicer for me to say ~/Wallet |
19:19:31 | FromGitter | <kayabaNerve> Especially as these 6 folders will also have subfolders |
19:19:34 | FromGitter | <Quelklef> so you're doing `~/Wallet/Address` instead of `../Wallet/Address`? |
19:19:37 | FromGitter | <kayabaNerve> So then it's not one char; it's ../../ |
19:19:44 | FromGitter | <kayabaNerve> Not once it has subfolders |
19:19:58 | FromGitter | <Quelklef> hm |
19:20:06 | FromGitter | <Quelklef> can't you just do `.../Wallet/Address`? |
19:20:10 | FromGitter | <Quelklef> But I see what you mean |
19:20:12 | FromGitter | <kayabaNerve> That's what I am doing |
19:20:19 | FromGitter | <Quelklef> It feels a little yucky to me though |
19:20:24 | FromGitter | <kayabaNerve> It's just another option. I prefer that when working between these 6 folders, and doing relative intrafolder. |
19:20:32 | FromGitter | <kayabaNerve> Wait |
19:20:33 | FromGitter | <Quelklef> Conceptually, what you want is not that it's relative to the cwd, but that's it's relative to the project root |
19:20:33 | FromGitter | <kayabaNerve> ... ? |
19:20:36 | FromGitter | <kayabaNerve> Does that work? |
19:20:38 | FromGitter | <Quelklef> What |
19:20:41 | FromGitter | <kayabaNerve> ... |
19:20:44 | FromGitter | <Quelklef> `.../Wallet/Address`? Maybe |
19:20:46 | FromGitter | <Quelklef> try it! |
19:21:08 | FromGitter | <kayabaNerve> When there's increased subfolders, it'll go from one char and me just disliking it to a mess of a dots and me disliking it |
19:21:14 | FromGitter | <Quelklef> sure |
19:21:21 | FromGitter | <kayabaNerve> The Wallet/Address works with the Blockchain; not under it |
19:21:23 | FromGitter | <Quelklef> but it feels like `~` should stand for project root, not cwd |
19:21:31 | FromGitter | <kayabaNerve> I compile from the project root |
19:21:37 | FromGitter | <Quelklef> but that's not a guarantee |
19:21:44 | FromGitter | <Quelklef> right |
19:22:01 | FromGitter | <kayabaNerve> NGL, I did write this for my use case. I wouldn't submit a PR if I didn't think others would like it, but it is based on me. |
19:22:01 | FromGitter | <kayabaNerve> The existing project root folders were bogus. |
19:22:06 | FromGitter | <Quelklef> you're just making sure that your implementation aligns with your concept by compiling from root dir |
19:22:10 | FromGitter | <Quelklef> hmmmm |
19:22:19 | FromGitter | <Quelklef> what do you mean the existing project root foders were bogus |
19:22:29 | FromGitter | <kayabaNerve> If I compiled from the Desktop, and compiled src/main.nim, all the existing projects vars said it was src/ |
19:22:50 | FromGitter | <Quelklef> what is "it"? |
19:23:11 | FromGitter | <kayabaNerve> The project root |
19:23:22 | FromGitter | <kayabaNerve> It said it was the folder of the file I was compiling |
19:23:31 | FromGitter | <Quelklef> I mean |
19:23:35 | FromGitter | <kayabaNerve> So that means if I compile test/test.nim, the project root is test/ |
19:23:37 | FromGitter | <Quelklef> I think `src/` typically is the name of the project root |
19:23:44 | FromGitter | <kayabaNerve> But that's now how it decides. |
19:23:45 | FromGitter | <Quelklef> wait, |
19:23:56 | FromGitter | <Quelklef> how are you finding out project root |
19:24:14 | FromGitter | <kayabaNerve> Nim compiler says it's the folder the file you directly compiled is in |
19:24:20 | FromGitter | <kayabaNerve> I say it's where you called the compiler from |
19:24:20 | FromGitter | <kayabaNerve> src/ <- Project Code ⏎ test/ <- Tests |
19:24:26 | FromGitter | <kayabaNerve> That's my structure |
19:24:36 | FromGitter | <kayabaNerve> Project root should either be / or src/ |
19:24:43 | FromGitter | <Quelklef> Hmm |
19:24:46 | FromGitter | <Quelklef> Where's the nim compiler say that? |
19:24:54 | FromGitter | <kayabaNerve> But if I compile tests/test1.nim, the project path according to Nim is tests/ |
19:24:56 | FromGitter | <kayabaNerve> In the config |
19:25:08 | FromGitter | <Quelklef> nim.cfg |
19:25:08 | FromGitter | <Quelklef> ? |
19:25:20 | FromGitter | <kayabaNerve> It has automatic values but I can override it |
19:25:37 | FromGitter | <kayabaNerve> I'm sure I can override it. |
19:25:54 | FromGitter | <kayabaNerve> @mratsim gave me a way to do what I wanted with no edits. His way wasn't optional though. |
19:26:22 | FromGitter | <kayabaNerve> He said declare the project root and then everything will assume that prefix |
19:26:30 | FromGitter | <kayabaNerve> I only want it optionally; more rarely than commonly |
19:26:36 | FromGitter | <Quelklef> hmmmm that feels more yucky |
19:26:41 | FromGitter | <Quelklef> I don't like either of these solutions |
19:26:53 | FromGitter | <kayabaNerve> I saw a need for this. I thought others may like it. Once I wrote it, I submitted a PR for this optionally use edit that doesn't change any existing behavior. |
19:27:03 | FromGitter | <Quelklef> yeah |
19:27:17 | FromGitter | <Quelklef> I just see it causing potential issues personally |
19:27:27 | FromGitter | <Quelklef> esp if someone is editing on commandline |
19:27:35 | FromGitter | <Quelklef> Then they're gonna `cd` into the non-project-root |
19:27:40 | FromGitter | <Quelklef> in order to edit |
19:27:45 | FromGitter | <kayabaNerve> Then they could set a config var |
19:27:47 | FromGitter | <Quelklef> and then suddenly `~` is wrong |
19:27:55 | FromGitter | <kayabaNerve> So override it with a cfg file :P |
19:28:09 | FromGitter | <Quelklef> Wait, I'm not super hip to cfgs |
19:28:22 | FromGitter | <Quelklef> With a cfg file can I declare a project root |
19:28:26 | FromGitter | <Quelklef> and then `~` will refer to that |
19:28:45 | FromGitter | <kayabaNerve> I think so. Not too sure tbh. I didn't test that. |
19:28:51 | FromGitter | <Quelklef> hmmm |
19:28:59 | FromGitter | <Quelklef> If that works, that'd be super cool |
19:29:06 | FromGitter | <kayabaNerve> I'll check |
19:32:03 | FromGitter | <kayabaNerve> Invalid cli option |
19:32:10 | FromGitter | <kayabaNerve> So needs another comment :P |
19:32:22 | FromGitter | <Quelklef> ? |
19:32:47 | FromGitter | <kayabaNerve> *commit |
19:32:56 | FromGitter | <kayabaNerve> nim.cfg(1, 1) Error: invalid command line option: '--commandPath' |
19:33:40 | FromGitter | <Quelklef> Unrelated, but @dom96 does the parser require assignment after a `let` declaration? Is `let x` valid syntax? I can never tell when something is a parser error or something else. |
19:34:06 | dom96 | !eval import macros; dumpTree: let x |
19:34:07 | NimBot | Compile failed: in.nim(1, 26) Error: expression expected, but found 'keyword let' |
19:34:13 | dom96 | parser error |
19:35:14 | FromGitter | <Quelklef> Thanks. How can I differentiate them? |
19:36:33 | FromGitter | <Quelklef> Oh, because that program would have succeeded if it weren't. |
19:38:45 | zacharycarter | it'd be super nice if karax emitted some kind of event after the vdom was rendered for the first time |
19:38:52 | zacharycarter | so you could run some kind of initialization code |
19:41:14 | * | Trustable quit (Remote host closed the connection) |
19:42:20 | Araq | zacharycarter: just add a flag to your clientPostRenderCallback |
19:42:29 | Araq | so that it's a nop after its first call |
19:43:47 | zacharycarter | okay thanks Araq |
19:45:00 | shashlick | Araq: you mentioned the --nimcache change in the morning - is there already an issue or can you please explain what you need? |
19:53:58 | FromGitter | <kayabaNerve> @Quelklef https://github.com/nim-lang/Nim/blob/master/compiler/commands.nim |
19:54:04 | FromGitter | <kayabaNerve> That file would have to be edited too |
19:54:39 | FromGitter | <kayabaNerve> That's the next step and a feature I'd probably use. I'll get started |
19:54:44 | FromGitter | <Quelklef> :D |
20:00:38 | * | rokups quit (Quit: Connection closed for inactivity) |
20:01:20 | Araq | kayabaNerve: stuff like that requires an RFC unless the BDFL does it |
20:01:58 | Araq | and I don't want you to write your imports relative to ~, it's unnecessary |
20:05:53 | stefanos82 | let's give a new meaning to BDFL: Best Dancer For Life |
20:06:32 | FromGitter | <Quelklef> bourbon drinker & food lover |
20:07:20 | stefanos82 | oh...I like this one even more! |
20:07:56 | Araq | features need to pull in their weight |
20:08:18 | Araq | and ideally Nim should get simpler. |
20:08:23 | CodeVance | what are the out and in keywords used for? |
20:08:23 | CodeVance | and also interface |
20:08:36 | Araq | `in` is a binary operator |
20:08:43 | Araq | out and interface are currently unused |
20:10:13 | FromGitter | <kayabaNerve> Araq: ⏎ 1) What's BDFL? ⏎ 2) This makes my work simpler, doesn't break existing cases, and I believe it may help others. If I didn't the third, I wouldn't have made a PR. Take it or leave it. ⏎ 3) Fair enough about pulling their our weight. This is minor. ⏎ 4) @Quelklef Yeah I can't figure how to make it a CLI option lol. [https://gitter.im/nim-lang/Nim?at=5b466425c02eb83d7c69dade] |
20:10:31 | FromGitter | <kayabaNerve> *Feel free to take it or leave it :) |
20:10:36 | FromGitter | <Quelklef> BDFL: Benevolent dictator for life |
20:10:53 | FromGitter | <Quelklef> @kayabaNerve Oh well, I didn't really need it anyway, it just felt wrong to do it the other way |
20:11:22 | FromGitter | <kayabaNerve> I don't mind if it gets used. Of course, I'd like it to, but it's not the biggest deal. That said, since it won't be used. I won't personally use it. |
20:11:37 | FromGitter | <kayabaNerve> *in projects I make public. |
20:12:11 | FromGitter | <kayabaNerve> Side note, how would I do an RFC? |
20:13:17 | FromGitter | <kaushalmodi> What is the cause of the stdlib_times.c errors for the last commit on devel and all the PR's based off that? |
20:14:08 | Araq | kaushalmodi: too much parallelism in the tester, I think |
20:14:08 | FromGitter | <kaushalmodi> Also that last PR is only a doc update |
20:14:23 | Araq | there is a PR addressing that already... |
20:14:38 | FromGitter | <kaushalmodi> Oh, OK. Thanks. |
20:18:38 | shashlick | Araq: are you talking about this when you pinged me earlier - https://github.com/nim-lang/Nim/issues/8236 |
20:24:22 | * | Perkol quit (Remote host closed the connection) |
20:26:00 | skrylar | it occurs to me that the tweening lib should probably include dampened springs |
20:26:17 | skrylar | (well, 'easing', since it just provides the curves and not the tweens) |
20:27:52 | Araq | shashlick: no, there is no RFC yet. please read today's logs a bit |
20:28:02 | Araq | the point is that --nimcache should have a better default |
20:28:27 | Araq | like $HOME/.cache/nim_$projectname_$relaseVsDebug |
20:29:38 | shashlick | okay so current default is same directory as the .nim file, it needs to change as above |
20:29:53 | shashlick | what about JS mode though? we put the resulting js file in nimcache today |
20:30:01 | * | skrylar wonder if the easing library should include interpolators :think: |
20:30:04 | Araq | yeah. this will also prevent these "parallel access to nimcache" bugs |
20:30:07 | shashlick | will our users know that they need to dig out the js file from in ~/.cache? |
20:30:14 | * | chemist69 quit (Quit: WeeChat 1.9.1) |
20:30:31 | Araq | oh for JS it shouldn't be changed for now |
20:30:35 | Araq | good point. |
20:31:08 | shashlick | in my mind, I feel the js file is effectively the output so it should be put where the output goes today |
20:31:20 | Araq | yeah true |
20:31:21 | skrylar | this is true |
20:31:54 | Araq | but it will break builds in a subtle way. hmm |
20:31:56 | shashlick | nimcache is for intermediate files, not the final result |
20:32:39 | Araq | yes, I agree |
20:32:51 | shashlick | why not a shared nimcache instead of a project specific sub-dir? |
20:33:13 | skrylar | that doesn't always work out |
20:33:59 | skrylar | in the neural tts codebase i have some nims that have to be built with cpp and others with c, and the cache dir gets confused and spits out broken code between the two |
20:34:14 | skrylar | [this is to answer shashlick's questsion and is not an invitation to tell me how to do my job] |
20:38:44 | shashlick | okay so what's the benefit of this better default? |
20:38:54 | shashlick | centralized and easier to delete? |
20:39:02 | shashlick | doesn't seem to be any performance value |
20:40:28 | shashlick | araq: to skrylar's point, can the nim compiler tell that the gcc compiled stdlib is different from the g++ compiled version? |
20:41:58 | Araq | shashlick: centralized and easier to delete, little need to override --nimcache |
20:43:34 | * | lompik quit (Ping timeout: 260 seconds) |
20:44:18 | shashlick | okay but are you okay with moving the js output to the output location as part of the change? |
20:44:21 | shashlick | will break stuff yes |
20:47:31 | * | nsf joined #nim |
20:55:07 | * | Vladar quit (Quit: Leaving) |
20:59:47 | Araq | yeah I'm okay with it |
21:00:24 | shashlick | okay so be it |
21:16:27 | * | dddddd quit (Ping timeout: 240 seconds) |
21:20:06 | * | yglukhov[i] quit (Remote host closed the connection) |
21:23:55 | * | dddddd joined #nim |
21:34:50 | * | nsf quit (Quit: WeeChat 2.1) |
21:44:46 | stefanos82 | Araq: I wanted to ask you mate. On what other projects are you working apart from Nim? I like reading other's code, it helps me gaining more knowledge and valuable techniques / methodologies |
21:46:25 | Yardanico | stefanos82, ormin and karax maybe? at least public ones |
21:48:09 | * | NimBot joined #nim |
21:48:19 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:48:28 | stefanos82 | Yardanico: nice! |
21:49:38 | Araq | I'm working on Nim v1 fulltime |
21:50:44 | Araq | I also have 2 or 3 DSLs I will create for Nim. Eventually. |
21:51:20 | Araq | a parser generator among them. |
21:51:31 | stefanos82 | Nim v1 == mind blowing! |
21:53:46 | stefanos82 | btw Araq, does Nim uses all available CPU cores during compilation? |
21:53:59 | stefanos82 | *use |
21:54:31 | * | arecacea1 quit (Remote host closed the connection) |
21:54:34 | skrylar | well. petitparser is easy |
21:55:06 | * | arecacea1 joined #nim |
21:55:16 | skrylar | http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pdf although i'm not sure how araq feels on pegs/packrats |
21:56:30 | Araq | it's crap. ;-) |
21:57:06 | skrylar | i've had a lot of luck getting them to work on things, and a nightmare understanding the massive table-based ones |
21:58:25 | * | Ven`` joined #nim |
21:59:02 | FromGitter | <Quelklef> !eval let (x,_)=(0,0);var (_,y)=(0,0) |
21:59:05 | NimBot | <no output> |
21:59:08 | FromGitter | <Quelklef> Hmm |
21:59:33 | ng0 | Araq: if you don't mind asking, how old were you when you started working on nim? A couple of people currently looking into nim as their language wanted to know this for whatever reason/curiosity |
21:59:36 | stefanos82 | skrylar: yep...I'm pervert, every time I see a good looking PDF, it turns me on LOL! |
21:59:41 | FromGitter | <Quelklef> !eval let (x,\)=(0,0);var (_,y)=(0,0) |
21:59:43 | NimBot | Compile failed: in.nim(1, 8) Error: ')' expected |
21:59:59 | * | Ven`` quit (Client Quit) |
21:59:59 | FromGitter | <Quelklef> !eval let (x,_)=(0,0);var (_,y)=(0,0) |
22:00:01 | NimBot | <no output> |
22:00:03 | FromGitter | <Quelklef> Wth |
22:00:15 | FromGitter | <Quelklef> !eval let (x,___)=(0,0);var (___,y)=(0,0) |
22:00:17 | NimBot | Compile failed: in.nim(1, 9) Error: invalid token: _ (\95) |
22:00:25 | FromGitter | <Quelklef> I give up |
22:01:24 | stefanos82 | Araq: are there any benefits of separating a compiler to two parts, the back-end and the front-end, so that the back-end could work as a background daemon? |
22:01:43 | Araq | ng0, er... 23 or something |
22:02:00 | FromGitter | <Vindaar> @Quelklef what are you trying to do? |
22:02:11 | ng0 | wow. okay, thanks :) |
22:03:11 | FromGitter | <Quelklef> @Vindaar !eval let (x,UNDERSCORE)=(0,0);var (UNDERSCORE,y)=(0,0) |
22:03:19 | Araq | skrylar, sure but we have macros, you should just be able to look at the produced high level code to debug stuff |
22:03:20 | FromGitter | <Quelklef> I unfortunately don't have access to a laptop right now |
22:03:38 | FromGitter | <Vindaar> @Quelklef yeah, it works fine with underscores, no? |
22:04:05 | FromGitter | <Quelklef> Wym? It does italics and escaping it didn't work |
22:04:20 | FromGitter | <Quelklef> Or rather I don't know how to properly escape markdown code |
22:04:30 | FromGitter | <Vindaar> on your first try it simply returned `<no output>` because there's no output. And Gitter just eats the `_` to produce italics I believe (but the raw data is handed to `NimBot` just fine |
22:04:35 | FromGitter | <kaushalmodi> @Quelklef works fine |
22:04:40 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/Pz7h/image.png) |
22:05:22 | FromGitter | <Quelklef> Fantastic thank you @kaushalmodi |
22:05:32 | FromGitter | <Quelklef> Single underscore is a special name then? |
22:05:37 | FromGitter | <kaushalmodi> yes |
22:05:45 | FromGitter | <Quelklef> I see |
22:05:55 | FromGitter | <kaushalmodi> whatever is assigned to it is thrown away |
22:06:08 | FromGitter | <kaushalmodi> it's used as a placeholder for variable that you don't plan to use |
22:06:16 | FromGitter | <Quelklef> Right |
22:06:26 | skrylar | Araq, i think part of the problem is that the table systems often don't match up with the way code normally looks to a person |
22:06:29 | FromGitter | <Quelklef> I've seen it before just didn't know Nim had it |
22:06:49 | FromGitter | <Vindaar> Ahh! For some reason I thought you knew about `_` and were confused about something else :) |
22:06:59 | skrylar | there's a lot of fiddling with the syntax to get the L{whatever}'s to obey without shift/reduce conflicts |
22:07:05 | Araq | scanp almost got it right, except for the DSL part |
22:07:15 | FromGitter | <Quelklef> Haha @Vindaar nope! |
22:08:01 | Araq | sadly nobody took it and reworked it. instead we'll have much better pegs soon. |
22:08:33 | skrylar | ... so is the problem that pegs are bad, or the module is bad, or you just don't like that one particular implementation |
22:08:57 | FromGitter | <kaushalmodi> @Quelklef Here's one of the common uses: https://scripter.co/notes/nim/#writing-files (second code snippet.. *ignore the red highlighting.. Go Chroma syntax highlighter needs to detect `_` as valid identifiers*) |
22:09:14 | * | Jesin joined #nim |
22:10:18 | FromGitter | <Quelklef> Can't read it on my phone, the formatting is all messed up |
22:10:53 | Araq | skrylar, anything that doesn't use a lexer/parser split is bad in my opinion |
22:11:08 | Araq | pegs are nice as an alternative to regexes |
22:11:19 | skrylar | nothing stops you from using a separate lexer with a peg '_' |
22:11:20 | Araq | but I want my grammars to work on real tokens |
22:11:28 | FromGitter | <kaushalmodi> > the formatting is all messed up ⏎ ⏎ Argh..let me guess.. using Safari? |
22:11:57 | skrylar | petitparser i think can use literally any inputs, you just put in a different combinator at the bottom |
22:12:00 | FromGitter | <kaushalmodi> I'm not a webdev.. something that I am doing with font subsetting doesn't work on Safari, but works on Firefox/Chroma |
22:12:02 | Araq | skrylar, true but not supported by Nim's pegs module |
22:12:18 | skrylar | that's because *that module* sucks :^) |
22:12:24 | Araq | nor by Lua's which was the major source of inspiration |
22:12:49 | * | jamesroseman joined #nim |
22:12:50 | skrylar | need to dig out the pp and pp2 papers from the archives and look at them again; i think they're just a handful of functions |
22:12:57 | skrylar | with bookmark and seek triggers |
22:13:37 | Araq | I also like this hole NFA -> DFA -> hopcroft's optimizer pipeline to produce lexers matching hand crafted ones |
22:13:57 | skrylar | not familiar with hopcroft. i think i had a paper on the nfa/dfa thing though |
22:14:03 | skrylar | no idea where that one went |
22:14:16 | Araq | *this whole |
22:14:25 | Araq | lol, I will never get whole vs hole right... |
22:14:33 | skrylar | the whole hole :) |
22:14:56 | skrylar | the more languages in total a person speaks it seems the more they are allowed to be wrong in any of them |
22:15:17 | Araq | the thing is |
22:15:29 | * | riidom quit (Ping timeout: 248 seconds) |
22:15:33 | Araq | as my spoken English improved my writing declined. |
22:16:14 | Araq | my brain could easily write all the words I knew correctly, lacking knowledge of how to pronounce them |
22:16:48 | Araq | and now I'm as bad as John Q. Public |
22:18:11 | skrylar | at least we can beat up vala soon |
22:28:47 | ldlework | skrylar: in what sense |
22:29:22 | skrylar | ldlework, have been working on the gnome stack |
22:29:30 | ldlework | interesting |
22:29:37 | ldlework | soon be able to do gnome ui apps with nim? |
22:29:45 | skrylar | i don't know how soon of a soon that is |
22:30:00 | ldlework | skrylar: people in #techcrap are probably interested in that work |
22:30:31 | skrylar | we have fltk (i just got it in nimble) and haven't determined if its worth more effort, but it works. other than that, there's a -lot- of sloc to review |
22:30:43 | skrylar | maybe 70% done with glib, have gobject fiddled with |
22:35:04 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:36:51 | * | krux02 quit (Remote host closed the connection) |
22:41:33 | Araq | skrylar, thank you for submitting fltk, I'm eager to give it a try :-) |
22:43:01 | skrylar | its been around for quite a while :) |
22:43:44 | Araq | does fltk have a nice source code editor widget? |
22:43:52 | skrylar | it has the one nedit uses |
22:44:05 | Araq | hmm not sure what that means :D |
22:44:37 | skrylar | i don't know if it had the popup/margin support like scintilla does, but it will do colored text and such |
22:44:41 | skrylar | probably needs some care and attention though. looking through the one demo i cobbled for it, i forgot how fltk has all these weird niggles like if you don't set the font for a label then you just don't get one |
22:48:43 | * | gangstacat quit (Quit: Ĝis!) |
22:48:54 | skrylar | theres also no layout engine :F |
22:49:20 | dom96 | Does it work on macOS? :P |
22:52:13 | skrylar | yes but its ugly |
22:53:45 | skrylar | trying to find an old library for layouts that i found but lost the name. it wasn't miglayout, was a bit simpler |
22:55:47 | stefanos82 | dom96: should Nim functions work inside a nim.cfg or any .cfg file, or not? |
22:56:18 | FromGitter | <kaushalmodi> @Quelklef If you refresh that link (on phone), do you still see bad formatting (I'm guessing missing characters?)? What's your browser? |
22:56:57 | dom96 | stefanos82: not |
22:57:11 | dom96 | You can ask these questions to the channel, not directly to me. Others should know this. |
22:57:31 | stefanos82 | so, in my case with #8236 that crashing was caused correctly or improperly? |
22:58:14 | dom96 | a Nim crash is always a bug |
22:58:14 | Araq | there are no "correct" crashes |
22:58:40 | * | Jesin quit (Quit: Leaving) |
23:00:27 | * | jamesroseman quit (Ping timeout: 240 seconds) |
23:00:37 | stefanos82 | Araq: what I mean is that my probable incorrect way caused an unexpected behavior, thus the crashing whereas it should have returned a different message when such attempts occur |
23:00:50 | Araq | sure. |
23:00:59 | Araq | btw within a .nims file you can use procs |
23:01:16 | stefanos82 | yeah, inside .nims I know, because it's a nimscript |
23:01:27 | stefanos82 | but inside .cfg we cannot, isn't that correct? |
23:01:47 | Araq | yes |
23:02:14 | stefanos82 | so, is there a standard error message that I should have expected to be thrown at me? Something like "operation not permitted" |
23:02:25 | * | jamesroseman joined #nim |
23:02:27 | Araq | "invalid syntax", maybe |
23:04:56 | stefanos82 | if an operation is not recognized, is it automatically associated with nil? |
23:05:06 | Araq | no. |
23:05:41 | stefanos82 | that's interesting. Let me check something right away! |
23:06:51 | * | jamesroseman quit (Ping timeout: 240 seconds) |
23:08:30 | stefanos82 | Araq: OK, I removed getCurrentDir() from nimcache and attempted to compile it and got the following message: nim.cfg(3, 1) Error: identifier expected, but found '[EOF]' |
23:08:34 | stefanos82 | I guess this should be the expected |
23:18:46 | stefanos82 | Araq, a naive question please. What compiles the C code behind the scenes? Nim or a build mechanism, such as make and so forth? |
23:19:32 | Araq | Nim uses osproc.nim and calls the C compiler directly |
23:19:41 | stefanos82 | ah I see |
23:23:30 | stefanos82 | where is osproc.nim exactly and stupid GitHub cannot find it? |
23:24:48 | Araq | it's a stdlib module |
23:25:00 | stefanos82 | nevermind, i found it the standard way lol |
23:25:14 | stefanos82 | all I did was to go to documentation and press source to take me there |
23:25:24 | stefanos82 | bloody hell, GitHub got shittier |
23:26:15 | Araq | just like the Alien movies |
23:28:03 | * | gangstacat joined #nim |
23:30:20 | stefanos82 | Araq: I think Alien movies are simpler and easier to understand |
23:37:43 | stefanos82 | btw Araq, since you have a lot more experience than me with programming, when you add a copyright with a date, should it be only the starting year, like 2015 or something like 2015 - present? |
23:38:48 | Araq | afaik it doesn't matter, but you must not touch the lower bound later |
23:39:11 | Araq | so don't do 2015 and then edit it to 2018 |
23:39:41 | stefanos82 | yeah that's why I prefer the second suggestion, that is 2015 - present |
23:39:50 | Araq | yeah |
23:40:06 | stefanos82 | so I guess when you first added a file, let's say in 2015 it was the initial time you first released it |
23:40:12 | stefanos82 | and can be applied to this day |
23:40:42 | stefanos82 | and older files that you created when you first started Nim should have older dates |
23:40:49 | stefanos82 | I mean...I hope! |
23:45:57 | FromGitter | <Quelklef> @kaushalmodi yeah mobile safari. Still broken |
23:49:36 | FromGitter | <kaushalmodi> And if you can confirm, it works fine on Firefox, right? |
23:55:48 | * | BitPuffin quit (Remote host closed the connection) |