00:00:49 | * | askatasuna left #nim (#nim) |
00:02:26 | * | rockcavera joined #nim |
00:03:05 | FromGitter | <akavel> What does this error mean: `Error: type mismatch: got <proc (s: Stream){.gcsafe, locks: 0.}> but expected 'proc (s: Stream){.gcsafe.}' ... .tag effects differ` ? |
00:24:28 | * | vlad1777d joined #nim |
00:27:43 | FromDiscord_ | <demotomohiro> krux02, thank you! I added the text about how to refresh the screen in tui mode in my blog post |
00:32:54 | * | stefanos82 quit (Remote host closed the connection) |
00:35:10 | FromDiscord_ | <demotomohiro> @fvs, there is faster way to reverse bits |
00:35:17 | FromDiscord_ | <demotomohiro> http://aggregate.org/MAGIC/#Bit%20Reversal |
00:40:48 | FromDiscord_ | <demotomohiro> @akavel, you want to define an array like this? |
00:40:49 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/4D2B65bpMo2HC5Qg |
00:44:35 | fvs | demotomohiro, thanks. Nice page. |
00:46:30 | fvs | interesting to see bit operations on this page are all on unsigned ints |
00:51:30 | FromGitter | <akavel> @demotomohiro: thanks, this I already solved; any hints on the `.tag effects differ` error by chance? :) |
00:57:32 | * | jacobsin joined #nim |
01:06:26 | abm | i've got client service talking to server rest api with certificate authentication |
01:06:42 | abm | when running both services on local IIS everything goes smoothly |
01:06:58 | abm | but on azure the server doesn't seem to get the certificate |
01:07:33 | abm | anyone have any idea what could be the cause? |
01:13:15 | * | seni quit (Quit: Leaving) |
01:20:58 | FromGitter | <dandevelo> @abm maybe the certificate is not set up correctly on azure? |
01:22:07 | abm | shit, this is definitely wrong channel for this question |
01:22:19 | abm | sorry dandevelo |
01:23:04 | * | abm left #nim ("Leaving") |
01:30:26 | * | jacobsin quit (Ping timeout: 240 seconds) |
01:32:02 | * | jacobsin joined #nim |
01:32:15 | shashlick | too many bugs today |
01:36:12 | * | jacobsin quit (Ping timeout: 246 seconds) |
02:02:13 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:02:25 | * | banc quit (Quit: Bye) |
03:23:19 | * | banc joined #nim |
03:28:27 | * | theelous3 quit (Ping timeout: 240 seconds) |
03:32:53 | FromDiscord_ | <Geroro / Grey Ghost> Hi all! I'm trying to reimport a dll but the function I'm running in the dll isn't updating, do I have to clear a cache or something to reimport a dll? Thanks! |
03:35:16 | * | fvs left #nim ("leaving") |
03:37:56 | * | volkov joined #nim |
03:46:33 | leorize | @Geroro: have you unloaded the dll beforehand? |
03:58:38 | * | kapil____ joined #nim |
04:08:35 | * | nsf joined #nim |
04:38:43 | * | jacobsin joined #nim |
04:39:48 | * | dddddd quit (Remote host closed the connection) |
04:42:56 | * | jacobsin quit (Ping timeout: 250 seconds) |
05:03:02 | * | volkov quit (Remote host closed the connection) |
05:09:38 | * | jacobsin joined #nim |
06:11:51 | * | vlad1777d quit (Remote host closed the connection) |
06:14:04 | * | vlad1777d joined #nim |
06:17:52 | * | flaviu joined #nim |
06:18:46 | FromDiscord_ | <Geroro / Grey Ghost> I got it working after reading this, https://16bpp.net/page/hot-loading-code-in-nim , Thank you @leorize! :) |
06:37:27 | * | kapil____ quit (Quit: Connection closed for inactivity) |
06:55:27 | * | jacobsin quit (Ping timeout: 240 seconds) |
06:55:53 | * | narimiran joined #nim |
07:55:13 | * | kapil____ joined #nim |
07:55:22 | * | enow joined #nim |
07:59:22 | FromGitter | <timotheecour> how do we control name mangling of a proc with `nim cpp` ? |
07:59:56 | enow | If I want to call a nim function from js and pass it an array how do I go about to do that |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:02:51 | Araq | just pass it an array, Nim's arrays are mapped to JS's arrays |
08:04:44 | * | gmpreussner joined #nim |
08:09:40 | enow | oh neat thx! |
08:10:11 | enow | what if it's an object because I have a key value object |
08:13:14 | Araq | then it's the {key: value} JS object |
08:15:00 | FromGitter | <timotheecour> @araq any idea about my question above? how do i control name mangling of a proc in `nim cpp`: `proc foobar2(a: int) {.exportc: "FOO$1”.}` ⏎ => this will mangle as `__Z10FOOfoobar2x` instead of `_FOOfoobar2` (and will fail at `importc` time) |
08:15:49 | Araq | well you already know ;-) |
08:16:02 | Araq | exportc influences the C(++) name |
08:16:12 | Araq | not the name mangling that happens afterwards |
08:16:33 | Araq | so you need to play tricks with emit "extern C" or .codegenDecl |
08:28:07 | * | vlad1777d quit (Ping timeout: 240 seconds) |
08:28:19 | enow | or nice |
08:28:50 | enow | hm I'm getting something weird when I'm trying to output a string with console.log |
08:29:19 | enow | so in the compile code it turns out like console.log(toJSStr("123")) |
08:29:47 | enow | but if I evaluate toJSStr("123") in the developer console I get some weird utf-8 symbols |
08:30:14 | enow | and it throws: Uncaught URIError: URI malformed |
08:41:27 | Araq | then get your string handling right, Nim's strings are not JS's strings |
08:43:59 | Araq | there are a couple of thousand lines of example code that use Nim's JS backend and it's documented here https://nim-lang.org/docs/backends.html#backends-the-javascript-target but these docs are bad :-) |
08:44:06 | Araq | narimiran, more work... |
08:44:19 | narimiran | :) |
08:52:11 | * | jacobsin joined #nim |
08:55:05 | * | JustASlacker joined #nim |
08:56:28 | * | jacobsin quit (Ping timeout: 244 seconds) |
09:03:35 | * | floppydh joined #nim |
09:17:53 | FromGitter | <alehander42> enow: nim strings <=> js number arrays |
09:18:13 | FromGitter | <alehander42> nim cstring <=> javascript strings |
09:19:21 | FromGitter | <alehander42> you can write helpers/shortcut templates so you can do c"lala" or something instead of cstring"lala" |
09:20:06 | FromGitter | <alehander42> i agree it's a little confusing, but nim strings are mutable, so it's hard to represent them directly |
09:23:57 | * | oculux quit (Quit: blah) |
09:26:51 | FromGitter | <kayabaNerve> @alehander42 Just make everything immutable and declared at compile time. Ez. |
09:27:51 | FromGitter | <kayabaNerve> (just joking :P, not trying to suggest a serious idea or distract from the honest discussion about string intricacies) |
09:29:48 | FromGitter | <alehander42> :D it's a simple solution! |
09:30:18 | * | Vladar joined #nim |
09:30:51 | FromGitter | <kayabaNerve> KayabaLang. |
09:31:01 | FromGitter | <kayabaNerve> Give it 5 years and some AI researchers would declare it amazing |
09:31:21 | Zevv | Does anyone know about any Nim <-> z3 bindings? |
09:31:44 | FromGitter | <kayabaNerve> I could legitimately seeing a joke, half-esoteric language that treats it itself seriously becoming a specialized language. |
09:33:50 | FromGitter | <alehander42> i am sure some language tried that already :D |
09:34:38 | FromGitter | <kayabaNerve> I think there's a ton of semi-esoteric languages with wide spread advocacy. Just look at Elixir. That said, Elixir wasn't started as a joke, |
09:39:48 | * | tzui joined #nim |
09:40:34 | * | oculux joined #nim |
09:49:20 | * | neceve joined #nim |
10:02:41 | FromGitter | <mratsim> Brainfuck |
10:04:08 | * | oculux quit (Quit: blah) |
10:06:37 | * | Vladar quit (Remote host closed the connection) |
10:07:08 | * | Vladar joined #nim |
10:10:12 | FromGitter | <kayabaNerve> @mratsim Yeah but what group advocates widespread usage of it |
10:10:37 | FromGitter | <kayabaNerve> I mean like what if a BF-C combo become a premier language in Ai dev, or neural nets, or AR... |
10:16:00 | FromGitter | <mratsim> Interpreter devs are pushing Brainfuck as a standard language to test Interpreter and JIT implementations ;) |
10:22:14 | xace_ | leorize: Would there be big changes required to make your nim.nvim compatible with vanilla vim? |
10:23:28 | FromGitter | <timotheecour> @araq > so you need to play tricks with emit "extern C" or .codegenDecl ⏎ ⏎ see https://github.com/nim-lang/Nim/issues/10578 for my attempts, so far it doesn’t work but maybe you have a trick I haven’t though of? ⏎ My proposal is simple and implementation is probably quite simple; so it’s just a matter of agreeing on semantics [https://gitter.im/nim-lang/Nim?at=5c5ab5a078e1ed4103ee46e2] |
10:23:56 | Araq | .codegenDecl should work? |
10:24:26 | FromGitter | <timotheecour> see the issue i lnked to |
10:27:02 | Araq | proc foobar2(a: int) {.codegenDecl: """extern "C" $1 my_foobar1 $3""".} |
10:32:03 | Araq | IMO all we need an 'externc' pragma |
10:32:03 | FromGitter | <timotheecour> it doesn’t work, it’s the same issue as i mentioned in the linked issue |
10:32:51 | FromGitter | <timotheecour> U either get the proc optimized out, or using it gives u an error as it tries to use the wrong name: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5ab7d39221b9382d233bc0] |
10:33:27 | Araq | proc foobar2(a: int) {.externc: "my_foobar1", codegenDecl: """extern "C" $1 $2 $3""".} |
10:35:22 | FromGitter | <timotheecour> ok so we agree somethings currently missing, correct? |
10:36:07 | FromGitter | <timotheecour> if u have `externc: “my_foobar1”` isn’t `codegenDecl` redundant in above decl? |
10:36:27 | Araq | no because it adds the 'extern "C"' |
10:36:57 | Araq | ah typo |
10:37:04 | Araq | proc foobar2(a: int) {.exportc: "my_foobar1", codegenDecl: """extern "C" $1 $2 $3""".} |
10:37:10 | Araq | ^ try this variant please |
10:42:10 | * | PMunch joined #nim |
10:42:13 | FromGitter | <timotheecour> Ok! seems to work! |
10:42:16 | FromGitter | <timotheecour> thanks :) |
10:43:03 | FromGitter | <timotheecour> my point still holds though, we shd make by default `exportc/importc` work by themselves with both `nim c` `nim cpp` |
10:43:30 | Araq | yeah but the rules are unclear |
10:43:46 | FromGitter | <timotheecour> otherwise they’re always be issues when switching from `nim c ` to `nim cpp` or worse, when mixing shared libs |
10:44:10 | FromGitter | <timotheecour> rule 1 or rule 2? |
10:44:32 | FromGitter | <timotheecour> (in proposal in https://github.com/nim-lang/Nim/issues/10578) |
10:45:17 | * | oculux joined #nim |
10:45:58 | Araq | no, it's unclear what to do |
10:46:20 | FromGitter | <timotheecour> what’s the disadvantage of rule 1? |
10:46:53 | Araq | it breaks code, exportc already has a meaning and it's not that hard to understand |
10:47:09 | Araq | it means "don't optimize out and use this name in produced code" |
10:47:46 | Araq | the fact that C++ later mangles it is of no consequence, on some platforms C names are mangled too |
10:47:48 | FromGitter | <timotheecour> that would still hold under rule 1 |
10:48:20 | FromGitter | <timotheecour> it is of consequence: right now, `importc` doesn’t work with `exportc` |
10:49:23 | Araq | it is not exportc's business |
10:49:27 | FromGitter | <timotheecour> > on some platforms C names are mangled too ⏎ ⏎ that wouldn’t matter, it’d just apply the extern C behavior |
10:50:21 | Araq | well 'mangling: cpp' is a deadend, I'm not gonna reimplement C++'s mangling rules |
10:50:37 | FromGitter | <timotheecour> and u dont have to |
10:50:56 | Araq | and as I've argued before, it starts with clear names |
10:51:00 | FromGitter | <timotheecour> `mangling: cpp` would just skip adding `export C` |
10:51:32 | FromGitter | <timotheecour> ya, the name `exportc` actually suggests “c”, not “cpp" |
10:51:52 | Araq | yeah so it would be confusing, I would expect mangling: cpp to mangle it as C++ does, not that it translates to C++ and so it kinda works out |
10:52:24 | * | jacobsin joined #nim |
10:53:23 | FromGitter | <timotheecour> i dont’ understand; `externc:”foo” mangling: cpp` would be simply what we have today` |
10:53:29 | Araq | ok, so 'exportc' is misnamed, it already exists though and so we would need a deprecation period etc |
10:54:56 | Araq | maybe we can come up with a good name this time that does what it says |
10:55:01 | FromGitter | <timotheecour> ok now we’re talking; sure; we can have a transisiton flag `—experimental:exportcNoMangle` that ppl can enable and later would be come default |
10:55:56 | Araq | what 'exportc' currently does still needs to be possible |
10:56:23 | FromGitter | <timotheecour> yes, that’s the `mangling:cpp` i was talking about, and that was my `rule 2` |
10:56:54 | * | jacobsin quit (Ping timeout: 250 seconds) |
10:57:10 | FromGitter | <timotheecour> and that extends naturally to `mangling:d` `mangling:objc` |
10:57:14 | FromGitter | <kayabaNerve> Oh. Is it a known bug that some C files are only compiled with -f? |
10:57:19 | Araq | but I don't like this design. |
10:57:25 | FromGitter | <timotheecour> which part |
10:57:58 | FromGitter | <kayabaNerve> As in, if you delete nimcache and run `nim c`, the linker will claim C files are missing, but if you use `nim c -f`, it works? |
10:58:43 | Araq | all of it. You make exportc produce an extern "C" declaration which we then disable via more annotations. it's not "mangling:cpp" it's "noExternC" |
10:58:57 | FromGitter | <timotheecour> i want to be able to call `myDFun() {.exportc:”funname”, mangling:d .}` likewise with OBJC and C++ (C++ being priority obviously) |
11:00:18 | Araq | we don't have 'mangling:d' nor objective C nor C++, all we have is (avoid / doUse) ExternC |
11:00:43 | * | oculux quit (Quit: blah) |
11:01:16 | Araq | this stuff is already complex enough, don't pretend we have mangling when all we do is C++ code generation tinkering |
11:01:17 | FromGitter | <timotheecour> it actually makes sense, and can use it even without `exportc` for simple (common!) case of nim name maching un-mangled C++ name: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5abe7df04ef00644eafd65] |
11:01:23 | PMunch | The video of the meta-programming talk is now available and I've updated my article with it: https://peterme.net/meta-programming-in-nim-fosdem-talk-companion-post.html |
11:03:36 | FromGitter | <timotheecour> > You make exportc produce an extern "C" declaration which we then disable via more annotations ⏎ ⏎ my previous msg addresses this: u just need `mangling:cpp` for the common simple case, `mangling:cpp exportc` is not even needed |
11:05:24 | FromGitter | <timotheecour> > don't pretend we have mangling when all we do is C++ code generation tinkering ⏎ ⏎ it doesn’t require a C++ mangler, code generation as we already do is enough |
11:05:55 | Araq | what would mangling:cpp do without an externc? |
11:07:04 | FromGitter | <timotheecour> it would mangle `foobar1(a: int) as `_Z10my_foobar1x` (ie imply exactly the same as the CURRENT exportc) |
11:07:41 | Araq | but it wouldn't work at all with 'nim c'! |
11:07:42 | FromGitter | <timotheecour> ( i think u meant exportc, not externc) |
11:07:55 | Araq | (yes, sorry) |
11:09:19 | Araq | kayabaNerve: Nim is not a build system for C++ code, so yeah, sometimes you need to use -f. |
11:09:30 | FromGitter | <timotheecour> Correct! `mangling:cpp` would require `nim c`, or as future improvement, we could use existing libraries for that (D does that so it’s possible) |
11:09:49 | FromGitter | <timotheecour> Typo: would require `nim cpp` |
11:09:58 | FromGitter | <kayabaNerve> Araq: The code I'm referring to is C. |
11:10:07 | Araq | kayabaNerve: Nim is not a build system for C code, so yeah, sometimes you need to use -f. |
11:10:12 | FromGitter | <kayabaNerve> Lol |
11:10:24 | FromGitter | <timotheecour> so there’s no loss of functionality compared to what we have today |
11:10:30 | FromGitter | <kayabaNerve> That said, I'll take it this is a known issue, and I shouldn't produce a MWE and create a GitHub Issue? |
11:11:06 | Araq | there is an RFC for it or something and timothee has a patch :-) |
11:11:23 | FromGitter | <timotheecour> u can also have: `mangling:native` which means: `mangling:cpp` with `nim cpp` and `mangling:c` with `nim c` |
11:12:33 | FromGitter | <kayabaNerve> Thanks for the info |
11:12:35 | * | enow quit (Read error: Connection reset by peer) |
11:12:52 | Araq | and yeah I know that Nim is already so much better at building C code than cmake/make/tup/scons so that you demand a complete solution ;-) |
11:13:09 | FromGitter | <timotheecour> @kayabaNerve => https://github.com/nim-lang/Nim/issues/10441 |
11:14:41 | * | lritter joined #nim |
11:20:11 | FromGitter | <timotheecour> so unless u have a better proposal (that works transparently regardless we use `nim c` or `nim cpp`) and is as simple as `proc fun(){mangling:native|c|cpp|d|objc}` I think we shd go for it |
11:21:58 | FromGitter | <timotheecour> (w `mangling:cpp` being implementable today, the rest being left as future options that work well w that syntax) |
11:23:59 | Araq | better proposal: don't lie, add an 'externc' switch |
11:24:25 | Araq | better proposal 2: don't lie, add an 'noExternc' switch |
11:25:26 | FromGitter | <timotheecour> that’s the wrong default; it will break all code that uses `proc fun() {.exportc: "foo".}` the day they try to switch to `nim cpp` |
11:25:31 | xace_ | is "nim ctags main.nim" suppose to generate a valid ctags file? |
11:26:11 | FromGitter | <timotheecour> `exportc` already has `c` in it, so it’s not really a lie |
11:27:17 | Araq | no, that "only" breaks code then, that's my proposal 2 |
11:29:22 | * | stefanos82 joined #nim |
11:31:03 | FromGitter | <timotheecour> what’s the semantic of noExternc? ⏎ if it’s this, i’m ok ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5ac57713a2814df62b71ee] |
11:32:59 | Araq | yes |
11:33:54 | Araq | and while I'm in my bad mood... I really don't like Nimble's .nimble dir |
11:34:06 | FromGitter | <timotheecour> Ok so that’s same as my rule 1, but modified rule 2 to use `noExternC` instead of `mangling:cpp` ; not what I’d preferred but i can live with that |
11:34:30 | Araq | I cannot do 'nimble install pkg && cd pkg && nimble test' because Nimble doesn't install the tests |
11:35:04 | Araq | so I have to do 'nimble install pkg', 'git clone url', 'cd pkg', 'nimble develop', 'nimble test' |
11:35:32 | FromGitter | <timotheecour> ya i had to solve the same problem in my nimble-CI |
11:36:11 | FromGitter | <timotheecour> but `nimble install pkg` isn’t needed |
11:36:55 | FromGitter | <timotheecour> in fact it’s wrong |
11:37:00 | Araq | and even then Nimble's very idea of nuking the .git dir and redistribute the files just so that I can do 'import jester' and save a couple of keystrokes over 'import jester/jester' or something is bad |
11:37:46 | Araq | how do I ensure the dependencies exist when I don't use 'nimble install pkg'? |
11:38:00 | FromGitter | <timotheecour> nimble build |
11:38:37 | Araq | that only works for "binary" packages or whatever they are called |
11:40:04 | Araq | and the lack of 'git clone' means I cannot create PRs against packages easily |
11:41:07 | FromGitter | <timotheecour> > that only works for "binary" packages or whatever they are calle ⏎ ⏎ i think there’s a way to query whether it’s library-only or binary/hybrid; in latter case call nimble build |
11:41:45 | Araq | we're a small community, nimble makes it harder to contribute to existing packages because all I have is these 'pkg-1.0' dirs lying in a hidden .nimble directory |
11:42:08 | FromGitter | <timotheecour> well i’d never do a PR against that, u’d use `nimble develop`, always |
11:42:33 | FromGitter | <timotheecour> but I agree nimble would be better off using `git clone` instead of copying/re-arranging files |
11:42:57 | FromGitter | <timotheecour> in fact it should do exactly what `brew` does. |
11:43:41 | FromGitter | <timotheecour> actually scratch that last sentence; |
11:44:33 | Araq | Nimble solves an NP complete problem, "which packages version ranges work given these requirements" |
11:44:52 | Araq | that is not a problem that I've ever had in my entire life as a developer. |
11:45:34 | Araq | Instead I'm fine with using the latest version for all and fixing code until it works. |
11:45:53 | FromGitter | <timotheecour> i can tell u for a fact nimble does a much better job at that than D’s dub |
11:46:49 | Araq | Correction: |
11:47:03 | Araq | Instead I'm fine with using the latest version for all and fixing code until it works. And then having reproducible builds. |
11:47:22 | FromGitter | <timotheecour> but what u’re describing is brew’s model; only the latest is supported and u get a consistent echosystem of libs that work together; it requires a centralized repo; and is some work, but doable; and that’s what i had suggested we shd strive for |
11:47:40 | Araq | I remember agreeing with you :-) |
11:48:59 | FromGitter | <timotheecour> Good! it’s in fact very tightly coupled to having nimble-wide CI |
11:50:14 | federico3 | nimble-wide? |
11:50:58 | FromGitter | <timotheecour> https://github.com/nim-lang/Nim/pull/10247 |
11:51:58 | * | oculux joined #nim |
11:53:00 | FromGitter | <timotheecour> btw @araq not sure if u saw that: https://github.com/nim-lang/Nim/pull/10576/commits/bb1ddf004ae0c4c0cc04b93f234c5cabcb3b0909 ; it fixes ur echoBinSafe error, but then fails w `nim cpp` ; but we can use the `codegenDecl` workaround until `noExternC` is implemented |
11:53:54 | Araq | nah sorry, it's not good enough |
11:54:38 | Araq | what we instead need is a proc rawEcho(args: openArray[cstring]) that doesn't allocate that we can use for system.nim development |
11:54:50 | Araq | and we can implement 'echo' with rawEcho then |
11:55:33 | Araq | and actually this should be moved into a callback so that I can delegate barebones error logging to whatever I need to without using --os:standalone with its panic override stuff |
11:56:25 | Araq | there are a couple of callbacks that all of system.nim should be based on: |
11:56:28 | Araq | - onEcho |
11:56:36 | Araq | - onRaiseDefect |
11:57:13 | Araq | - onGetAllocator (but that's much harder as the memory subsystem requires features that no 'malloc' offers) |
12:00:22 | FromGitter | <timotheecour> Ya user-settable callbacks would be great; esp to override `echo` with `onEcho: write also file:line in color and also log` |
12:01:21 | FromGitter | <timotheecour> i’m glad u’re changing some `includes` to `import`, it really is saner; |
12:01:49 | Araq | bbl |
12:02:14 | FromGitter | <timotheecour> can’t we use a dummy GC (that allocates but never deallocates) for when GC is not initialized yet and we need procs that allocate (eg: `$`) ? |
12:14:01 | * | neceve quit (Read error: Connection reset by peer) |
12:14:14 | * | kapil____ quit (Quit: Connection closed for inactivity) |
12:21:56 | * | dddddd joined #nim |
12:39:53 | * | Snircle joined #nim |
12:51:59 | * | Cthalupa quit (Ping timeout: 268 seconds) |
12:52:35 | * | Cthalupa joined #nim |
12:52:42 | * | jacobsin joined #nim |
12:57:37 | * | jacobsin quit (Ping timeout: 268 seconds) |
13:10:40 | Araq | timotheecour: not easy to do, cannot use 'malloc' for embedded, cannot use mmap either |
13:11:05 | Araq | the only thing I could use is var fakeHeap: array[N, byte] |
13:11:21 | Araq | but then this bloats the exe with this array that is usually unused |
13:13:20 | Araq | btw "my platform does not have a heap" is yet another myth, you do have a heap unless your platform lacks global variables |
13:18:56 | * | rokups joined #nim |
13:26:57 | PMunch | Could be interesting for microcontrollers. Set a max binary size and use the rest for a virtual heap |
13:30:35 | Araq | sure but I don't want to pay for this array when I can use mmap |
13:37:46 | * | vlad1777d joined #nim |
13:46:33 | * | vlad1777d quit (Remote host closed the connection) |
13:47:40 | * | tzuii joined #nim |
13:48:29 | * | vlad1777d joined #nim |
13:50:03 | * | tzui quit (Ping timeout: 245 seconds) |
13:54:44 | * | nsf quit (Quit: WeeChat 2.3) |
13:57:27 | * | Cthalupa quit (Ping timeout: 240 seconds) |
13:58:33 | * | PMunch quit (Remote host closed the connection) |
13:59:18 | * | Cthalupa joined #nim |
14:11:31 | * | fanta7531 joined #nim |
14:17:06 | * | theelous3 joined #nim |
14:30:13 | * | jacobsin joined #nim |
14:30:15 | Araq | PMunch! aww we is gone |
14:30:28 | Araq | watched your talk, it's very nice |
14:31:55 | * | surma__ is now known as surma |
14:33:47 | xace_ | is there a video of PMunch's talk? |
14:34:02 | Araq | https://forum.nim-lang.org/t/4631 |
14:34:38 | * | jacobsin quit (Ping timeout: 245 seconds) |
14:36:27 | xace_ | That was fast, thank you. |
14:44:28 | * | askatasuna joined #nim |
14:49:55 | Araq | Error: unhandled exception: testresults\io.json(2, 186) Error: ] expected [JsonParsingError] |
14:50:08 | Araq | is testresults\io.json already gone? you bet. |
14:50:28 | Araq | but hey, at least my 'git status' is clean... ffs |
14:50:38 | * | nc-x joined #nim |
14:51:01 | nc-x | `Error: ] expected ` I get that error a lot of times when i run some tests locally |
14:51:56 | narimiran | hey nc-x, while you're here: take a look at the mobile documentation. it should be much better now than yesterday when you reported it |
14:54:17 | nc-x | narimiran: just looked at it. it looks fine except that I would love to have the index back ;D |
14:54:45 | narimiran | heh, never satisfied :) |
14:54:46 | nc-x | Maybe add a hamburger menu or something that opens up index and hides the docs |
14:55:05 | nc-x | :D |
14:55:31 | narimiran | nc-x: just a reminder, i'm a complete CSS newb ;) |
14:55:34 | nc-x | Also, IMO https://nim-lang.org/learn.html should also link to devel docs |
14:56:07 | narimiran | shit, you're right, i forgot to change it there (i did in documentation.html) |
14:56:23 | nc-x | narimiran: well consider this assignment for learning CSS ;P |
14:57:18 | * | narimiran looks in Araq's direction, he doesn't look very pleased with that idea |
14:57:53 | FromGitter | <alehander42> https://github-history.netlify.com/nim-lang/nim/commits/master/compiler/nim.nim |
14:58:04 | FromGitter | <alehander42> pretty cool app |
14:58:17 | FromGitter | <alehander42> (arrows left right) |
14:58:42 | narimiran | nc-x: i might consider this "crazy" style fixes, once i'm pleased with the content ;) |
14:59:12 | nc-x | 👍 |
15:02:08 | * | nc-x quit (Quit: Page closed) |
15:10:59 | * | PMunch joined #nim |
15:11:12 | * | shadowbane quit (Quit: Konversation terminated!) |
15:15:01 | * | shadowbane joined #nim |
15:20:03 | * | aguspiza joined #nim |
15:20:46 | xace_ | btw a little nitpick i have: Wouldn't it be reasonable to have links at the top of the forum to go back to the nim-lang.org website? or maybe even have all the links (blog, features, download, learn, documentation, forum, donate) at the top? |
15:23:16 | * | tzuiii joined #nim |
15:24:38 | * | kapil____ joined #nim |
15:25:41 | * | tzuii quit (Ping timeout: 246 seconds) |
15:32:48 | * | vlad1777d quit (Ping timeout: 252 seconds) |
15:34:59 | * | JustASlacker quit (Quit: Leaving) |
16:17:50 | FromGitter | <kaushalmodi> Araq: koch doesn't build on devel |
16:17:51 | FromGitter | <kaushalmodi> > lib/pure/streams.nim(49, 64) Error: can have an unlisted effect: ReadIOEffect |
16:18:09 | FromGitter | <kaushalmodi> looks relevant to that last commit maybe |
16:18:38 | * | vlad1777d joined #nim |
16:21:32 | narimiran | aaaah, so *that's* why my unrelated streams PR fails! |
16:26:03 | * | vlad1777d quit (Ping timeout: 268 seconds) |
16:30:27 | * | jacobsin joined #nim |
16:32:45 | leorize | xace_: yep, basically it's not possible to do TCP connection with vimscript in vim |
16:33:17 | leorize | not to mention that matchaddpos is terrible, I need the nvim buffer highlight API |
16:37:10 | * | Trustable joined #nim |
16:40:27 | Araq | bah |
16:40:44 | Araq | works for me |
16:41:10 | * | rnrwashere joined #nim |
16:41:50 | FromGitter | <kaushalmodi> Travis is failing |
16:42:15 | FromGitter | <kaushalmodi> See the run_CI koch failure |
16:42:46 | Araq | yeah, reproduced |
16:43:21 | xace_ | leorize: oki cool i'll try to grumble about it for a couple of hours and then give up |
16:43:47 | leorize | migrate to nvim! :P |
16:43:52 | Araq | narimiran, did you backport the streams.nim changes? |
16:44:20 | narimiran | when, what? |
16:45:36 | Araq | for 0.19.4 |
16:46:06 | xace_ | leorize: lol i wish i had the courage to take the first step |
16:48:29 | * | rnrwashere quit (Remote host closed the connection) |
16:49:59 | narimiran | Araq: the last two commits in streams.nim in 0.19 branch were some docs update in october |
16:50:26 | * | rnrwashere joined #nim |
16:50:40 | Araq | kk |
16:50:50 | * | fanta7531 quit (Quit: fanta7531) |
16:52:56 | * | jacobsin quit (Ping timeout: 240 seconds) |
16:53:23 | * | rnrwashere quit (Remote host closed the connection) |
16:55:03 | * | rnrwashere joined #nim |
16:55:05 | FromGitter | <alehander42> nice change in style of |
16:55:13 | FromGitter | <alehander42> css* of the manual narimiran |
16:55:31 | narimiran | thanks :) |
16:55:51 | * | rnrwashere quit (Remote host closed the connection) |
16:57:30 | * | nsf joined #nim |
17:01:12 | shashlick | Araq: you cool if I fix this https://github.com/nim-lang/Nim/issues/9370 cc @timotheecour @mratsim |
17:01:21 | shashlick | it is extremely annoying when working with C libs |
17:02:59 | FromGitter | <brentp> I am using `setMaxPoolSize(threads)` where, `threads` is, e.g. 12. Then I `spawn` ~600 and `blockUntil` they are all done. It appears that it always uses the number of CPUs available on the machine, even if I specify a single thread. Am I using that wrong or is this a known problem? |
17:03:28 | Araq | shashlick: sure |
17:03:53 | Araq | brentp: how do you specify the single thread? |
17:04:05 | FromGitter | <brentp> here is the actual code: https://github.com/brentp/somalier/blob/master/src/somalier.nim#L531-L550 |
17:04:16 | FromGitter | <mratsim> lgtm |
17:04:24 | FromGitter | <brentp> @Araq, I just mean, with `threads = 1` |
17:04:25 | FromGitter | <mratsim> @shashlick^ |
17:04:52 | shashlick | https://github.com/nim-lang/Nim/issues/10299 is the more overarching issue |
17:06:34 | shashlick | another question - is there any workaround for https://github.com/nim-lang/Nim/issues/9863 |
17:08:08 | Araq | don't use static in macros, it's confusing |
17:08:28 | * | rnrwashere joined #nim |
17:09:12 | shashlick | even without static, if I use `seq[string] = []`, it doesn't work |
17:10:02 | shashlick | Error: type mismatch: got <array[0..-1, empty]> but expected 'seq[string]' |
17:11:36 | Araq | @[] |
17:12:03 | FromGitter | <mratsim> static is the only way to pass values instead of Nimnodes to macros |
17:13:41 | * | PMunch_ joined #nim |
17:14:04 | shashlick | @[] gets forced to empty no matter wht I pass into the macro |
17:14:28 | FromGitter | <brentp> @Araq, here is a reproducer. on my (linux) machines, it uses all available CPUs even though I set pool size to 1. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Am I using this incorrectly? [https://gitter.im/nim-lang/Nim?at=5c5b15f47b68f94102806d91] |
17:14:34 | shashlick | Araq: http://ix.io/1AlD/nim |
17:14:34 | * | rnrwashere quit (Remote host closed the connection) |
17:14:40 | shashlick | if you run that, it will print Nothing |
17:15:04 | shashlick | ss.kind = nnkSym |
17:15:56 | * | PMunch quit (Ping timeout: 240 seconds) |
17:16:14 | * | rnrwashere joined #nim |
17:17:07 | Araq | proc setMaxPoolSize*(size: range[1..MaxThreadPoolSize]) = |
17:17:07 | Araq | maxPoolSize = size |
17:17:07 | Araq | if currentPoolSize > maxPoolSize: |
17:17:09 | Araq | for i in maxPoolSize..currentPoolSize-1: |
17:17:11 | Araq | let w = addr(workersData[i]) |
17:17:13 | Araq | w.shutdown = true |
17:17:32 | Araq | makes no sense to me, it needs to shutdown threads for 1 |
17:17:48 | Araq | but still it should work, maybe you spawn too quickly afterwards |
17:18:29 | * | d10n-work joined #nim |
17:20:20 | FromGitter | <brentp> even with `setMaxPoolSize(2); sleep(1000)`, it uses all CPUs. |
17:23:13 | * | PMunch_ quit (Remote host closed the connection) |
17:24:21 | * | aguspiza quit (Ping timeout: 246 seconds) |
17:26:19 | * | rnrwashere quit (Remote host closed the connection) |
17:28:59 | * | rnrwashere joined #nim |
17:31:26 | * | rnrwashere quit (Remote host closed the connection) |
17:33:39 | * | kapil____ quit (Quit: Connection closed for inactivity) |
17:34:35 | narimiran | @alehander42 if you notice some regressions or things that could be improved in the docs visual style, let me know (i already have some small fixes, but waiting for something more substantial before i push it :)) |
17:35:40 | narimiran | well, that goes for the rest of you too, not only for alehander ;) |
17:37:01 | shashlick | so is this a bug - http://ix.io/1AlD/nim - prints Nothing |
17:54:25 | * | rnrwashere joined #nim |
17:57:01 | * | jacobsin joined #nim |
17:57:34 | * | fanta7531 joined #nim |
18:01:34 | * | jacobsin quit (Ping timeout: 250 seconds) |
18:02:07 | * | volkov joined #nim |
18:10:06 | * | volkov quit (Remote host closed the connection) |
18:12:16 | Zevv | nimterop generates distinct ints instead of enums, is that new? |
18:12:44 | shashlick | it changed a month ago |
18:12:50 | leorize | it should be better than generating enums |
18:13:05 | shashlick | https://github.com/nimterop/nimterop/issues/99 |
18:13:28 | Zevv | Hmm ok. |
18:14:10 | Zevv | I'll fix those by hand, I like the ability to convert from and to strings |
18:14:16 | Zevv | for debugging and other purposes |
18:14:24 | leorize | well the `$` not printing the enum name can be solved by generating `$` |
18:14:28 | leorize | shouldn't be too hard |
18:14:37 | shashlick | do you mean $enum => enum |
18:14:44 | shashlick | @timotheecour has that same concern |
18:14:53 | shashlick | that thread discusses that |
18:15:04 | * | Zevv reading up |
18:15:20 | leorize | since you have a map of them anyway, building a `$` proc would be simple |
18:15:53 | Zevv | a map? |
18:16:14 | Zevv | I have a distinct type and a number of consts using the type |
18:16:25 | shashlick | the problem is when multiple names map to the same value |
18:16:47 | Zevv | I see, that kind of defies the purpose of an enum |
18:16:56 | shashlick | but C does crazy things with enums |
18:17:05 | Zevv | "C does crazy things" |
18:17:07 | shashlick | and hence it cannot be mapped to Nim enums which are more disciplined |
18:17:19 | leorize | there's a "hack" around that, but it's rather complicated |
18:17:22 | * | Trustable quit (Remote host closed the connection) |
18:17:31 | leorize | and I believe I've showed @shashlick before :P |
18:17:35 | Zevv | yes, but how is building a `$` simple, I need to provide this myself, I can not deduce that from the defined types, right? |
18:17:50 | leorize | Zevv: I was talking about nimterop :P |
18:17:50 | shashlick | leorize: I had the converter before but there was push back on that |
18:18:04 | Zevv | leorize: ah ok |
18:18:41 | shashlick | if you can give me a template that converts the enum name to a string, will be great 😄 |
18:19:13 | leorize | astToStr to the rescue :P |
18:19:21 | leorize | obviously doesn't work on runtime enums |
18:21:15 | leorize | or, you could make a `$` that prints "thisEnum or thisOtherEnum" :P |
18:21:29 | leorize | and pray that people don't mistake that as bitwise or |
18:22:24 | Zevv | I see the problem, but it is too bad that I lose enum semantics for all cases where the C enums are well-behaved |
18:22:35 | Zevv | pardon my complaining :) |
18:23:04 | Zevv | for example, the distinct int type is not limited to the enum values |
18:23:08 | shashlick | no worries - so the main thing you miss is being able to print the enum name? |
18:23:13 | leorize | most of the semantics doesn't work with C enum anw |
18:23:22 | Zevv | well, it doesn't *feel* like an enum anymore :) |
18:23:44 | leorize | you can say enum is a `distinct range[]` |
18:24:13 | * | rnrwashere quit (Remote host closed the connection) |
18:24:26 | Zevv | If the range is continguous the distinct int could be range limited |
18:25:06 | Zevv | but if not, then not, and then the behaviour is unpredictable |
18:25:35 | leorize | enum with holes is not really well treated in Nim as well |
18:25:37 | Zevv | there is simple no single good solution |
18:25:40 | leorize | you can't really `inc` them |
18:25:49 | Zevv | true |
18:26:12 | leorize | and `set[Enum]` can't be guaranteed to work with C |
18:26:34 | leorize | I saw people use it, but I think it's only working because of the current internals |
18:27:14 | Zevv | Ok, I'll just provide a few `$`s for the cases I need, then I'll probably be fine |
18:27:17 | Zevv | thanks for the info |
18:27:28 | shashlick | again, want to clarify - is the problem mainly printing the enum? |
18:27:37 | Zevv | at this time it is |
18:27:50 | Zevv | but then the next problem would of course be the other way around :) |
18:28:17 | shashlick | we can track values and print the enum name, but if there are duplicate values, you will get the first instance |
18:28:33 | leorize | you can print `or this value` :P |
18:28:42 | Zevv | would/could/should it make sense to make two cases of code generation. One for well-behaved enums, and one for the rest? |
18:28:56 | Zevv | so that nice enums still map to a Nim enum |
18:30:21 | shashlick | so traditional enum is painful since C enums can be out of order |
18:30:45 | shashlick | if we want to imlpement that, it would mean calculating and verifying the actual value and reordering |
18:31:00 | leorize | and that's basically implementing nimterop/nimterop#99 |
18:31:16 | shashlick | yes and i don't know if it is really worth it |
18:31:25 | shashlick | though @timotheecour thinks differently |
18:31:39 | shashlick | as it is, such tools become complex quickly and then maintenance becomes hard |
18:31:41 | * | jacobsin joined #nim |
18:32:06 | shashlick | but i could just as well be called lazy so I prefer staying open to ideas |
18:32:47 | Zevv | :) |
18:33:07 | Zevv | Anyway, I need to go. Thanks for the background info |
18:33:14 | Zevv | later! |
18:33:28 | leorize | the idea isn't too bad |
18:33:36 | leorize | but I found the argument rather inconvincing |
18:34:01 | leorize | the only thing I miss is `$` |
18:34:29 | shashlick | can you please explain |
18:34:36 | * | fanta7531 quit (Quit: fanta7531) |
18:35:15 | * | aguspiza joined #nim |
18:35:34 | leorize | from what I can read in nimterop/nimterop#99, these are the main reason: "type safety, and $ prints as int which is really not good" |
18:35:50 | leorize | of which I'd say using enum won't give us any more type safety |
18:36:01 | * | rnrwashere joined #nim |
18:37:19 | leorize | `distinct int` is as typesafe as an `enum` |
18:37:41 | leorize | sure, it won't bound check, but you can't get that with sparse enums either |
18:38:07 | * | rnrwashere quit (Remote host closed the connection) |
18:38:11 | shashlick | ok sounds fair, please share your thoughts on that issue - i'd rather keep the implementation as is so that we can focus on adding more support C/C++ declarations |
18:42:35 | FromGitter | <kaushalmodi> shashlick: Nim allows naming multiple deprecated enum names to the same enum |
18:42:57 | FromGitter | <kaushalmodi> not perfect, but that might at least remove a road block |
18:43:08 | FromGitter | <kaushalmodi> the code will compile but with deprecation warnings |
18:43:23 | leorize | that's basically a dirty hack |
18:43:46 | leorize | shashlick: ever thought of splitting nimterop facilities into Nim's macros? |
18:43:58 | shashlick | which portions? |
18:44:12 | leorize | split the cenum generating code? |
18:44:24 | shashlick | originally, toast only generated the AST to stdout and all rendering was done in cimport / compile time |
18:44:34 | shashlick | it is just much faster to do it in toast |
18:44:36 | leorize | it can be nice for others to use it without using nimterop |
18:44:45 | shashlick | since i can directly use the tree-sitter data structure |
18:45:18 | shashlick | otherwise i had to recreate the data structure at compile time |
18:45:29 | shashlick | plus restricted to the vm, but that didn't really affect much |
18:45:34 | shashlick | it was just slower |
18:45:43 | leorize | I see |
18:45:59 | shashlick | even toast could be done in compile time once you can ffi |
18:46:53 | leorize | I was hoping to see a cenum macro like this: `cenum Enum: eVal1 = 100, eVal2 = 10` |
18:47:17 | leorize | it's rather helpful when manually writing wrappers |
18:47:28 | leorize | but I guess we should automate everything nowadays :P |
18:50:14 | * | rnrwashere joined #nim |
18:51:46 | shashlick | no you are supposed to use nimterop and not hand write anything anymore 🙂 |
18:54:08 | FromGitter | <arnetheduck> shashlick, you were asking for examples for nlvm, but I can't really think of any better examples than nlvm itself.. |
18:56:22 | shashlick | sounds fair - what's a good file to look at |
18:57:39 | * | rnrwashere quit (Remote host closed the connection) |
18:59:03 | * | rnrwashere joined #nim |
18:59:45 | FromGitter | <arnetheduck> https://github.com/arnetheduck/nlvm/blob/master/llvm/llvm.nim probably.. it provides an easy-to-use interface over the raw c interface |
19:01:13 | shashlick | cool |
19:02:12 | FromGitter | <arnetheduck> then there's https://github.com/arnetheduck/nlvm/blob/master/nlvm/llgen.nim, but it might be a bit intimidating (I'm a happy code-folding user) |
19:11:23 | * | TheLemonMan joined #nim |
19:12:22 | TheLemonMan | leorize, fwiw vim does support TCP connections, see https://vimhelp.org/channel.txt.html |
19:13:30 | TheLemonMan | and if you want to abstract over the differences between vim and neovim's async implementation check out https://github.com/prabirshrestha/async.vim |
19:13:30 | * | housecarpenter joined #nim |
19:14:07 | TheLemonMan | it'd be nice to have the code-completion part at least, who cares about syntax highlighting |
19:17:58 | * | aguspiza quit (Ping timeout: 245 seconds) |
19:21:07 | * | tzuiii quit (Remote host closed the connection) |
19:24:48 | narimiran | TheLemonMan: completely offtopic: i love your punny package names! :) |
19:26:23 | TheLemonMan | hah thank you, that's my creative outlet |
19:39:59 | narimiran | btw, the content of your packages is also ok, i guess :P |
19:40:58 | * | lritter quit (Quit: Leaving) |
19:52:42 | * | smitop joined #nim |
19:53:40 | smitop | If I use a relative path from ``staticRead``, is it relative from the nim file calling it, the working directory the compiler is in, or something else? |
19:54:11 | TheLemonMan | the file it's written in iirc |
19:54:14 | * | nsf quit (Quit: WeeChat 2.3) |
19:59:13 | * | jacobsin quit (Remote host closed the connection) |
20:03:43 | * | Ven`` joined #nim |
20:08:39 | * | rokups quit (Quit: Connection closed for inactivity) |
20:17:25 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
20:21:23 | * | zachk joined #nim |
20:21:52 | * | rnrwashere quit (Remote host closed the connection) |
20:22:08 | * | zachk quit (Changing host) |
20:22:08 | * | zachk joined #nim |
20:28:56 | * | kapil____ joined #nim |
20:34:29 | FromGitter | <timotheecour> @araq > *<Araq>* Error: unhandled exception: testresults\io.json(2, 186) Error: ] expected [JsonParsingError] ⏎ ⏎ => there’s a recent issue about that that was closed; the fix: `rebuild koch` (the potential better fix: koch warns when it’s dirty based on `hash(koch.nim)` |
20:34:41 | * | aguspiza joined #nim |
20:41:40 | * | floppydh quit (Quit: WeeChat 2.3) |
20:53:49 | Araq | since you're here, https://github.com/nim-lang/Nim/pull/10150 |
20:56:18 | * | aguspiza quit (Ping timeout: 245 seconds) |
20:57:27 | livcd | so i was not able to try falcon hmmm...i get the same error on mac as i did on windows for nake: https://paste.fedoraproject.org/paste/A7f-5413Vxe2BcvdTk2zRA |
20:59:11 | Araq | execProcess("git", „“, ["--no-pager", "show", "-s", "--format=%ci", "HEAD"], |
20:59:11 | Araq | options = {poUsePath}) |
21:00:50 | Araq | #### Breaking changes in the standard library |
21:00:51 | Araq | - `osproc.execProcess` now also takes a `workingDir` parameter. |
21:02:33 | livcd | well ok i replaced it with what the git command gives |
21:03:14 | dom96 | Hey guys |
21:06:14 | livcd | well i am just running into more issues which i dunno how to solve: https://paste.fedoraproject.org/paste/0HLmWiI~5FKxBhLzuhCQQg |
21:13:27 | FromGitter | <deech> Is VSCode currently the best supported Nim editor? |
21:16:43 | * | narimiran quit (Ping timeout: 245 seconds) |
21:18:06 | livcd | yglukhov[m]: ping |
21:22:22 | FromGitter | <timotheecour> @araq: yeah, i intend to follow up on https://github.com/nim-lang/Nim/pull/10150 ; it was actually quite close , need to rebase and i know how to fix that CI failure; so many things to do… maybe this weekend |
21:22:50 | Araq | the PR queue is too long |
21:23:10 | Araq | and we need to do something about it |
21:23:18 | FromGitter | <timotheecour> well u can filter out stuff which has broken CI when viewing it |
21:23:22 | Araq | and yes, that's not your fault. ;-) |
21:23:40 | Araq | broken CI can also simply mean timeout, unfortunately |
21:24:34 | FromGitter | <timotheecour> how about we add a tag to indicate: WIP (with meaning: don’t look at my PR unless u’re nice and want to help) |
21:25:07 | Araq | and I've said before, if you're blocked because we don't merge quickly enough, consider working on a single timothee branch that you want to merge occasionally |
21:25:22 | * | housecarpenter quit (Read error: Connection reset by peer) |
21:25:41 | Araq | WIP PRs are noise for me, the github issue tracker is not anybody's personal todo list. |
21:26:42 | * | housecarpenter joined #nim |
21:26:42 | FromGitter | <timotheecour> well everyone does it and it actually helps to see what’s the current WIP PRs, but as a reviewer, u’re free to ignore these |
21:27:19 | FromGitter | <timotheecour> but i do care about the existing WIP PRS from others (eg that thing from krux02 to fix node comments in AST…) |
21:27:58 | Araq | I'm looking at that right now |
21:28:49 | FromGitter | <timotheecour> there’s a ton of good work from everyone that goes to waste because it’s 90% complete and the final push is not done, it’s sad |
21:29:03 | FromGitter | <timotheecour> (and ya, i have a lot of these) |
21:32:47 | * | Ven`` quit (Ping timeout: 240 seconds) |
21:33:27 | Araq | not much goes to waste, they stay open until somebody completes it and merges it |
21:34:37 | FromGitter | <timotheecour> well it’s a waste until those 86 issues materialize |
21:35:13 | FromGitter | <timotheecour> but they bitrot… and then the author abandons them (and yes, guilty of it) |
21:36:10 | FromGitter | <timotheecour> `s/abandon/neglect/` bc of shifting priorities |
21:38:21 | * | dragan joined #nim |
21:38:58 | FromGitter | <timotheecour> back to bootstrapping GC before GC is initialized: for platforms w malloc, we can use that; for platforms without it, we can have a CT flag with `—allocateScratchSpace=64000` => allows having a working `echo $(10, “foo”, bar)` while debugging system.nim |
21:40:50 | FromGitter | <timotheecour> avoids all those issues w not allowing `echoBinSafe` before `import io` or not allowing allocations in `gc.nim` |
21:43:08 | * | rnrwashere joined #nim |
21:43:36 | FromGitter | <akavel> Hi! I'm trying to write two mutually-recursive functions with `concept` parameters, and I'm getting an: `Error: generic instantiation too nested` - is it illegal to do? |
21:43:53 | * | rnrwashere quit (Remote host closed the connection) |
21:45:51 | dragan | Hi! |
21:47:02 | Araq | hi dragan welcome |
21:47:06 | FromGitter | <timotheecour> @akavel => https://github.com/nim-lang/Nim/issues/9422 |
21:51:23 | FromGitter | <akavel> @timotheecour hmm, the reply by Araq in #9422 says "exponential compiletimes are known and mysterious", but doesn't say anything about your "Error: too nested for type matching" nor my "Error: generic instantiation too nested"... :/ |
21:51:40 | FromGitter | <akavel> are those two errors "known and mysterious" too? or are they "known and non-mysterious"? |
21:53:42 | FromGitter | <timotheecour> it’s the same error i think; `too nested for type matching` error happens because nim compiler caps number of iterations (because, it’s exponential) |
21:54:06 | Araq | well the one exponential bug's cause is known now and a converter bug |
21:54:10 | FromGitter | <timotheecour> so u can tweak that number (as i did ) but it kicks the can down the road |
21:54:16 | Araq | we also had a fix for it, somewhere. |
21:54:55 | FromGitter | <timotheecour> but https://github.com/nim-lang/Nim/issues/9422 doens’t use converter |
21:54:56 | Araq | I also had a nice idea for concepts that I need to implement before concepts can move further |
21:55:21 | FromGitter | <timotheecour> i have a much better than `concept` |
21:55:30 | FromGitter | <timotheecour> more flexible, simpler to implement |
21:56:00 | FromGitter | <akavel> Should I try to simplify this to a minimal reducer and submit an issue on github? |
21:56:14 | FromGitter | <akavel> the case I have? |
21:56:15 | * | Vladar quit (Remote host closed the connection) |
21:56:45 | FromGitter | <akavel> it seems quite simple, so at first glance should be really easy to minimize |
21:56:46 | FromGitter | <timotheecour> @araq https://github.com/nim-lang/RFCs/issues/60 |
21:56:53 | FromGitter | <akavel> *reducer = reproducer |
21:59:11 | FromGitter | <timotheecour> @akavel maybe try to search if ur test case is a duplicate , if not, then definitely sure, maybe add test case to https://github.com/nim-lang/Nim/issues/9422 or create a new issue depending on ur finding |
21:59:35 | FromGitter | <timotheecour> (after minimizing) |
22:00:27 | Araq | ha, no, that's terrible |
22:01:02 | Araq | akavel: mutally recursive concepts sound uncomputable to me |
22:01:26 | FromGitter | <akavel> Araq: no, the concept is one :) |
22:01:42 | FromGitter | <akavel> just it has two procedures which are mutually recursive |
22:01:50 | FromGitter | <akavel> operating on the same one concept |
22:02:16 | * | smitop quit (Quit: Connection closed for inactivity) |
22:02:25 | FromGitter | <akavel> `proc foo(x: MyConcept)` and `proc bar(x: MyConcept)` |
22:02:26 | FromGitter | <timotheecour> at least post some code (a PR in ur scratch repo is easiest, else a gist ) |
22:03:07 | FromGitter | <akavel> foo calls bar in some cases, bar calls foo |
22:03:08 | Araq | well mutually depending generic procs are hard too |
22:04:08 | dragan | I just wanted to say that you are doing great job, Nim is great language, my first impressions |
22:04:13 | FromGitter | <akavel> Ok, so it seems I'm out of luck here? |
22:05:13 | FromGitter | <timotheecour> just post some code (the friendliest way is a PR if more than 1 file, or a gist is fine if a single file) and maybe we can see if there’s a better approach? |
22:05:24 | FromGitter | <timotheecour> (PR against ur own repo) |
22:05:25 | FromGitter | <zetashift> https://github.com/nim-lang/Nim/issues/8927#issuecomment-459982345 I'm excited :D |
22:05:46 | FromGitter | <akavel> @timotheecour Ok, I'll try, thanks. As to PR, what do you mean? |
22:06:29 | FromGitter | <akavel> @timotheecour Uh, right, well, ok, actually I already have this code in the repo already; |
22:06:39 | FromGitter | <akavel> the repo is in non-compiling state currently |
22:06:43 | FromGitter | <timotheecour> something that makes it easy for ppl to try out ur test case w a one liner: ⏎ `git clone foo && nim c -r bar.nim` |
22:07:08 | FromGitter | <akavel> Ahh, ok |
22:07:20 | FromGitter | <timotheecour> (friendlier than gist IF there’s more than 1 file involved) |
22:07:29 | dragan | I want to help with the documentation if you like |
22:07:59 | Araq | dragan: nice, contact narimiran[m] when he's awake |
22:08:08 | FromGitter | <timotheecour> @dragan => https://github.com/nim-lang/Nim/issues/10330 |
22:08:29 | FromGitter | <akavel> @timotheecour So, I've just uploaded last fixes which led to this error, so it's currently available for cloning at: https://github.com/akavel/nixme |
22:09:05 | FromGitter | <akavel> sorry, branch *nim* |
22:09:27 | FromGitter | <akavel> the default master is still Rust |
22:10:31 | FromGitter | <akavel> `git clone -b nim https://github.com/akavel/nixme` I suppose |
22:11:05 | FromGitter | <akavel> the problem is between lines: |
22:11:09 | FromGitter | <akavel> https://github.com/akavel/nixme/blob/0edc067225bb2db92dbc2d46dbc20a93d1796b1c/src/nixmepkg/nar.nim#L27 |
22:11:21 | dragan | Great then, I needed an analogue of fseek, fread, offset, but I can't find an example in the docs, so after I port my project I can start with that maybe :) |
22:11:24 | FromGitter | <akavel> https://github.com/akavel/nixme/blob/0edc067225bb2db92dbc2d46dbc20a93d1796b1c/src/nixmepkg/nar.nim#L60 |
22:11:39 | dragan | FileIO is crutial i think |
22:12:24 | Araq | on devel it's now in system/io.nim (still part of system, so no import required) |
22:13:15 | FromGitter | <akavel> `parse_node` calls `parse_directory`, which may again call `parse_node` (because directories obviously may contain other files/directories, etc.) |
22:14:02 | FromGitter | <akavel> and I need to pass some "Handler" type to these, which will have a few methods, namely "create_directory", "create_file", "create_symlink" |
22:14:31 | FromGitter | <akavel> I thought I could use concept for that, thinking it might be similar like trait in Rust, or interface in Go |
22:15:02 | FromGitter | <akavel> but given that it won't work like that, is there something else I could/should use here? |
22:15:12 | FromGitter | <timotheecour> @dragan lib/system/sysio.nim:52:12: proc c_fseek(f: File, offset: int64, whence: cint): cint {. |
22:15:30 | FromGitter | <timotheecour> (ripgrep is your friend … or nimgrep but ...) |
22:15:54 | FromGitter | <akavel> I couldn't find anything good in the Manual... but I'm totally a noob, I might have overlooked something |
22:16:27 | FromGitter | <akavel> so, any suggestions? @timotheecour ? |
22:16:56 | * | craigger quit (Ping timeout: 268 seconds) |
22:17:56 | FromGitter | <akavel> Should I create an object type? but I don't understand well if objects inherit methods in Nim? |
22:17:59 | * | craigger joined #nim |
22:18:00 | Araq | use streams.nim |
22:18:04 | FromGitter | <timotheecour> turns out `c_fseek` is not exported ; as a temporary workaround in ur code u can grep (better: ripgrep) for fseek => u find `proc c_fseek(f: File, offset: int64, whence: cint): cint {. ⏎ ⏎ ```importc: "fseeko", header: "<stdio.h>", tags: [].}` => and copy that to ur code``` [https://gitter.im/nim-lang/Nim?at=5c5b5d1c9221b9382d280118] |
22:18:19 | Araq | there is setFilePos |
22:18:25 | FromGitter | <akavel> also seem to have seen that "inheritance is deprecated" or something like that somewhere around Nim docs... |
22:18:43 | Araq | nah, it's not |
22:19:08 | Araq | inheritance is here to stay, methods will change |
22:19:38 | shashlick | Araq: after your io.nim change, we cannot open files at compile time anymore |
22:19:42 | FromGitter | <timotheecour> @araq https://nim-lang.github.io/Nim/io.html gives 404 |
22:19:52 | shashlick | system\io.nim(483, 9) Error: VM is only allowed to 'cast' between integers and/or floats of same size |
22:20:39 | shashlick | readFile and writeFile both worked fine before this commit |
22:20:47 | FromGitter | <timotheecour> ouch |
22:21:42 | * | Araq shrugs |
22:21:53 | Araq | we have thousands of tests for these things |
22:22:09 | Araq | add another one and fix the regression |
22:23:32 | FromGitter | <akavel> still, for now I should probably try replacing the concept with an object + methods with {.base.}? |
22:24:30 | shashlick | Araq: has the mapping changed? was "stdlib.system.X" - shouldn't it be the same? |
22:24:39 | Araq | shashlick: ah :D |
22:24:50 | shashlick | vmops.nim |
22:24:52 | Araq | well now it's system.io.X |
22:25:06 | Araq | good catch, but the tests should have caught it |
22:25:10 | shashlick | so no more stdlib? or stdlib.system.io.X |
22:25:24 | Araq | no, it's stdlib.io.X |
22:25:41 | Araq | package.realmodule.X (forwarding doesn't count) |
22:26:00 | shashlick | cool i'll fix later today |
22:26:15 | shashlick | while i'm in there, can we add copyFile, moveFile and related calls also to the VM? |
22:26:22 | shashlick | all file and dir operations |
22:27:58 | Araq | akavel: https://github.com/nim-lang/Nim/blob/devel/lib/pure/parsesql.nim#L639 this is how to write a parser |
22:28:31 | Araq | no dynamic binding, no concepts, no need to pretend that you don't know the involved types |
22:28:50 | shashlick | alternatively, can I add a macro that can add all exported procs of a module into the vm and put os/io in there |
22:29:03 | Araq | recursive descent parsing, was invented in the 50ies or something and still works better than anything else invented afterwards |
22:30:13 | Araq | shashlick: for the VM or for Nimscript? |
22:30:17 | FromGitter | <timotheecour> => `static: writeFile` doesn't work anymore since `system refactorings` · Issue #10585 · nim-lang/Nim (https://github.com/nim-lang/Nim/issues/10585) |
22:30:19 | shashlick | for the VM |
22:30:27 | Araq | hmmmm |
22:30:28 | FromGitter | <timotheecour> just filed: `static: writeFile` doesn't work anymore since `system refactorings` #10585 |
22:31:11 | FromGitter | <akavel> Araq: hmm, I'll have a look, but I really might not know the involved types: |
22:31:12 | shashlick | otherwise I have to write sad code like this - https://github.com/nimterop/nimterop/blob/master/nimterop/git.nim#L25 |
22:31:24 | FromGitter | <akavel> I want to be able to plug in various handlers |
22:31:31 | FromGitter | <akavel> of the AST |
22:31:56 | FromGitter | <akavel> while parsing - without having to build the full AST in memory |
22:32:17 | FromGitter | <akavel> a.k.a. "parsing events" |
22:33:18 | FromGitter | <akavel> like the whole XML parser libraries quagmire some years ago |
22:33:24 | Araq | I don't like parsing events at all but they are easy, give the parser a bunch of callbacks |
22:33:28 | FromGitter | <akavel> with "event parsers", "pull parsers", etc. |
22:33:55 | FromGitter | <akavel> So, proc fields, right? |
22:34:02 | FromGitter | <akavel> Like in the streams library? |
22:34:46 | Araq | right. |
22:34:58 | FromGitter | <akavel> Ok, thanks! |
22:35:06 | Araq | shashlick: bah, it's so sad that you convinced me |
22:36:06 | shashlick | Yay! |
22:36:41 | shashlick | Ok so continue to pick and choose procs or can I look into mass import |
22:37:29 | * | rnrwashere joined #nim |
22:37:45 | FromGitter | <timotheecour> 404 error => https://github.com/nim-lang/Nim/pull/10587 |
22:38:04 | FromGitter | <timotheecour> (PR, not issue) |
22:38:06 | shashlick | Assuming I can process a module ast and identify proc signatures at that point |
22:38:10 | * | rnrwashere quit (Remote host closed the connection) |
22:38:38 | Araq | no mass imports! |
22:40:23 | shashlick | Ok then generic code with white list? |
22:40:44 | shashlick | Basically from module import x y |
22:46:58 | Zevv | Is there a way to limit the visibility of templates to a block scope of another template? |
22:50:25 | Araq | declare the template inside a template |
22:50:28 | Araq | shashlick: yes |
22:50:31 | Zevv | oh that simple :) |
22:52:29 | * | stefanos82 quit (Remote host closed the connection) |
22:59:06 | * | NimBot joined #nim |
23:00:55 | * | rnrwashere joined #nim |
23:01:28 | * | rnrwashere quit (Remote host closed the connection) |
23:10:01 | * | rnrwashere joined #nim |
23:11:25 | * | rnrwashere quit (Remote host closed the connection) |
23:11:32 | * | rnrwashere joined #nim |
23:19:59 | Zevv | basic Z3/Nim working: http://paste.debian.net/plain/1065752 |
23:27:04 | Araq | nice |
23:29:13 | * | rnrwashere quit (Remote host closed the connection) |
23:32:46 | FromGitter | <timotheecour> @araq i’m fixing the regression introduced w `system refactorings` here: https://github.com/nim-lang/Nim/pull/10588; could i pretty-please have a merge-when-ci-passes so i can focus on reducing that PR queue we talked about? |
23:34:30 | Araq | then why do you add 'removeFile' to the VM |
23:34:57 | Araq | yay, compile-time bomb, nuke your $HOME by doing 'nim c' |
23:35:00 | FromGitter | <timotheecour> i explained why: it avoids yet-more error prone workarounds in CT client code |
23:35:17 | Araq | and I just explained why it's bad |
23:35:21 | FromGitter | <timotheecour> client code can already do that w `gorge “rm …”` |
23:35:49 | Araq | not on Windows |
23:36:07 | FromGitter | <timotheecour> u can’t rm files on windows shell? |
23:36:18 | Araq | no it's called 'del' |
23:36:18 | * | rnrwashere joined #nim |
23:36:55 | FromGitter | <timotheecour> so, same thing, client code can already do that at CT w `del`; it’s not making situation any worse, only better bc removeFile is safer alternative |
23:37:48 | FromGitter | <timotheecour> (and portable, and avoids catastrophic issues when a quoting bug in client code deletes wrong file w the shell workaround to removeFile) |
23:38:15 | Araq | 1. some protection in gorge would be nice. |
23:38:48 | Araq | 2. requiring a hack means it's not sanctioned. |
23:39:19 | Araq | 3. don't conflate feature additions with bugfixes. |
23:39:21 | FromGitter | <timotheecour> what i’m very happy to do (maybe in other PR) is an option `nim —sandboxCT:true` (in another PR) that would prevent certain things at CT |
23:40:11 | Araq | let me say it again: you have a problem, a valid one. Result: Nim has one more compile switch. |
23:40:31 | Araq | For everybody. |
23:40:38 | Araq | because hey, you had a problem. |
23:40:56 | Araq | it really pisses me off. |
23:41:44 | FromGitter | <timotheecour> git has a milliion and i can still use it, its cmd line is well designed; flags r there for a reason; I just put it in my user config ONCE and never bother looking at them again |
23:47:10 | FromGitter | <timotheecour> it’s like nim: it has a ton of features, but learning curve is mild bc u don’t need to learn all features before u can start using it; same w a well designed (orthogonal) cmd line: u can just ignore all `—advanced` cmdline flags and when u need it u can use it; it’s not like it’s in your face. I really don’t have a problem w clang/brew/git having more flags; the only thing that matters is sane defaults |
23:47:10 | FromGitter | ... so they’re not in your face. |
23:48:04 | * | theelous3 quit (Ping timeout: 246 seconds) |
23:48:44 | FromGitter | <timotheecour> for sake of moving on and fixing that regression (which blocks nimterop), i’ll remove `removeFile` from that PR and re-introduce it in a separate PR; ok? |
23:54:11 | * | smitop joined #nim |
23:54:25 | FromGitter | <timotheecour> Done => https://github.com/nim-lang/Nim/pull/10588/files |
23:57:15 | FromGitter | <timotheecour> exact same comment as what @shashlick said: ⏎ ⏎ > *<shashlick>* otherwise I have to write sad code like this - https://github.com/nimterop/nimterop/blob/master/nimterop/git.nim#L25 |