<< 23-12-2019 >>

00:04:05FromDiscord<Xydium> `Error: unhandled exception: 'sym' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]`
00:04:20FromDiscord<Xydium> @mratsim The macro produces this only if I try to use the result
00:04:51FromDiscord<Xydium> I.e. just using the macro to construct the CSP compiles, but adding `let (solution, status) = test.search` after doesn't
00:05:22FromDiscord<mratsim> what's the type of test.search
00:05:40FromDiscord<Xydium> `proc search*[T](problem: Problem[T]): (seq[(string, T)], SearchStatus)`
00:06:04FromDiscord<Xydium> `test: Problem[int]`
00:06:06*tane quit (Quit: Leaving)
00:07:09FromDiscord<Xydium> It's not a problem in the macro, the macro returns before the exception
00:07:11FromDiscord<mratsim> ah seems like it exists in the code you sent
00:07:27FromDiscord<Xydium> it wasn't implemented in that code though
00:07:42FromDiscord<Xydium> and the proc signature changed
00:07:45FromDiscord<mratsim> TNode sounds like an internal Nim VM type though
00:08:11FromDiscord<Xydium> Could it be that the debug compiler still optimizes out the macro because it's unused?
00:08:36FromDiscord<Xydium> And once I use the result of the macro, that optimization disappears and the error can occur
00:08:54FromDiscord<mratsim> I think you are trying to access an enum sym or symbol but you are no the wrong type or the wrong enum variant
00:09:32FromDiscord<mratsim> easiest way to debug macros if it compiles is to use them in an expandMacros block
00:09:47FromDiscord<mratsim> or put result.toStrLit at the end of the macro
00:09:59FromDiscord<mratsim> and copy-past the code directly (and comment out the macro)
00:11:12FromDiscord<Xydium> Oh.... it might be from the define macro instead
00:11:32FromDiscord<Xydium> but define happens before constrain, so that would be weird
00:11:42FromDiscord<Xydium> because I know constrain was called and returned
00:12:19FromDiscord<Xydium> oh, oh my
00:12:37FromDiscord<Xydium> yeah the expansion of the define macro is.... some ugly stuff
00:13:09FromDiscord<Xydium> wait no,
00:13:15FromDiscord<Xydium> it's because the toSeq is being inlined
00:13:15FromDiscord<Clyybber> @mratsim Nice
00:13:28FromDiscord<mratsim> use result.toStrLit then
00:13:37FromDiscord<mratsim> AFAIK one or the other expands everything
00:13:43FromDiscord<mratsim> including templates
00:14:00FromDiscord<mratsim> but in one of them you get the ugly gensym
00:14:15FromDiscord<Xydium> `test.addVariable("X", toSeq(1 .. 9))` is the result, looks normal to me
00:16:14FromDiscord<Clyybber> @mratsim Did the resulting binary size change in any meaningful way?
00:16:49FromDiscord<Xydium> It happens even if I only use manual function calls
00:17:44FromDiscord<mratsim> Ah yes forgot to measure that
00:22:16FromDiscord<mratsim> no change
00:26:46FromDiscord<mratsim> Ah this article was a good explanation of what I was feeling when trying to implement nested barriers: https://gameprogrammingpatterns.com/state.html
00:27:09FromDiscord<mratsim> I don't agree with the state pattern at the end though
00:30:12FromDiscord<Xydium> So, I tried compiling in 0.19.6 and get a different error
00:30:29FromDiscord<Xydium> `/playground/nim/lib/pure/collections/tables.nim(583, 12) Error: cannot instantiate: 'A'`
00:30:50FromDiscord<Xydium> `var assignment = newTable[Variable[T], T]()` is in the search function
00:31:41FromDiscord<Xydium> oh wait I see the issue
00:32:08FromDiscord<Xydium> I'm trying to return the TableRef[Variable[T], T] as a seq[string, T]
00:32:26FromDiscord<Xydium> And for some reason the compiler since 0.20 doesn't scream at me
00:33:54FromDiscord<Xydium> still doesn't fix it
00:42:35FromDiscord<Fern & Simula (They/Them)> anyone know of a good way to traverse a series of `DotExpr`?
00:42:42FromDiscord<Fern & Simula (They/Them)> i just can't quite figure it out
00:44:10FromDiscord<Xydium> What's the tree look like?
00:45:21FromDiscord<Fern & Simula (They/Them)> just figured it out haha
00:45:31FromDiscord<Xydium> Recursion? Recursion.
00:45:34FromDiscord<Fern & Simula (They/Them)> absolutely
00:45:51FromDiscord<Fern & Simula (They/Them)> the nice thing about compiletime procs is you know at compiletime if your recursion is too deep lmaop
00:46:10FromDiscord<Fern & Simula (They/Them)> although in this case, going that deep means really bad things lol
00:47:07FromDiscord<Xydium> solid
00:56:19FromDiscord<Fern & Simula (They/Them)> anyone have any examples of how to use `newIfStmt`?
00:57:39FromDiscord<mratsim> probably just newIfStmt(nnkElifStmt.newTree(expr, stmt), nnkElifStmt.newTree(expr2, stmt2), nnkElse(stmt3))
00:57:45FromDiscord<mratsim> or something like that
00:58:04FromDiscord<mratsim> see here: https://nim-lang.org/docs/macros.html#statements-if-statement
00:58:21FromDiscord<mratsim> ah it's ElifBranch
00:58:41FromDiscord<mratsim> going to sleep but in general, always keep the macro doc opened when you do macros ๐Ÿ˜‰
00:58:54FromDiscord<Fern & Simula (They/Them)> alright, thanks. this got real complex real fast, probably just gonna sleep on it haha
00:59:12FromDiscord<Clyybber> we should get something like https://github.com/alehander92/breeze into stdlib
00:59:12FromDiscord<mratsim> if you deal with a lot of conditional, synthesis has a lot of examples: https://github.com/mratsim/Synthesis
00:59:32clyybbergn8 y'all
00:59:34*clyybber quit (Quit: WeeChat 2.7)
00:59:36FromDiscord<mratsim> for example: https://github.com/mratsim/Synthesis/blob/master/synthesis/factory.nim#L370-L376
00:59:38FromDiscord<Fern & Simula (They/Them)> night fam
01:00:27*actuallybatman quit (Quit: leaving)
01:15:57FromDiscord<exelotl> what is this ! operator in !"foo"
01:18:03FromDiscord<exelotl> oh it's a deprecated way to make an identifier
01:27:45*azed quit (Read error: Connection reset by peer)
01:33:17*Hideki joined #nim
01:33:40*Hideki is now known as Guest92838
01:42:40*Guest92838 quit (Remote host closed the connection)
01:42:57*Hideki joined #nim
01:43:21*Hideki is now known as Guest33491
01:45:57FromGitter<bung87> @zevv can I use userdata in grammar level?
01:53:28*Guest33491 quit (Remote host closed the connection)
01:54:02*Hideki joined #nim
01:54:25*Hideki is now known as Guest78793
01:58:53*Guest78793 quit (Ping timeout: 260 seconds)
02:08:17FromDiscord<slymilano> Does anyone know of a very very hand holdy guide for cross compilation from a Mac OSX dev box to windows, linux and mac binaries?
02:19:04shashlickI already shared earlier but I prefer building on the target since you can run tests as well - cross compilation does not afford testing
02:25:40FromDiscord<slymilano> If you mean the travis ci .sh script unfortunately i've never used travis ci
02:27:29*Hideki joined #nim
02:27:53*Hideki is now known as Guest88776
02:29:17shashlickYa but it is a general comment, you can do the same on appveyor, azure pipes or whatever else
02:30:03shashlickAnd the point is that you just need to commit that yml file into your repo and enable your repo in Travis and it will work
02:30:34shashlickBut ya, you'd certainly prefer your own CI for familiarity
02:31:51*Guest88776 quit (Ping timeout: 258 seconds)
02:44:04*endragor joined #nim
02:48:28*endragor quit (Ping timeout: 260 seconds)
03:00:02FromDiscord<mfiano> How is the vim/neovim tooling for Vim currently? I tried about a year ago and felt it lacking. Looking forward to trying Nim again soon.
03:00:08FromDiscord<mfiano> Err for Nim
03:00:11disruptekpretty great.
03:00:41disruptek!repo alaviss/nim.nvim
03:00:42disbothttps://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 56โญ 8๐Ÿด
03:02:04FromDiscord<mfiano> Can it do symbol completion of external modules, recompile/display compiler output on a keybind, source code navigation (jump to definition), and or inline semantic analysis to catch problems before compiling?
03:02:36disruptekyes, except for ffi symbol resolution.
03:02:45FromDiscord<mfiano> Yes to which one?
03:03:02disruptekall of them.
03:03:20FromDiscord<mfiano> Is the last one new? It hadn't done that before.
03:04:22disrupteki just started with nim in april, so it's /all/ new afaic.
03:08:51FromDiscord<mfiano> Alright thanks. It's going to be new to me for sure. I've been using a single language for like 20 years
03:09:04disruptekenglish, i guess.
03:09:11FromDiscord<mfiano> PL
03:10:33disruptekthe suspense is killing me. what is it?
03:10:51FromDiscord<mfiano> Ha, Common Lisp.
03:11:08disruptekahh. well, this'll be quite a departure.
03:12:04FromDiscord<mfiano> Aye, considering it's had a lot of its features for decades, and even more I'll be missing. But change and the challenges involved can be good
03:12:44disruptekthe performance is addictive.
03:13:18FromDiscord<mfiano> I'm not a stranger to performance. CL compares with C, and in some applications can be much faster.
03:13:45disrupteksome. ๐Ÿ˜
03:14:20disruptekbut yes, if you've spent 20 with CL, you're a wizard alright.
03:14:39FromDiscord<mfiano> But the best kind of performance is interactive compilation. Never have to stop your main loop to change its functionality.
03:14:55FromDiscord<mfiano> Code writing performance trumps execution perfroamnce in my opinion.
03:15:16disruptektrue.
03:16:04disruptekmaybe you can write the missing repl for us.
03:16:14disruptekthere have been some abortive efforts in the past.
03:16:27*muffindrake quit (Ping timeout: 246 seconds)
03:16:32FromGitter<deech> In that case I wonder how you're making do with Nim's lack of a REPL.
03:16:42disruptekincremental compilation is one of the main goals for 2020.
03:16:54FromDiscord<mfiano> I noticed, though I think HCR has to become a bit more mature for that to have any good effect.
03:17:12disruptekone step at a time.
03:18:54*muffindrake joined #nim
03:21:03FromDiscord<mfiano> I have tried learning many other languages in the past but keep going back to Lisp. I want that to change with Nim.
03:21:36disruptekwhy is that?
03:24:07FromDiscord<mfiano> 2 reasons. CL is good at rapid prototyping ideas into working code, arguably better than a language like Python (where I came from). There is no disconnect of flow to stop and recompile, etc. Also, because I'm old and heavily invested. It'd take another lifetime to rewrite my stack in a new language.
03:25:09disruptekno, i understand CL. i want to know what's attracting you to nim.
03:26:51disruptekor do you just want the new-language-new-paradigm-assimilate-new-techniques-into-existing-language thing?
03:27:38FromDiscord<mfiano> I'm a professional game developer, and it seems to have a niche for that. I also like terse languages with gradual typing, and of course the performance. The challenge is another reason. Finally, and probably a really big reason, is I like Vim, and Lisp is heavily tied to Emacs to get the most out of it.
03:28:29disruptekdo you use parinfer?
03:28:37FromDiscord<mfiano> No I can't stand it.
03:28:42disruptekwhy is that?
03:29:33FromDiscord<mfiano> Because I like structural editing - changing the shape of my code with parentheses-manipulating commands, rather than trying to do it automatically based on indentation.
03:29:34disruptekwe can always use more fp people. i think it's a weak point for nim, despite the obvious.
03:30:53disruptekand vim people are, of course, highly prized. ๐Ÿ˜‰
03:31:32FromDiscord<mfiano> Well Lisp isn't really a functional language, but I get what you are saying.
03:33:05disrupteksend !help to disbot -- he's pretty useful.
03:33:38disruptekand #nim is your best bet for support.
03:33:57disruptekand i'm biased, but i think this is the best package manager:
03:33:59disruptek!repo nimph
03:33:59disbothttps://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future ๐Ÿงš 15 26โญ 1๐Ÿด 7& 1 more...
03:35:26FromDiscord<mfiano> Well first stop I guess is getting nvim configured. Then I will probably read the documentation from start to finish because that's how I learn. So it'll probably be a while before I get to playing around with code, or the tooling involved like package managers ๐Ÿ™‚
03:36:18disruptekoh jump in. it's just python done right.
03:36:44*mfiano joined #nim
03:37:35FromDiscord<mfiano> I think the biggest disadvantage of Nim is the size of the community, but I am hopeful that will change.
03:38:19disruptektrue, it's a problem.
03:40:14FromDiscord<mfiano> I believe a language is like a tripod. 1 leg is the stdlib, 1 is the tooling, and the other is the ecosystem. Take out one and it falls over flat. Hopefully Nim can grow before it does so
03:41:05FromDiscord<mfiano> It's why I normally don't pay attention to most languages in the sea of toy languages. The situation is like Linux distros of the early 2000's
03:42:10disruptektrue, but nim has the technical chops. it just needs stdlib and tooling improvements, imo.
03:43:00FromDiscord<slymilano> I think it needs better guides for common scenarios and features you would build in other more mainstream languages.
03:43:07FromDiscord<mfiano> It has enough of that to gain the momentum needed for contributors to do the rest. But it needs contributors, which needs users.
03:43:30disrupteki think the stdlib will largely sort itself out, but i think we need to give people a tooling experience that meets or exceeds that of rust. that's one of the main things that has helped rust, in my opinion.
03:44:08yumaikasdisruptek: What makes you think that the tooling situation is the major win of rust? and where is Nim lacking there?
03:44:30FromDiscord<mfiano> I found it interesting that Nim is rated #1 systems language over Rust, on Slant
03:44:30disbothttps://github.com/nim-lang/Nim/issues/1 -- 5Trojan horse reported by avira free-av during the setup (installer)
03:44:35FromDiscord<mfiano> Despite the user count
03:44:45disruptekdisbot: hush.
03:44:46disboton it. ๐Ÿ‘
03:45:12disruptekthe rust tooling is nice to use. i think that matters to new users.
03:45:50disruptekdo you think slant means anything? when i've visited the site, it hasn't impressed me as an authority.
03:45:56FromDiscord<mfiano> I know Rust fairly well, and I'm not impressed. There is a big problem with the language I've seen for a long time and is only recently being discussed in the community.
03:46:07yumaikasmfiano: What is that?
03:46:53disrupteki don't know if my experience is typical, but i've had nothing but problems with fitting nimble into my workflow. choosenim was even worse.
03:47:22yumaikasHrm... I've not had much trouble with nimble, but I've only ever used it to install things
03:47:33yumaikasI've yet to package anything using it
03:48:02disrupteki'm sure i'm in the minority, but i don't have the sense that it's a small minority.
03:48:18FromDiscord<mfiano> If you building anything significant, you're pulling in a lot of dependencies, which in turn pull in dependencies transitively. And because you can version dependencies at each level, it means the same libraries are compiled and linked multiple times, and it really slows down compilation. The Rust community's answer to that, is to sacrifice performance by making more use of generics for dynamic dispatch, which I find quite funny and sort of
03:48:22yumaikasdisruptek: You have a place where your problems are documented?
03:48:24FromDiscord<mfiano> If you're building anything significant, you're pulling in a lot of dependencies, which in turn pull in dependencies transitively. And because you can version dependencies at each level, it means the same libraries are compiled and linked multiple times, and it really slows down compilation. The Rust community's answer to that, is to sacrifice performance by making more use of generics for dynamic dispatch, which I find quite funny and sort
03:48:35disruptekyumaikas: yes, in nimph.
03:48:43yumaikasnimph?
03:48:49disruptek!repo nimph
03:48:49FromDiscord<mfiano> I see a lot of projects making more use of generics at the expense of runtime performance to combat compile times.
03:48:49disbothttps://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future ๐Ÿงš 15 26โญ 1๐Ÿด 7& 1 more...
03:49:04FromDiscord<mfiano> Even though the Rust compiler is 3x faster than it was a couple years ago, it's still a huge problem.
03:49:16yumaikasmfiano: So rust has a version of the npm problem?
03:49:20FromDiscord<mfiano> Something to keep in mind when Nim has a large software ecosystem
03:50:21FromDiscord<mfiano> Pretty much
03:50:43*dddddd quit (Remote host closed the connection)
03:50:46disrupteknim doesn't have this problem yet because its module system is comparatively simple. i don't see it as a primary limitation, either.
03:51:02FromDiscord<mfiano> These things could be solved with hot code reloading and iterative live recompilation at the function level. But that's a lot of work.
03:51:15yumaikasEspecially for rust, I'd imagine
03:51:51yumaikasRandom question: Is there a way to mark a variable as thread safe?
03:52:06disruptekthe module system will need an upgrade, but probably not in the next year, imo.
03:52:48yumaikasLike, I have some globals that are set once on application startup using let, but the compiler warns me about them not being threadsafe
03:53:27disrupteki dunno, i'm not bothering with threading before weave.
03:53:35FromDiscord<mfiano> I would think something immutable should be thread safe. I wonder why that is
03:53:37yumaikasweave?
03:53:39disruptekasync is fine for my purposes.
03:53:42disruptek!repo weave
03:53:43disbothttps://github.com/mratsim/weave -- 9weave: 11A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead 15 84โญ 6๐Ÿด
03:55:34yumaikasmfiano: Well, specifically, I'm in jester, which marks it's main router with {.gcsafe.}, which starts complaining about global state
03:55:41yumaikas{.threadvar.} doesn't work
03:55:41FromDiscord<mfiano> Another thing I wish Nim had was a dead tree book. Yes I know about the dated one that already exists, but I don't want to read it, especially as a beginner, being so old and running into lots of problems.
03:56:15disrupteksome effort has gone into keeping that book relevant.
03:56:37disrupteki wouldn't worry about problems, is my point.
03:57:18disruptekalso, i wouldn't worry about reading it. but, i say that from one old-timer to another.
03:58:20yumaikasI think I'll try to help look over the jester docs some over the holiday, depening on what sort of time I have free
03:58:30FromDiscord<mfiano> I'm gonna set up nvim now. Then think about how I want to start learning Nim (I only browser the docs so far, mostly type system and syntax)
03:58:38FromDiscord<mfiano> I'm gonna set up nvim now. Then think about how I want to start learning Nim (I only browsed the docs so far, mostly type system and syntax)
03:58:41disruptekeverybody has that period where they chafe against the language, but eventually you find your compass.
03:59:17yumaikasdisruptek: Are you talking about rust, or nim?
03:59:27disrupteknim.
03:59:57yumaikasI definitely experienced that with rust
04:00:01yumaikasNot nearly so much with Nim
04:00:24disrupteki didn't code in rust long enough to get the compass.
04:00:30yumaikasNor me
04:00:47disrupteki picked up python in like '96 or so.
04:00:52disruptekit fit my brain instantly.
04:01:16disruptekcan't say nim was the same, but it's a much larger language, also.
04:01:36yumaikasI won't say that *everything* about Nim has fit my brain. The standard db libs took a bit of getting used to
04:01:46yumaikasI still don't bother writing macros much
04:02:00yumaikasdisruptek: Python is also much bigger than it was in '96
04:02:18FromDiscord<mfiano> Macros are good for only 2 things.
04:02:24disrupteki wrote a lot of macro stuff for openapi. i'm glad i did that. but i don't feel i need that power most of the time.
04:02:38disruptekmuch more important to me to write the simplest possible code.
04:02:40FromDiscord<Xydium> @mratsim Figured out why the compiler was crashing: I tried to pass an iterator as a sequence without actually converting it to a sequence. Any compiler after 0.19.6 crashed, and 0.19.X compilers gave me a completely unrelated error in a completely different part of the code
04:03:25yumaikasdisruptek: Yeah. I've gotten a *lot* of mileage out of templates. I even have one (currently on my work machine) called patch, which is basically an awk-lite
04:04:40disruptekhonestly, there are still sharp edges in nim that make simple code more attractive to me right now.
04:04:59FromDiscord<mfiano> Can you elaborate on that?
04:04:59yumaikassuch as?
04:05:33disrupteki mean, you run into them whenever you stray from the beaten path. mratsim has them hotkeyed.
04:05:53disruptekbut i have a few favorites.
04:05:58*yumaikas can think of the lack of being able to splat args with a macro
04:06:03FromDiscord<Xydium> considering I've spent the past 24+ hours hating macros and the type system for reasons I never expected, I think I understand lol
04:06:05disruptek!issue author:disruptek exceptions
04:06:06disbothttps://github.com/nim-lang/Nim/issues/11088 -- 5Exceptions, raises pragma hard to use at best
04:06:08disruptek!issue author:disruptek exception
04:06:09disbothttps://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling 7& 2 more...
04:06:31disruptek!issue mutable iterator
04:06:32disbothttps://github.com/nim-lang/Nim/issues/12945 -- 3mutable iterator cannot yield named tuples 7& 4 more...
04:06:58disruptek!pull varargs
04:07:01disbothttps://github.com/nim-lang/Nim/pull/12907 -- 3lenVarargs: number of varargs elements 7& 29 more...
04:07:50disruptek!issue author:disruptek inheritance generics
04:07:51disbothttps://github.com/nim-lang/Nim/issues/12818 -- 3inheritance and generics and ambiguous error message
04:08:14disruptek!issue author:disruptek httpheaders
04:08:15disbothttps://github.com/nim-lang/Nim/issues/12211 -- 3proposed changes to HttpHeaders as in HttpClient
04:08:28disruptekadmittedly, a stdlib issue.
04:09:35disruptekhanging out in irc, you tend to get what may be a bit of a selection bias with respect to what works and what people run into problems with.
04:10:01yumaikasdisruptek: Since IRC folks tend to push the edges?
04:10:11disruptekno, because people come here for support.
04:10:26*yumaikas wonders what len varargs[untyped] would be used for
04:10:27yumaikasah
04:10:49yumaikasYou think it biases towards new people problems?
04:11:16disruptekno, it biases me towards thinking that what i see here is representational of what others are experiencing.
04:11:23yumaikasAh, I see
04:11:41disruptekit's probably not -- i just see many people come in with choosenim issues that are solved by reinstalling, for example.
04:12:09disruptekso, because i don't use choosenim, i get the feeling that it's spray-and-pray.
04:12:31*endragor joined #nim
04:12:36disruptekprobably unfair to choosenim.
04:13:14yumaikasPossibly. Isn't choosenim based on a shell script?
04:13:15disruptekanyway, it's the case with lots of rough edges. it predisposes me to simpler code that i know will work today and tomorrow.
04:13:37disrupteki dunno much about choosenim, but i don't believe it's shell.
04:13:42yumaikasI think I used it on my older box
04:14:11FromGitter<bung87> pythonโ€™s `getattr` in Nim ? is there one?
04:14:32yumaikasI think I used it to get things set up on my older ubuntu box
04:14:44disruptekbun87: not really, no. there's a fields iterator...
04:15:33FromGitter<bung87> ah, maybe can be use or not..
04:16:03yumaikasbung87: What are you trying to do? Is it something that you could do with Optional[T]?
04:16:45FromGitter<bung87> it access object property by string name
04:17:02yumaikasbung87: Why are you trying to do that?
04:17:44FromGitter<bung87> hmm, thinking Nim is static type, I may consider other way
04:18:33yumaikasYou could always use the tables module, if you need dynamically specified access to something
04:18:54FromGitter<bung87> just want a ActiveRecord lib ,I have found a python implement
04:19:16yumaikasActiveRecord specifically, or an ORM?
04:19:27yumaikas!disbot norm
04:20:01FromGitter<bung87> I โ€˜v looked at it ,seems it not comple
04:20:09yumaikashttps://github.com/moigagoo/norm
04:20:14yumaikasThere's stuff like norm
04:20:46FromGitter<bung87> not really like this one
04:21:03disruptek!repo ormin
04:21:04disbothttps://github.com/Araq/ormin -- 9ormin: 11Ormin -- An ORM for Nim. 15 103โญ 14๐Ÿด
04:21:44FromGitter<bung87> yeah I also know this one, but it not finished
04:22:09disruptekit's finished, just not very well documented.
04:22:50FromGitter<bung87> ah? the document described it has three todo task.
04:27:04*yumaikas wonders if it'd be possible to make the search bar not hide in nim docs when they get narrow
04:28:30FromGitter<bung87> can using css `position: sticky;`
04:29:58yumaikasI know it's possible, but someone needs to do it at some point, IMO. I don't like it when funcitonality disappears because my aspect ration went down
04:32:23FromGitter<bung87> well, that can be controled through media query
04:32:50yumaikasRight, I know that can be done, I'm just considering putting in a PR for it at some point.
04:33:56yumaikasbung87: What brings you to nim?
04:33:59FromGitter<bung87> also I aware of that the search xhr request is sync
04:34:24yumaikasThe search xhr is sync? That doesn't seem right
04:35:18FromGitter<bung87> I cant rember , just Nim is my favorite language now, even I dont use it on work.
04:36:26FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/1SfJ/Screenshot-2019-12-23-at-12.36.13-PM.png)
04:36:57yumaikashuh, strange
04:38:05yumaikas(I didn't write that code, just seems strange that sync XHR is part of that, is all)
04:40:01FromDiscord<mfiano> Trying to set up my editor. I installed latest nim stable with choosenim, but nimsuggest errors when I run it
04:41:38*yumaikas doesn't even have nimsuggest running on his linux server atm
04:41:44FromDiscord<mfiano> Not even nimble works
04:42:10FromDiscord<mfiano> heh or `nim`
04:42:23disruptekmaybe it's not in your path?
04:42:28yumaikasYou give your $PATH a chance to update?
04:42:30FromGitter<bung87> look care of your PATH
04:42:32FromDiscord<mfiano> It is. I even get completion of them
04:42:44yumaikasXD
04:42:59yumaikaswhat kinds of errors are you getting?
04:43:20FromDiscord<mfiano> `Error: Spawning of process failed. (Error was: Additional info: "Could not find command: \'/home/mfiano/.choosenim/toolchains/nim-1.0.4/bin/nim\'. OS error: Permission denied")`
04:43:29FromDiscord<mfiano> The file exists and permission was set
04:43:51yumaikaswhat happens when you type `which nim`?
04:44:20disruptekwell, i think i mentioned that i'm not a fan of choosenim.
04:44:55FromDiscord<mfiano> `/home/mfiano/.nimble/bin/nim`
04:45:05*yumaikas suggests reinstalling choosenim, since that seems to have worked for other people, per disruptek
04:45:21yumaikashuh
04:45:33FromDiscord<mfiano> ```
04:45:33FromDiscord<mfiano> ./.nimble/bin/nim
04:45:33FromDiscord<mfiano> Error: Spawning of process failed. (Error was: Additional info: "Could not find command: \'/home/mfiano/.choosenim/toolchains/nim-1.0.4/bin/nim\'. OS error: Permission denied")
04:45:34FromDiscord<mfiano> ```
04:45:54yumaikasAnd what happens if you ls that folder?
04:46:13yumaikas`ls` the nim-1.0.4/bin folder, that is
04:46:30yumaikasYou might need to chmod +x some stuff?
04:46:39FromDiscord<mfiano> ```
04:46:39FromDiscord<mfiano> mfianomfiano@wyvern ~$ ls ~/.choosenim/toolchains/nim-1.0.4/bin
04:46:41FromDiscord<mfiano> .rw-r--r-- 5.0M mfiano 2019-12-22 23:26 nim
04:46:43FromDiscord<mfiano> .rw-r--r-- 1.0M mfiano 2019-12-22 23:26 nimble
04:46:44FromDiscord<mfiano> .rw-r--r-- 3.5M mfiano 2019-12-22 23:26 nimfind
04:46:46FromDiscord<mfiano> .rw-r--r-- 346k mfiano 2019-12-22 23:26 nimgrep
04:46:48FromDiscord<mfiano> .rw-r--r-- 658k mfiano 2019-12-22 23:26 nimpretty
04:46:50FromDiscord<mfiano> .rw-r--r-- 2.7M mfiano 2019-12-22 23:26 nimsuggest
04:46:51disrupteklol
04:46:51FromDiscord<mfiano> .rw-r--r-- 901k mfiano 2019-12-22 23:26 testament
04:46:53FromDiscord<mfiano> ```
04:46:56FromDiscord<mfiano> heh yeah. Bad installer I guess
04:47:05yumaikasYeah, you need to chmod +x all of that
04:47:11yumaikasWell, u+x
04:47:15FromDiscord<mfiano> That is a big issue
04:47:21FromDiscord<mfiano> Stupid choosenim
04:47:51disruptekrust tooling is looking pretty good about now, huh?
04:48:23FromDiscord<mfiano> Oh don't get me started on the rust tooling. racer decides to work for external crates when the moon is full on a tuesday
04:48:58yumaikasEvery langauge has tooling edges that suck
04:50:08FromDiscord<Xydium> Some famous last words: https://pastebin.com/Tb4N7eiE
04:51:29FromDiscord<Xydium> Well, I know that infix functions still break the AST for some reason, but that's a problem for another time
04:52:12FromDiscord<mfiano> choosenim sets the executable bit on the symlink only, ha
04:52:29disruptekthe one place it doesn't need to be set.
04:52:52*chemist69 quit (Ping timeout: 248 seconds)
04:53:13yumaikasMaybe it assumes that the executable bit is already set due to the nature of how the executables are set? idk
04:54:43*chemist69 joined #nim
04:56:15FromDiscord<mfiano> Well nimsuggest is probably not working correctly now
04:56:43FromDiscord<mfiano> Unless it suffers from racer-like issues failing to suggest the important things
04:56:48FromDiscord<mfiano> https://files.michaelfiano.com/images/screenshots/img-20191222235544.png
04:57:33yumaikasDoes it not suggest proc?
04:57:39FromDiscord<mfiano> Nope, nor import
04:58:00disruptekdo you need a list of keywords?
04:58:02yumaikasI thought it worked ok in VS Code
04:58:33FromDiscord<mfiano> Sigh
04:58:57yumaikas(I realize that doesn't solve your current problem, but makes me wonder what the VS Code plugin does)
05:02:15FromDiscord<mfiano> I don't know enough about it to know why it would only suggest some standard symbols. But I absolutely won't use Nim without basic vim completion support
05:02:36FromDiscord<mfiano> Off to a good start ๐Ÿ™‚
05:05:54FromDiscord<mfiano> Even better ๐Ÿ˜ฆ https://files.michaelfiano.com/images/screenshots/img-20191223000522.png
05:07:16*yumaikas does *not* remember having that much trouble with choosenim
05:08:03FromDiscord<mfiano> This is beyond choosenim. nimble can't fetch a nimsuggest that compiles
05:08:24disruptekno comment.
05:10:58FromGitter<bung87> https://github.com/itsumura-h/nim-allographer found someone did
05:11:37FromDiscord<mfiano> Same issue when deleting choosenim and installing manually.
05:11:48FromDiscord<mfiano> Well this is the dead end I get off at I think
05:11:55disruptekyou built the compiler from source and then what?
05:12:18FromDiscord<mfiano> Same error as above for installing nimsuggest
05:12:27FromDiscord<mfiano> It tries stable, then HEAD, and both fail to build
05:12:29disrupteknimsuggest comes with the compiler.
05:12:38disruptekit's built along with the compiler.
05:14:04FromDiscord<mfiano> Aye it does. And same issue of only suggesting a small subset of nim identifiers
05:15:20disruptekif you import modules, it will include their symbols.
05:15:31disruptekwith no symbols, there is nothing to suggest.
05:15:46FromDiscord<mfiano> It won't even suggest `import` or `proc`
05:15:59FromDiscord<mfiano> `procCall`, yes, but not `proc`
05:16:06FromDiscord<mfiano> Makes me wonder what else is missing
05:17:28disruptekthere may be an option to enable completion for keywords; you'd have to ask leorize.
05:20:30disruptekwell, i hope this speedbump doesn't deter you, mfiano.
05:21:55FromDiscord<mfiano> How do I set up a new project? Maybe because it's missing a manifest and I'm just typing into a scratch *.nim file?
05:22:19disruptek`nimble init`
05:22:43FromDiscord<mfiano> Also my install doesn't seem to have `koch`? How do I get that?
05:23:03disruptekit is built when you compiler the compiler.
05:23:10disrupteker, compile the compiler.
05:23:17yumaikascompiler the compiler, lol
05:23:29yumaikasReminds me of relections on trusting trust
05:23:54FromDiscord<mfiano> I installed nim from the official Arch Linux repos after nuking choosenim
05:23:58disrupteki just use git for everything. i guess that's why i don't have these issues.
05:24:17disruptekwhat do you need koch for?
05:24:24yumaikas^
05:24:33FromDiscord<mfiano> I keep seeing references to it in my learning of the language and just wondered why I don't have it
05:24:52disruptekit's used to build the compiler or run the compiler tests.
05:25:04yumaikasIIRC, it's a tool used to automate working on the nim compiler itself
05:25:16yumaikasYou shouldn't need it handy for your own stuff
05:25:24FromDiscord<mfiano> Ok
05:25:35yumaikasThankfully, I've not needed to debug the nim compiler much
05:25:39yumaikasWell, at all
05:25:50yumaikasThere have been a couple of edges I've hit
05:28:11FromDiscord<mfiano> Ok so further testing shows that completion is missing a lot
05:28:33*yumaikas is finally getting close to hitting the db in his web-spreadsheet project
05:29:13FromDiscord<mfiano> `import`, `proc`, `while`, `if`, `let`, pretty much every most basic symbol is not suggested
05:29:20FromDiscord<mfiano> https://files.michaelfiano.com/images/screenshots/img-20191223002846.png
05:30:08disruptekyes, keywords. there might be an option to turn them on.
05:33:36FromDiscord<mfiano> You are right. In the irc log I found someone saying that nimsuggest never suggests keywords and can't be changed. That's how I've normally learned what's available in a language I'm learning. Oh well
05:34:41disruptekthere's a file called keywords.txt in the compiler that lists them all.
05:35:21disruptekaddr and as asm bind block break case cast concept const continue converter defer discard distinct div do elif else end enum except export finally for from func if import in include interface is isnot iterator let macro method mixin mod nil not notin object of or out proc ptr raise ref return shl shr static template try tuple type using var when while xor yield
05:35:33disrupteknow you've learned what's available.
05:35:47FromDiscord<mfiano> disruptek, were you the one that said neovim support for showing compilation results exists? I don't see that in the docs for the plugin
05:36:30disrupteki think the README explains how to setup support for it.
05:37:09shashlickI suspect there's a new bug in choosenim since I moved it to nimarchive
05:37:09FromDiscord<mfiano> Nah, it only tells about completion
05:37:26shashlickIt might not be setting the permissions right on extract
05:37:47shashlickEither that or there's something on arch
05:37:50yumaikasSounds like a possiblity.
05:38:35disruptekthose are the instructions i used to set it up and i have compilation results in my :cw
05:38:42yumaikasWelp, I think I'm going to call it a night. did some grinding away at Tabula Scripta
05:38:55shashlickMore debugging, what's new, who has some extra time
05:40:41yumaikasNight all
05:40:44disrupteknight
05:40:48disruptekmfiano: try these:
05:40:52disruptekautocmd QuickFixCmdPost [^l]* nested copen
05:40:57disruptekautocmd QuickFixCmdPost l* nested lwindow
05:52:49FromDiscord<mfiano> How do you issue a compile?
06:17:51*nsf joined #nim
07:05:20*gour joined #nim
07:09:32skrylar[m]woo. got the blake working
07:34:35*azed joined #nim
07:51:58*Vladar joined #nim
07:55:51*nsf quit (Quit: WeeChat 2.6)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:01:33AraqI'm back, what's up?
08:02:19Araqping mratsim
08:05:07*gmpreussner joined #nim
08:06:43*solitudesf joined #nim
08:16:25FromDiscord<Milerius> Hey
08:18:52FromDiscord<Milerius> I use a hash map concurrent hash map imported from C ++, I store inside a Nim JsonNode, but I have the impression that I am doing something map, the map in question returns and always take copies, however the garbage collector seems to destroy my object while it is socked in my map (I tried with pointers, and even like that it seems destroyed)
08:18:53FromDiscord<Milerius>
08:18:53FromDiscord<Milerius> I Read / Write from different threads + Using boehm
08:18:58FromDiscord<Milerius> I use a hash map concurrent hash map imported from C++, I store inside a Nim JsonNode, but I have the impression that I am doing something map, the map in question returns and always take copies, however the garbage collector seems to destroy my object while it is socked in my map (I tried with pointers, and even like that it seems destroyed)
08:18:58FromDiscord<Milerius>
08:18:58FromDiscord<Milerius> I Read / Write from different threads + Using boehm
08:19:15FromDiscord<Milerius> doing something wrong*
08:21:58*chemist69 quit (Ping timeout: 245 seconds)
08:22:14Araqhey, with --gc:boehm I think your C++ must also use it
08:22:20FromDiscord<Milerius> So now I try to change my strategy, assume that I don't want to use this C++ object anymore but that instead I would like to use 100% nim, how I can write / read in a json map from different threads in nim without being blocking?
08:22:29Araqso you need to override C++'s new operator
08:22:37Araqboehm should have some support for that
08:22:53FromDiscord<Milerius> What would be your advice for sharing a json map between threads Araq ?
08:22:57*chemist69 joined #nim
08:23:00FromDiscord<Milerius> Instead of tricking with a C++ Object
08:23:23FromDiscord<Milerius> I don't want to do a Thread that will write to channels every seconds the change for the Json Configuration it's seem's costly
08:23:25Araqthere is no sharing of json in Nim, you have to put it into a channel
08:23:38FromDiscord<Milerius> Hmmm
08:23:50Araqor you wait until --gc:arc supports it
08:23:59Araqwe aim for a christmas release...
08:24:05FromDiscord<Milerius> What's will be gc arc ?
08:24:13FromDiscord<Milerius> a bit context ? :p
08:24:45FromDiscord<Milerius> Anyway, i really think that we need some Concurrent lock free data structure in Nim that can take "GC ed Object as key/value)
08:24:46FromDiscord<Milerius> Anyway, i really think that we need some Concurrent lock free data structure in Nim that can take "GC ed Object as key/value"
08:25:05Araqthinking about it
08:25:10FromDiscord<Milerius> I really think that if we follow implementation using Hazard Pointers, we can do something 100% in nim
08:25:16FromDiscord<Milerius> Hazard Pointers are known to solve this problem
08:25:20Araqyou can also use a SharedTable and GC_ref/unref
08:26:00Araqit's not about Hazard pointers and stuff, Nim does not have a shared heap
08:26:01FromDiscord<Milerius> Yeah but for the moment the API is unstable, and i think that in the future, if we discuss it about an issue on GitHub we will move to a lock free design
08:26:16FromDiscord<Milerius> Yeah but Bohem is a shared heap ? or am i wrong
08:26:45Araqyeah but then whether Boehm works with your C++ concurrent hash map is unknown and might depend on the OS
08:26:54Araqor the hash map's implementation
08:26:56FromDiscord<Milerius> What is Automatic Reference Counting that you speak about ?
08:27:08FromDiscord<Milerius> the main difference between it and arc
08:27:18FromDiscord<Milerius> bohem*
08:27:48Araqwell it's reference counting, it's deterministic
08:28:03FromDiscord<Milerius> You mean, that with the "arc" garbage collector we will be able to save Nim Type in a Thread Safe way using Thread Safe container from C++
08:28:25Araqer yes, that is what I'm saying
08:28:39FromDiscord<Milerius> Basically i tried `ConcurrentHashMapCpp[string, JsonNode]` and `ConcurrentHashMapCpp[string, ptr JsonNode]`
08:28:43FromDiscord<Milerius> but i got so much trouble
08:29:46FromDiscord<Milerius> But let's say now that this container Always Take/Return Copies, how the ARC will handle that compare to Bohem ?
08:29:59FromDiscord<Milerius> How my object will still valid i mean, it's interesting
08:30:13FromDiscord<Milerius> I read an article this morning about memory model in Nim, it's was interesting
08:30:35Araqwell it wouldn't copy
08:32:05FromDiscord<Milerius> From the doc from hashmap: "Therefore operator[] and at() return copies, since they do not return an iterator. The returned value is const, to remind you that changes do not affect the value in the map."
08:32:16FromDiscord<Milerius> I dont know if it's the same for concurrent container in Java/C#
08:33:25FromDiscord<Milerius> Do we have a discussion / pr about arc that i can read about ?
08:33:32Araqthat doesn't mean much, there is no "deep immutability" in C++
08:33:52Araqit's likely to only be a shallow copy or rather what the copy constructor does
08:34:07Araqwhich for JSON might as well be a pointer copy
08:34:50FromDiscord<Milerius> Yep
08:35:28Araqhttps://github.com/nim-lang/RFCs/issues/177 is the RFC
08:35:30disbotโžฅ Unify Nim's GC/memory management options ; snippet at 12https://play.nim-lang.org/#ix=24Ua
08:35:40FromDiscord<Milerius> Thanks !
08:36:32FromDiscord<Milerius> So the name will be gc:destructors ?
08:36:44Araqno, it's --gc:arc
08:37:02Araq--gc:destructors is an outdated alias for arc
08:37:09FromDiscord<Milerius> ok. i got it.
08:37:21AraqI changed it because 'destructors' was too long to type :P
08:37:29FromDiscord<Milerius> Because Yep for the moment i got to much trouble to continue the program that i'm writing.
08:37:51FromDiscord<Milerius> What is your goal for the gc arc ? 2020 ?
08:38:15Araqtomorrow
08:38:32FromDiscord<Milerius> Lol ๐Ÿ˜„
08:38:37FromDiscord<Milerius> it's will be fantastic
08:39:15Araqanyway you can write your program today with --gc:boehm, plain old Table[] and a lock
08:40:10FromDiscord<Milerius> Yeah i tried that
08:40:18FromDiscord<Milerius> But it's complaining about locking a global variable
08:40:18FromDiscord<Milerius> xD
08:40:44AraqI'm not following
08:42:09FromDiscord<Milerius> https://gist.github.com/Milerius/ae4a2b3ffa1e7b1e5e56f666e834df7b
08:42:13FromDiscord<Milerius> This is my current approach
08:43:01FromDiscord<Milerius> When i call getEnabledCoins from different threads, it's break
08:44:06AraqI said, instead of folly::map use tables.nim and a Nim lock
08:44:23FromDiscord<Milerius> Yeah i tried that, i got an error message about GC Unsafe etc
08:44:27FromDiscord<Milerius> even withLock(lock):
08:45:01Araquse {.gcsafe.}: block
08:45:27FromDiscord<Milerius> But it's should not be implicit since i'm locking ?
08:48:07FromDiscord<Milerius> Because using with async i got weird stuff like
08:48:18FromDiscord<Milerius> `Warning: 'task30SecondsAsyncNimAsyncContinue' is not GC-safe as it accesses 'nameIterVar`gensym577480'`
08:49:37skrylar[m]oh cute. sourcehuts highlighter supports nim
08:50:31FromDiscord<Milerius> How it's work well with Table + lock :p
08:50:35FromDiscord<Milerius> thanks @Araq
08:50:43*letto quit (Ping timeout: 260 seconds)
08:50:45skrylar[m]https://git.sr.ht/~skrylar/skyhash-blake :3
08:51:08AraqMilerius: .gcsafe is not related to locking
08:51:20Araqyou need the lock to make it safe at runtime
08:51:30FromDiscord<Milerius> is it safe to do `let copy = my_sequence_shared` and after using copy (locking only during the copy ?)
08:51:32Araqand you need the .gcsafe to make Nim shut up
08:51:45FromDiscord<Milerius> like lock -> copy -> unlock -> use copy
08:52:06Araqand you need --gc:boehm so that you get the shared heap that allows you to make Nim shut up
08:52:19FromDiscord<Milerius> yeah i use gc boehm by default
08:52:20FromDiscord<Milerius> :p
08:52:27FromDiscord<Milerius> in my nim cfg
08:53:10Araqto answer your question: well it's a copy, it's rather safe
08:54:14FromDiscord<Milerius> https://gist.github.com/Milerius/027a7417af3bad5b87a9e0af44981417
08:54:19FromDiscord<Milerius> I'm hesitating between both
08:54:23FromDiscord<Milerius> Which one do you advice ?
08:55:11FromDiscord<Milerius> May be it's better to lock the critical section just for copy
08:55:18FromDiscord<Milerius> There is less than 10 element in this sequence
08:55:19FromDiscord<Milerius> all the time
08:56:09FromGitter<alehander92> @bung87 yeah its a project
08:56:27FromGitter<alehander92> but its mostly the languist stuff
08:59:38*letto joined #nim
09:08:20FromGitter<alehander92> how is it guys
09:08:26FromGitter<alehander92> vacation already?
09:08:47FromGitter<bung87> @alehander92 I tried it, seems not ready to be used
09:10:43skrylar[m]started writing code again actually. and replaced my dead laptop
09:18:40FromGitter<alehander92> yeah its mostly research
09:18:48FromGitter<alehander92> but it can give you some ideas
09:18:58FromGitter<alehander92> how to port code manually
09:19:05FromGitter<alehander92> what is your usecase
09:19:22FromGitter<alehander92> skyrlar[m] nice, what do you work on
09:21:09*dddddd joined #nim
09:24:19FromGitter<bung87> Iโ€™m currently using regex, and try to do something like this โŽ โŽ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e0087c3c62fdf33f73ca617]
09:25:54FromGitter<bung87> I think it will achieve same goal, if I can finish the AST parse process.
09:26:24FromDiscord<Milerius> Do we have a good tutorial for manipulating IO with nim ?
09:26:26FromDiscord<Milerius> Read/write file
09:27:27FromGitter<bung87> I think itโ€™s documented in tutorials, or example
09:28:54FromGitter<alehander92> @bung87 what is pyImport
09:29:36AraqMilerius: I don't know which is better
09:30:16Araqwell the 2nd one is bad, don't use, Nim doesn't copy seqs properly for 'let', use a 'var'
09:30:35FromDiscord<Milerius> ah.
09:30:40FromDiscord<Milerius> Ok thanks for the advice
09:30:44FromGitter<bung87> coming from `import nimpy`
09:33:15FromGitter<alehander92> yeaah
09:33:17FromGitter<alehander92> thats the gist of it
09:33:19*azed quit (Read error: Connection reset by peer)
09:33:31FromGitter<alehander92> Milerius read the streams docs maybe
09:33:38FromGitter<alehander92> but if you just need that
09:33:40FromDiscord<Milerius> I find what i want !
09:33:49FromGitter<alehander92> you can even use readFile writeFile for simple stuff
09:34:07FromDiscord<Milerius> Yeah but there is a bug from me i guess when using writeFile
09:36:45*WilhelmVonWeiner joined #nim
09:37:09*azed joined #nim
09:44:11FromDiscord<mfiano> how do I import into a new namespace?
09:46:04Araqfrom module import nil
09:47:51FromDiscord<mfiano> Sorry, I'm new but what I'm looking for is how to import from a module into a namespace so that I don't pollute the current namespace and I can see at a glance where symbols are coming from by accessing them with a prefix
09:48:24FromDiscord<Milerius> You can always use the prefix
09:48:30FromDiscord<Milerius> module.nameFunction()
09:48:45FromDiscord<mfiano> and can I supply an alias, say `m`?
09:49:24*NimBot joined #nim
09:49:28FromDiscord<Milerius> import os as my_os
09:49:34FromDiscord<Milerius> i believe
09:50:59FromDiscord<mfiano> Thanks. They weren't kidding when they told me nim is the useful, faster, better designed python
09:53:06*mfiano left #nim ("WeeChat 2.6")
09:53:35AraqI think the jury is still out on that one, but Nim has the better macro system ;-)
09:54:01FromDiscord<mfiano> You don't have to convince me macros are great. I've been a Lisp developer for 20 years
09:54:06skrylar[m]they are certainly fun
09:54:43skrylar[m]saw somebody droling over some later javascript update because of optional chaining and i just stared at it like.. some lisper probably patched -> to do that
09:55:25FromDiscord<Milerius> Nim is excellent, my only concern is the threading model etc, but otherwise i love everything.
09:55:45skrylar[m]is the threading story still undefined
09:56:00FromDiscord<Milerius> I do only Golang, C++ and Nim now, i'm happy with that :p
09:56:38FromDiscord<mfiano> My impression so far isn't bad at all, though admittedly, I'm still following the tutorials/reading the docs for the second time, so no *real* code written yet
09:58:44skrylar[m]i have some but its yak shaving
09:59:19*Trustable joined #nim
10:05:46AraqMilerius: as I said, changing the threading model is priority number one for us
10:05:53Araqand we're getting close
10:13:06FromDiscord<Milerius> Hey, how can i import a c enum in nim ?
10:13:20FromDiscord<Milerius> I got `candidate function not viable: no known conversion from 'tyEnum_e_awesome_icon__xPyaj2Fnlh7ojGo0SJ5niw' (aka 'unsigned char') to 'e_awesome_icon' (aka 'awesome_icon') for 2nd argument`
10:19:04FromGitter<gogolxdong> Is there any B+ tree implemention in Nim?
10:19:15FromGitter<gogolxdong> implementation
10:20:07skrylar[m]@Milerius straight c enums are just numbers. i recommend just making a distinct cint and then a bunch of constants of that type
10:20:34skrylar[m]if you try to make them a nim enum you run in to stupids like "enum out of order" or some c api will have two names for the same value
10:21:11FromDiscord<Milerius> okok
10:21:14skrylar[m](`iota` is one of those few things i miss from go some days)
10:21:21FromDiscord<Milerius> and by anychance there is a shortcut to create utf8 string ?
10:21:27FromDiscord<Milerius> such as u8"my__str"
10:21:34FromDiscord<mfiano> Does vim have first-class functions?
10:21:36skrylar[m]aren't strings already utf-8
10:21:37FromDiscord<mfiano> Does nim have first-class functions?
10:22:00FromDiscord<Milerius> i look the equivalent of: https://github.com/juliettef/IconFontCppHeaders/blob/master/IconsFontAwesome5.h
10:22:33Araqmfiano: yes
10:22:52Araqgogolxdong: use narimirans's sorta package
10:22:58Araq!search sorta
10:22:59disbothttps://github.com/nim-lang/packages/pull/1236 -- 6add package 'sorta' 7& 10 more...
10:23:50*gour quit (Remote host closed the connection)
10:24:29skrylar[m]as far as i know nim strings are already the equivalent of u8's, but its been a while
10:24:33*gour joined #nim
10:24:52FromDiscord<Milerius> yeah i just tested
10:24:55FromDiscord<Milerius> it's working ๐Ÿ˜„
10:25:19skrylar[m](>^_^)>
10:26:19FromDiscord<Milerius> So happy ๐Ÿ˜„
10:26:19FromDiscord<Milerius> https://cdn.discordapp.com/attachments/371759389889003532/658616366709866516/Capture_decran_2019-12-23_a_11.25.47.png
10:26:21FromDiscord<Milerius> It's look good
10:26:50FromDiscord<Milerius> 100% nim ๐Ÿ˜„
10:26:59skrylar[m]woo guis
10:27:11FromDiscord<Milerius> Isn't nice ? :p
10:27:25skrylar[m]i have this unfinished cassoway module and an almost finished gtk3 ._.
10:27:47FromDiscord<Milerius> Still wip but you can take a look: https://github.com/Milerius/make_ui_great_again
10:28:04FromDiscord<Milerius> Basically in 5 lines of code you have a GUI loop running; and you can start code in nim
10:28:23skrylar[m]oh an immgui
10:28:39FromDiscord<Milerius> yup
10:28:51FromDiscord<Milerius> Imgui can look very good if you have some opengl tweek etc
10:29:15FromDiscord<Milerius> it's not that hard, it's nice :p
10:30:04FromGitter<gogolxdong> Is that B+ tree?
10:30:24Zevv\o/ NPeg is now agnostic on the type of data it is parsing, trivial to implement separate lexer and parsers with that now: https://play.nim-lang.org/#ix=25de
10:30:43skrylar[m]woot.
10:32:43FromGitter<Varriount> Zevv: Wow!
10:35:07Araqgogolxdong: it's a B-Tree
10:35:11Araqwithout the + I think
10:35:23*skrylar[m] tries to remember what the + was for
10:35:42Araq+ means only the leaves have data
10:35:59skrylar[m]contains only keys says the interweb
10:36:53skrylar[m]all i remember at the moment is b trees require some fiddly tuning or something
10:38:31couven92How do you tell nim doc to output the documentation into a specified directory? I try `nim doc --project src\project --outdir doc` but that does not work :O
10:38:34FromGitter<gogolxdong> yes.
10:39:18couven92Nim tells me that "arguments can only be given if the '--run' option is selected"
10:39:47Araqcouven92, --project --out:docsdir
10:39:57Araqshould do the trick, at least that's what our tests test
10:41:25couven92Araq, ah I figured it out. The --project switch is a boolean. So it does not accept the value of the project to document, but that the argument is a project. And I specified the output directory after I specified the project, so that was what was wrong
10:53:21*Trustable quit (Remote host closed the connection)
10:59:49*azed quit (Read error: Connection reset by peer)
11:02:43*deansher quit (Quit: Connection closed for inactivity)
11:06:31FromDiscord<mfiano> Are seqs arrays on the heap, or linked lists?
11:12:35skrylar[m]heap; they're you're typical stretchy buffer
11:12:41skrylar[m]*your
11:12:59FromDiscord<mfiano> Yeah I'm just wondering if they are linear time or not
11:13:09skrylar[m]should be
11:13:32FromDiscord<mfiano> So accessing the nth index incurs the cost of traversing the pointers from the head.
11:14:25FromDiscord<mfiano> Then what would be the type for heap allocated arrays that can be resized?
11:14:39skrylar[m]those are seqs
11:15:01FromDiscord<mfiano> Then they can't have linear time complexity
11:15:21FromDiscord<Milerius> How works the optimize settings with the nim Compiler, i just look at the output of my compiler there is no optimisation flags, is this normal ?
11:15:21*skrylar[m] squints
11:16:08skrylar[m]i have no idea how allocating a flat chunk of memory in one go doesn't have O(1) access time but many things are beyond me
11:16:54FromDiscord<mfiano> I had asked if access time was O(n) and you said should be ๐Ÿ˜…
11:17:37skrylar[m]sorry. confused linear for constant
11:17:39FromDiscord<mfiano> Looks like linked lists, are in the lists module.
11:17:51FromDiscord<mfiano> Great thanks
11:21:46FromDiscord<mratsim> @Xydium, I had my fair share of fights with the type system and macros, battle logs: https://github.com/nim-lang/RFCs/issues/44, https://github.com/nim-lang/Nim/issues/8677 but somehow I always managed to not get deadlocked into a corner
11:21:47disbotโžฅ [Meta] Generics/Static early symbol resolution
11:39:13shashlickAraq - for #12939 - how do I recover stdout after reopening a file - I want only some of the output to be redirected and then to go back to stdout
11:39:14disbothttps://github.com/nim-lang/Nim/issues/12939 -- 5stdout cannot be reassigned on some systems ; snippet at 12https://play.nim-lang.org/#ix=253B
12:01:45FromDiscord<funcmike> How to make Stream from the remaining buffer of BaseLexer?
12:04:10AraqI don't know if it's possible efficiently
12:07:25FromDiscord<funcmike> i'm writing simple .eml parser (mostly for mail headers) so at the end of header section i want to stop and return rest of buffer / stream as mail body (i'm not parsing it), how to do this efficiently?
12:10:08FromDiscord<Milerius> lseek @funcmike
12:10:30FromDiscord<Milerius> http://man7.org/linux/man-pages/man2/lseek.2.html
12:10:30FromDiscord<Milerius>
12:10:30FromDiscord<Milerius> we should have an equivalent
12:10:33FromDiscord<Milerius> in nim
12:10:42FromDiscord<funcmike> i want to work on streams not on files
12:10:49AraqsetFilePos, we do, but that's not the question
12:11:11Araqfuncmike: it depends on the concrete Stream
12:11:23Araqdon't close your BaseLexer so that the stream remains open
12:11:48Araqand you need to do stream.setPosition(lex.bufpos)
12:12:00FromDiscord<Milerius> is setFilePos equivalent to fseek ? which works for stream
12:12:11Araqbut there is a complication
12:12:29Araqas the 'bufpos' refers to the buffer position and not to the stream position
12:13:49Araqah
12:13:51Araq # use ``offsetBase + bufpos`` to get the offset
12:13:59Araqso ... that's what you need
12:14:05FromDiscord<funcmike> ok thanks ๐Ÿ™‚
12:14:26Araqstream.setPosition(lex.offsetBase + lex.bufpos)
12:14:33FromDiscord<funcmike> ok
12:14:39Araqand a stdlib addition for that would be nice
12:14:46AraqPRs are welcome
12:16:34Araqping mratsim
12:17:47FromDiscord<funcmike> for now i will finish my parser (first project in Nim) then i will think about PR
12:24:17Araqty
12:25:44*clyybber joined #nim
12:35:04Araqclyybber, any news?
12:37:14clyybberAraq: Yeah, alias refs require linear types
12:37:27clyybberAt least for the doubly linked list
12:37:32clyybberBut
12:37:44Araq'owned ref' is affine
12:37:51clyybberYeah
12:37:54Araqthat is good enough, no need for proper linearity
12:38:15clyybberalias refs are linear because they are required to not outlive the owned ref
12:38:32clyybberanyways
12:38:49clyybberI have condensed the ref count optimization to a few rules
12:39:08clyybberthose make these refs almost as good as alias refs
12:39:33clyybberThe only thing alias refs would gain us is static enforcement (with complicated proofs)
12:40:56clyybberWarning paste incoming:
12:40:58clyybberassignments that require rc ops:
12:41:01clyybber involving field of ref param
12:41:03clyybber involving field of var param
12:41:05clyybber involving var param
12:41:07clyybber involving field of result
12:41:09clyybber involving result
12:41:11clyybber involving field of global
12:41:15clyybber involving global
12:41:15clyybberno further alias analysis required since the creation of an alias will have used rc ops
12:41:33clyybberthis is what I came up with
12:41:54Araqso in other words, stack refs don't have to be counted?
12:42:23clyybberhmm, yeah, nothing new :/
12:42:50clyybberbut hey, derived from ponys recover idea :D
12:44:54clyybberbecause its essentially the same, but towned down so we don't need escape analusis
12:45:09clyybber(pony doesn't need it because of its restricitve type system)
12:45:46Araq x = y; passToSink(x); # frees 'x' if 'y' is on the stack?
12:45:48*gour quit (Remote host closed the connection)
12:46:28*gour joined #nim
12:46:37*nsf joined #nim
12:48:14clyybberalias refs would have the property that they cant transfer ownership I guess
12:48:25clyybberthat means no passign to sink/owned params
12:48:41clyybberthey can only be lent
12:49:20clyybberand lent ref params would be disallowed from being stored somewhere that outlives them
12:49:45AraqI know it's hard to accept but why not simply do a runtime check?
12:49:56clyybberI have accepted it :)
12:50:12Araqno need for 'owned' or 'recover' then
12:50:15clyybberyeah
12:50:28clyybberthat is what my conclusion was :D
12:50:54Araqthe only disappointing aspect is that 'owned' also prevented cycles at compile-time
12:52:27Araqand well unique-ness is an elegant concept
12:52:46Araqmaybe we should have UniqueRef in the stdlib, constructor is
12:53:08Araqproc makeUnique[T](x: sink T): UniqueRef[T]
12:53:22clyybberuniqueness sure is elegant, but not if enforced at runtime
12:53:27Araqand then this is a very special "move only" sink-parameter
12:53:40*FromGitter quit (Read error: Connection reset by peer)
12:53:46Araqthat restricts the 'x' in the same way as 'recover' does
12:53:58*FromGitter joined #nim
12:54:54clyybberhmm, how so? Have an assert (rc == 1) in there?
12:55:57Araqalso 'proc newT(): owned ref T' is splendid to have for the optimizer
12:55:59skrylar[m]are you bikeshedding rust again =p
12:56:16Araqskrylar[m], yeah except that our stuff actually works :P
12:56:37Araqeventually.
12:56:38clyybberwell, rust also works, sadly it disallows doubly linked lists
12:57:13clyybberI think it may not be possible to enforce a doubly linked lists safety without GC/RC and only affine types
12:57:28clyybberit is certainly possible with linear types though
12:57:35clyybberAST does it
12:57:47clyybberATS
12:58:00AraqB/D does it too
12:58:14clyybberwith runtime checks :D
12:58:37Araqso what, the problem with B/D are elsewhere
12:58:42skrylar[m]i used indexed buffers mostly when it came to rust
12:59:10skrylar[m]also you could double link through the use of weakly referenced boxes :p
12:59:50clyybberwell, yeah
12:59:58Araqclyybber, on the other hand C++ offers the incomplete unique_ptr and survives
13:00:00clyybberwe can all do linked lists with pointers :p
13:00:04clyybberAraq: Yeah
13:00:50Araqit's fine to wait until researchers figured out how to add separation logic to type system without creating a mess
13:01:18*clyybber quit (Read error: Connection reset by peer)
13:01:31Araqin the meantime we follow C++ and make our users happy... (?)
13:01:35*clyybber joined #nim
13:03:55Araqso ... let me summarize:
13:04:20Araq- you can pass data to threads but the data must contain 'owned ref' and no ordinary 'ref'
13:04:28FromDiscord<mratsim> @araq yes?
13:04:40Araq- 'owned ref' is optional, if used, it enforces moves
13:05:43Araqyou can have a 'ref' inside 'owned ref' and then the isolation is not enforced at compile-time
13:05:54Araqbut at runtime
13:06:08clyybberor we forbid that
13:06:20clyybberand make you write an explicit `own`
13:06:27clyybberdoesn't matter probably
13:06:35Araqyeah but then you forbid passing json :P
13:06:59clyybberAraq: Not if json returned a struct that only contains owned refs
13:07:05clyybberWhich should be possible
13:07:21Araqpossible but not very backwards compatible
13:07:44clyybberwhy? owned annotations are ignored without nrt?
13:08:31Araqmratsim: thought about channels vs flowvars?
13:08:56AraqI'm redesigning 'spawn'
13:09:29FromDiscord<mfiano> Is there an in-depth layman coverage of refs? I was never a C coder and always used a pass-by-value language. I am just not getting it.
13:10:25Araqand there is a tension between "wrap the function's result in a flow var" and "send the function's result to a channel"
13:10:49FromDiscord<mratsim> is there a difference? https://github.com/mratsim/weave/blob/master/weave/datatypes/flowvars.nim#L27-L47
13:11:13FromDiscord<mratsim> @mfiano if you never used C, C++ or Rust, you probably always were using a pass by ref language
13:12:01Araqit depends, most languages are pass-by-value but the "values" are heap objects
13:12:17FromDiscord<mratsim> even in my PoC in July: https://github.com/mratsim/weave/blob/master/experiments/e04_channel_based_work_stealing/future_internal.nim#L25
13:12:24FromDiscord<mratsim> type Future = Channel
13:12:52FromDiscord<mratsim> Future/Flowvars just means that it's awaitable
13:13:06Araqwell good to know, but actually a flow variable is not a channel, it's a single variable
13:13:33FromDiscord<mratsim> channels are just the transport
13:13:50Araqbut the point I'm trying to make is:
13:13:51FromDiscord<mratsim> I think mirroring async/await is good
13:15:01FromDiscord<mfiano> @mratsim Common Lisp uses pass by value for the most part.
13:15:01AraqreplyChan.send f(a, b); replyChan.send g(x, y) # more contention on 'replyChan' but less memory overhead
13:15:37Araqmfiano: yes, pass by reference is uncommon in general, Fortran being the exception
13:16:21Araqwhat mratsim means is that most languages default to reference semantics for their object systems
13:16:25FromDiscord<mratsim> Python, all the .Net, Java uses ref types everywhere
13:16:27clyybbermratsim: sink and ref should work just fine with weave with newruntime, no? Or is the problem that they are an pointer, size pair?
13:16:38*Hideki joined #nim
13:16:39FromDiscord<mfiano> Anyway, I'm just not sure when to use refs, and how to handle mutability correctly and efficiently.
13:17:01*Hideki is now known as Guest73089
13:17:12Araqmratsim: or let me phrase it differently yet again:
13:17:22FromDiscord<mratsim> sink works fine, I use them, ref maybe with a multithreaded GC, but for now I'm just plain disabling them
13:18:01Araqa[0] = spawn f(a, b); a[1] = spawn g(...); waitFor f+g
13:18:03FromDiscord<mratsim> so you want multiple use channels @Araq?
13:18:08clyybbermratsim: I'm fucking dumb, I didnt mean sink and ref, but string and seq
13:18:11clyybberlol
13:18:35clyybberslept nearly 12 hours still fucking tired
13:18:55FromDiscord<mratsim> didn't try, to use them. I don't want to play the GC_ref and GC_unref dance
13:19:13Araqmratsim: the channel/flowvar abstraction is costly
13:19:24clyybbermratsim: strings and seq don't use the GC
13:19:27clyybberwith the newruntime
13:19:42Araqas it merges the syncronization with a storage
13:20:37Araqmostly because 'recv' implies a second copy
13:20:54Araqconsider this example:
13:21:35Araq for i in 0..x.high: results[i] = spawn f(a[i]) # disjoint locations, safe
13:21:50Araq sync() # now safe to access 'results'
13:22:13Araq for i in 0..results.high: echo results[i] # no Future[T] wrapping, no cry.
13:22:54FromDiscord<mratsim> (coming back in 5 min)
13:23:17Araq(and you should know by now I don't like Option[T]; Future[T] monads around my data)
13:23:53skrylar[m]@mratsim the blake2b stuff works now :p
13:24:41skrylar[m]i have part of an int128 type written because of reasons related to it, haven't dug around with the proper way to hook up simd to nim tho :\
13:25:19skrylar[m]jamming in emitc's to gcc intrinsics is obvious
13:25:41Araq!search simd
13:25:42disbothttps://github.com/mratsim/Arraymancer/issues/405 -- 3Vectorized RNG 7& 29 more...
13:27:02skrylar[m]i'm not sure people want to bring in all of arraymancer just to run crypto code B)
13:27:33Araq https://github.com/nimlibs/simdX86
13:27:46Araq"nimble search" is your friend
13:27:58Araq(disbot not so much...)
13:28:49skrylar[m]yep; thats just emitc shims
13:29:20skrylar[m](well, imports.)
13:30:05Araqas long as it works
13:32:00skrylar[m]gcc has an extension from what i recall where you can have multiple implementation procs marked and when yo utried to call it it branches based on which flags are in the cpu cap
13:32:17skrylar[m]less fancy ones just pick a level and crash if its wrong
13:32:34FromGitter<mratsim> It's called "target"
13:33:08FromGitter<mratsim> Not sure if it can work with nim as they need the same C name
13:33:26FromGitter<mratsim> I'll just generate functions with different names
13:33:36Araqbbl
13:35:20skrylar[m]i think this is the target you mentioned https://lwn.net/Articles/691932/
13:35:45Zevvis there a conventional proc name to check if a thing X is of type Y, whatver 'is of type' means in that context? Similar to 'contains' or 'items'?
13:36:12skrylar[m]`is`?
13:36:31Zevvoh right, can that be overloaded as well? let me check
13:37:35skrylar[m]@mratsim its not super hard to do manually since we have module initializers.. you just fill out some function pointers with the right procs at boot and call in to them after things start
13:37:36Zevvhmm I'll just abuse `==` I guess
13:39:03skrylar[m]ah its the indirect functions which are linked from the article https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html#index-g_t_0040code_007bifunc_007d-attribute-2529
13:40:24skrylar[m]although sadly the computer i had capable of testing avx2 on is quite dead (^^;;)
13:40:42skrylar[m]bochs/qemu might do it :ponders:
13:45:45FromDiscord<mratsim> Intel has an emulator
13:46:01Yardanicoemulator for avx2? wow
13:46:37FromDiscord<mratsim> https://software.intel.com/en-us/articles/intel-software-development-emulator
13:46:40FromDiscord<mratsim> and AVX512
13:48:52muffindrakeIs there some document that explains nimble usage, like what you want to do when creating a new project?
13:49:40FromDiscord<mratsim> @Araq, I agree with mixing storage and sync, but it's not that bad:
13:49:40FromDiscord<mratsim>
13:49:40FromDiscord<mratsim> - Most likely you return small pointers, integers, tuples from a spawned computation
13:49:40FromDiscord<mratsim>
13:49:41FromDiscord<mratsim> - Putting them in the same array storage like you did is verboten because threads will compete for the same cache line and the performance will be abysmal
13:49:42FromDiscord<mratsim>
13:49:45FromDiscord<mratsim> - You need some datastructure that will serve as a basis for synchronization like "andThen" or fine-grained ^/sync
13:50:13FromDiscord<mratsim> because the global sync() is a pessimization, in most cases you only need a single task, not wait for all tasks
13:51:07skrylar[m]@muffindrake `nimble init` and follow the wizard, usually. then edit the nimble file to add in dependencies
13:51:09FromDiscord<mratsim> nqueens is an example where this comes into play: https://github.com/mratsim/weave/blob/master/benchmarks/nqueens/weave_nqueens.nim#L128-L132
13:51:13FromGitter<deech> Is https://github.com/alehander92/gara currently the best pattern matching library?
13:51:26skrylar[m](altho i typically vendor dependencies with submodules, but.. eh.)
13:52:04FromDiscord<mratsim> As an alternative to Futures/Flowvar, we can have a dedicated synchronization object, and that would be this one that could be awaited.
13:52:27FromDiscord<mratsim> Fibril takes this approach with something called "frame": https://github.com/chaoran/fibril/blob/master/test/fib.c#L27-L30
13:52:37skrylar[m]do we already have working futures/promises and scheduler stuff? was thinking about those recently :/
13:52:43FromDiscord<mratsim> which is basically a fiber stack, with continuations and restoring registers
13:53:02FromDiscord<mratsim> a a bonus, it ias way faster than anything I've benchmarked
13:53:30FromDiscord<mratsim> including Weave, for overhead-bound tasks (i.e. fibonacci or depth-first-search with tasks taking only 1 CPU cycle)
13:53:55FromDiscord<mratsim> as a secon bonus it could serve as a common building block for both async/await and spawn/sync
13:54:54FromDiscord<mratsim> as a third bonus, it makes it easier to await for 3..N spawns, just spawn them on with the same frame and await that frame
13:55:52FromDiscord<mratsim> I.e. making continuations first-class might be a nice way to approach async and threading
13:56:07FromDiscord<mratsim> and since we can wait on that frame ther eis no need to store the data in a channel/flowvar
14:00:33FromDiscord<mratsim> @skrylar, you can play with Weave: https://github.com/mratsim/weave
14:00:46stefantalpalaruReinventing Scheme? https://en.wikipedia.org/wiki/Call-with-current-continuation
14:04:07FromDiscord<mratsim> It's hard to invent a,ything nowadays ๐Ÿ˜‰
14:04:59muffindrake> Error: Version may only consist of numbers and the '.' character but found 'v'.
14:05:02muffindrakeAwh, how mean.
14:05:32muffindrakeIs that only a 'nimble init' restriction, or would changing that to something else break stuff?
14:06:01clyybbermratsim: Another deadlock ?
14:06:18Yardanicomuffindrake: that's so you can compare versions with comparasion operators
14:06:23YardanicoI think
14:06:28Yardanicohttps://github.com/nim-lang/nimble#dependencies
14:06:28FromDiscord<mratsim> well CI was running stuck for 40 minutes on a benchmark that should take at most a second
14:07:08FromDiscord<mratsim> it might be a livelock though, there is nothing to deadlock at since I don't use locks
14:07:25FromDiscord<mratsim> and the only place where I use condition variables/futex has been formally verified deadlock-free
14:08:17muffindrakeYardanico: Sure, but that's hardly a consideration for a binary project
14:09:27Yardanicobut rules should apply to everyone :P
14:18:50*endragor quit (Remote host closed the connection)
14:23:29*Trustable joined #nim
14:39:23*eys joined #nim
14:39:30*eys left #nim (#nim)
14:40:33*gour quit (Remote host closed the connection)
14:41:11muffindrakeWhat's the proper way to specify that I need a TLS library in order to use TLS with nim's HTTP implementation?
14:41:16muffindrakeIn the .nimble file
14:41:33*gour joined #nim
14:43:38*couven92 quit (Read error: Connection reset by peer)
14:43:57FromGitter<deech> The docs for `startProcess` say that it returns an `owned(Process)`. Does it do this regardless of which runtime is chosen meaning that closing the `Process` is always statically enforced?
14:44:01FromGitter<deech> https://nim-lang.org/docs/osproc.html#startProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D
14:45:59*couven92 joined #nim
14:46:10clyybberdeech: owned is ignored without --newruuntime
14:46:16*couven92 quit (Remote host closed the connection)
14:46:35*couven92 joined #nim
14:48:26FromGitter<deech> Ok that makes sense. Can I suggest regenerating the official docs using only officially supported runtimes?
14:49:58dom96deech: please make an issue, we should at the very least have a tooltip on the "owned"
14:51:00FromGitter<deech> Sure
14:54:12FromGitter<deech> https://github.com/nim-lang/Nim/issues/12951
14:54:13disbotโžฅ The return type of `startProcess` in the official docs is `owned(Process)`
14:54:58FromDiscord<Milerius> Hello i'm reading the doc: https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-procs, trying it here: https://gist.github.com/Milerius/46c6c39c6a2e9e602a57e00e65a1032d is it normal that i'm not compiling ?
14:55:03FromDiscord<Milerius> Did i made a mistake ?
15:02:34FromDiscord<Clyybber> Try `res.convertTo[:cstring]()`
15:04:29*ng0_ joined #nim
15:04:30Araqmratsim: that's a good point so then it's about how to use the "same" channel for outputs
15:04:42Araqin my new DSL I'm thinking about
15:04:53Araqspawn f(args) -> resultChannel
15:05:12Araqvia the '->' so that 'spawn' itself is not burdened with the Channel creation
15:05:23FromDiscord<Milerius> thanks clyybber
15:05:51*ng0 quit (Disconnected by services)
15:06:03FromDiscord<Clyybber> @Milerius Np, this is needed because otherwise it could be ambiguos with array indexing syntax
15:06:05*ng0_ quit (Client Quit)
15:06:17*ng0 joined #nim
15:06:17*ng0 quit (Changing host)
15:06:17*ng0 joined #nim
15:06:18FromDiscord<Milerius> Erf it's not possible todo: NCSTRING res_c = res.convert_to<std::string>().c_str();
15:06:24Araqconsider this example:
15:06:26FromDiscord<Milerius> It's blame me about r_value
15:06:49Araqspawn f(args) -> a
15:07:01Araqspawn g(args) -> a
15:07:12Araqecho recv(a) + recv(a) # order does not matter
15:07:14Araqvs
15:07:20Araqspawn f(args) -> a
15:07:27Araqspawn g(args) -> b
15:07:44Araqecho recv(a) - recv(b) # order matters for '-'
15:08:33Araqit's also a design aspect of async/await that keeps us from optimizing allocations, consantly new futures have to be allocated
15:10:00FromDiscord<Milerius> Ok i use .data() from string
15:10:08FromDiscord<Milerius> i don't know if it's more dangerous than .c_str() in my case
15:10:14FromDiscord<Milerius> But i cannot assign from c_str()
15:10:17FromDiscord<Milerius> so i'm using .data()
15:10:48FromDiscord<Milerius> Is it possible to specify that we return a const char* and not a char* in nim ?
15:10:50FromDiscord<Milerius> using cstring
15:11:16Araqvia workardounds like
15:11:53Araqtype constCstring {.importc: "const char*", nodecl.} = object
15:12:01FromDiscord<Milerius> xD
15:12:03Araqor maybe
15:12:04FromDiscord<Milerius> Okok !
15:12:09Araqtype constCstring {.importc: "const char*", nodecl.} = distinct cstring
15:12:13FromDiscord<Milerius> My guess it's should be integrated in the langage
15:12:26FromDiscord<Milerius> will be really helpful
15:12:29FromDiscord<Milerius> will be really helpfull
15:12:30Araqover my dead body
15:12:41FromDiscord<Milerius> xD
15:12:59Araqconst is a clusterfuck of a design in C/C++
15:13:17FromDiscord<Milerius> i agree
15:13:28FromDiscord<Milerius> but there is constexpr :p
15:13:37Araqand soon consteval
15:13:47FromDiscord<Milerius> std::is_const_evaluated xD
15:13:59FromDiscord<Milerius> well, i will stop about masturbating academic C++
15:14:01FromDiscord<Milerius> it's drive me sick
15:14:28FromDiscord<Milerius> Man if i show you how we retrieve a human date from a timestamp in c++
15:14:30FromDiscord<Milerius> you will cry
15:17:02FromDiscord<Clyybber> Araq: `recv(a)` will be FIFO?
15:18:21clyybberAnd will the channels be typed?
15:20:24FromDiscord<mratsim> @milerius, template is_const_evaluated(x: typed) = when compiles(static(x)): true else: false
15:20:33FromDiscord<mratsim> @Milerius *
15:20:51FromDiscord<Milerius> :DDDD
15:22:20FromDiscord<mratsim> @Araq, just embrace alloca
15:25:44FromDiscord<mratsim> also you can only reuse the same channel if it's type erased and the size are compatible
15:26:05FromDiscord<mratsim> That's why I wrote my main memory pool
15:26:21FromDiscord<mratsim> A nice flowvar abstraction familiar to everyone that used futures
15:26:44FromDiscord<mratsim> and the fact that memory is complicated and slow is handle in an specialized allocator
15:27:24FromDiscord<mratsim> Also, it is extremely rare that the thread that allocates the flowvar does not reclaim it. I think it can only happen with nested parallelism
15:27:41FromDiscord<mratsim> no proof though.
15:28:17FromDiscord<mratsim> is handled in a specialied*
15:30:14*endragor joined #nim
15:37:03FromGitter<deech> Not being able to use `fmt` in a template is yet another manifestation of too-early symbol resolution, yes?
15:37:41FromDiscord<mratsim> yep
15:38:00FromDiscord<mratsim> it's mentionned in strformat limitations
15:38:19clyybbersux
15:38:29FromDiscord<mratsim> but that makes deprecating round in "math" impossible (it mentions use strformat instead)
15:38:55FromDiscord<mratsim> Also in many cases, especially debug and logs I would love to use strformat bu I can't ...
15:42:38*nsf quit (Quit: WeeChat 2.6)
15:45:23FromDiscord<mratsim> @Clyybber, the state machine approach is a bit verbose :/. I'll have to try on the "barrier" which is a pain right now. https://github.com/mratsim/weave/pull/63/commits/533bca556c12593ad809eb3e3685faba993d0c38
15:45:23FromDiscord<mratsim>
15:45:23FromDiscord<mratsim> Hopefully the price in LOC counterbalanced by good graph generation.
15:45:24disbotโžฅ [WIP] Refactor workers into state machines
15:49:01FromDiscord<mratsim> and verification/modelization
15:49:39*endragor quit (Remote host closed the connection)
15:50:59Araqmratsim: nevertheless I might go ahead and invent something new
15:51:12*endragor joined #nim
15:51:49FromGitter<deech> It seems from a couple of small tests that qualified arguments to procs can't passed without parens, eg. `f a.foo b.bar` seems to fail but `f(a.foo,b.bar)` works.
15:52:23livcdwhat would be the biggest nim app outside of status things ?
15:52:27FromGitter<deech> Possibly things like `f a.foo,b.bar` and `f a.foo: b.bar` also work but haven't tested.
15:52:28Araqyou also left out the comma though
15:52:54FromGitter<deech> Ah, yes I did. Thought I could apply args like ML. :)
15:52:57Araqso you wrote f(a.foo(b.bar)), not f(a.foo, b.bar)
15:53:10FromGitter<deech> Thanks!
15:53:29FromDiscord<mratsim> Oh this sounds like an interesting language, seems like Microsoft Research is doing a lot of fun things: https://github.com/p-org/P
15:53:35Araqthere is hardly any ML influence in Nim and more interestingly
15:53:50AraqSwift removed currying in later versions iirc
15:54:19livcdAraq: are there some monstrous Nim apps that nobody knows about ?
15:54:33FromGitter<deech> ML does not support automatic currying, Haskell is somewhat unique there I think ...
15:55:20Araqlivcd, I don't know, "some" probably, "Many" hardly
15:55:38*couven92 quit (Read error: Connection reset by peer)
15:55:57*couven92 joined #nim
15:57:14*tane joined #nim
15:57:28livcdAlso are these "FromGitter/FromDiscord" nim apps ? I cant find it on github i am doing something wrong obviously
15:58:13FromGitter<deech> Araq, curious was the lack of ML influence deliberate?
15:58:19FromGitter<kayabaNerve> What defines monstrous? :P
15:58:36*couven92 quit (Read error: Connection reset by peer)
15:58:46FromGitter<kayabaNerve> I know there is a Nim Discord bot. I'm not sure if FromDiscord is written in Nim.
15:58:50*jonafato quit (Quit: ZNC - http://znc.in)
15:58:56*couven92 joined #nim
15:59:16livcdkayabaNerve: afaik they used juju to benchmark compilation speeds for Go. That's what I would call monstrous :P
15:59:37*jonafato joined #nim
16:01:19Yardanicolivcd: both are sadly not in Nim
16:01:30YardanicoFromGitter is in Crystal, FromDiscord is in Go (matterbridge)
16:01:37*sealmove joined #nim
16:01:38FromDiscord<mratsim> I'll play with fiber implementations in Nim and using fiber stackframes as sync objects instead of futures. Not sure if I'll be able to support more than x86+Posix though. depends on ucontext/setjmp longjmp
16:01:43livcdYardanico: thanks
16:01:46Yardanicohttps://github.com/oprypin/critter fromgitter one
16:03:24dom96livcd, pro-tip, you can send a CTCP VERSION to anyone to see their client name/version. That should give you insight into how bots are implemented (usually just /version <nick> on most IRC clients)
16:05:08Araqdeech: deliberate in the sense that I didn't understand ML well enough to borrow from it.
16:05:39AraqI only wrote some trivial programs at university in ML
16:06:40Araqand passing local state around in parameters to enable tail recursions never felt elegant
16:07:27FromDiscord<Generic> this code currently compiles and runs without any problems with newruntime enabled: https://gist.github.com/RSDuck/cf091bed9ee31473eed426922a816cdc
16:07:34FromDiscord<Generic> is this right?
16:08:21FromDiscord<mratsim> why wouldn't it be?
16:08:26FromGitter<deech> Araq, makes sense. Conversely ML like langs have a lot to learn from langs like Nim too IMO.
16:08:46FromDiscord<Generic> because a non owned ref outlives the owned refs
16:08:49Araq(nor necessary when you already know about Hoare Triples)
16:09:09*Guest73089 quit (Remote host closed the connection)
16:09:11sealmoveAraq: Zevv is making you proud
16:09:24clyybberGeneric: No its not
16:09:26FromDiscord<mratsim> @Generic: you have no owned indication, and your ref is in global scope so its lifetime is the program lifetime
16:09:46*Hideki joined #nim
16:10:01clyybberGeneric: You are creating no owned ref here
16:10:05*Hideki is now known as Guest35431
16:10:11clyybberAnd even if you were, it would not outlive the owned ref
16:10:15disruptek!package simd
16:10:16disbothttps://github.com/nimlibs/simdX86 -- 9simdX86: 11Wrappers for X86 SIMD intrinsics 7& 2 more...
16:10:31disruptekthe package command searches nimble's database.
16:10:45FromDiscord<mratsim> the best simd wrapper is here: https://github.com/numforge/laser/blob/master/laser/simd.nim ๐Ÿ˜‰
16:13:52FromDiscord<Generic> I thought that after instantiating an object at first you would get a owned ref
16:14:22AraqGeneric: looks like a bug to me ;-)
16:14:38*Guest35431 quit (Ping timeout: 260 seconds)
16:15:01Araqwe have a check for that in the compiler, not sure why it doesn't trigger
16:15:30FromDiscord<Generic> I have another one
16:16:01Araqdeech: also I read that ML styled type inference combined with overloading is NP complete
16:16:24FromDiscord<Generic> https://gist.github.com/RSDuck/335d69a265a26c7e4a4afc20c306aba3
16:16:33Araqand since it was clear that Nim is about overloading to move polymorphism into compile-time I never investigated in more powerful type inference
16:17:28FromDiscord<mratsim> *cough* Idris *cough*
16:22:37FromGitter<deech> https://www.cl.cam.ac.uk/~sd601/papers/mlsub-preprint.pdf
16:22:55FromGitter<deech> Araq, ^^^ claims to have a promising approach but haven't seen it in practice.
16:23:44Araqyou cannot innovate on every front at the same time, back then Ocaml had +. for floating point addition and I assumed for good reasons
16:25:41Araqlater we got 'using' instead of parameter type inference, trying to do something similar with a completely different mechanism
16:28:45FromGitter<deech> Yeah to me Nim is about fast compiling, efficient codegen, static introspection and great C/C++/JS interop. I don't see myself leaning on it's concurrency/parallelism model. If I want those other things I'll FFI into/from Nim
16:29:44FromGitter<deech> Should also add great GC.
16:29:55Yardanicowe're getting an even better GC :P
16:30:35FromGitter<deech> If you mean the new runtime, idk, maybe.
16:31:11muffindrakeIs nim significantly slower than C?
16:31:25FromGitter<Willyboar> i think 2020 would be nim's year
16:31:28Yardanicomuffindrake: no?
16:31:33Yardanicodepends on your code of course
16:32:11Araqmuffindrake, sometimes it's faster, sometimes it's equally fast, sometimes it's even slower than Python.
16:33:02Araqwhy? because Python has optimized libraries and Nim's is optimized for "can you also run it at compile-time"
16:33:08Araq;-)
16:33:11clyybberdeech: Nice paper
16:33:47clyybberTheir approach seems reasonable and has a worst case of N((n+m)^2) with an avg of N(n+m)
16:35:50clyybberMaybe we should adopt it
16:36:15clyybberUnfortunately messing with sigmatch and the like is really hard
16:36:37clyybberThe code has grown really "organically"
16:37:14FromGitter<deech> Yeah I tried to mess with that and got frustrated and gave up.
16:37:51Araqjust write an alternative frontend
16:38:14*Hideki joined #nim
16:38:15clyybberAraq: WDYM?
16:38:18FromGitter<deech> to what?
16:38:27Araqto Nim.
16:38:37*Hideki is now known as Guest87433
16:39:13FromGitter<deech> Change the syntax? Didn't 1.0 just get released? :)
16:39:57Araqnot my point
16:40:01Yardaniconim had syntax skins :P
16:40:10Araqno, argh, it's not about the syntax
16:40:36Araqit's about the Nim compiler
16:40:54Araqlexer/parser's quality: ok
16:41:12Araqsem'check: please rewrite it
16:41:14AraqVM: ok
16:41:15FromDiscord<mratsim> For me Nim is about having a Python, syntax and the speed of C, which makes it a great fit for scientific computing. And multithreading for scientific computing in general is lacking, even in C/C++ land
16:41:47Araqcodegen: bad but most of its complexity is now in injectdestructors.nim which is ok
16:41:51Araqsempass2: ok
16:42:00Araqlambda lifting: ok
16:42:24clyybberinjectdestructors: good :)
16:42:28Araqindeed
16:42:52clyybberI want to rewrite sigmatch
16:43:07clyybberBut I also wanted to finish default fields
16:43:12FromGitter<deech> Early symbol resolution issues: bad?
16:43:28clyybberBut I think default fields must wait until the VM is ready for injectdestructors
16:43:36clyybberdeech: Ok, yeah
16:43:39disruptekthere's this annoyingly pervasive idea that the first impl is the last.
16:43:49*endragor quit (Remote host closed the connection)
16:43:52*Guest87433 quit (Remote host closed the connection)
16:44:08clyybberdisruptek: Ship of theseus
16:44:09*Hideki joined #nim
16:44:17disruptekit's a collection of design decisions that leave options open for future innovation.
16:44:24disruptekthat's what's great about nim, imo.
16:44:31FromGitter<deech> brb rewriting nim in rust
16:44:33*Hideki is now known as Guest49997
16:44:38FromDiscord<snluu> With generic, is there some way to indicate/guard that it must satisfy a specific requirement?
16:44:39FromDiscord<snluu> For example, if iโ€™m implementing MyHashTable[K, V], is there anyway to enforce that K must have a hasher function?
16:44:39Yardanicoohno
16:44:40*Guest49997 quit (Remote host closed the connection)
16:44:46clyybberdeech: brb rewriting nim in ats-xanadu
16:44:49Yardanico@snluu concepts?
16:45:13FromDiscord<snluu> huh?
16:45:19FromGitter<deech> clyybber, you will be missed.
16:45:25disruptekthere's this concept called concepts...
16:45:30disruptekit does what you want.
16:45:32Yardanicohttps://nim-lang.org/docs/manual_experimental.html#concepts
16:45:44FromGitter<alehander92> i wanted to rewrite nim as an example
16:46:10FromDiscord<mratsim> the default hash tables impl requires hash from the hashes module anyway
16:46:18FromGitter<deech> clyybber, seriously though ATS is insane in good and bad ways ...
16:46:18FromDiscord<snluu> oh i see. thanks! iโ€™ll take a look at concepts
16:46:22FromDiscord<mratsim> you can do the same
16:46:33FromDiscord<mratsim> they were written before concepts though
16:46:36FromGitter<alehander92> to rewrite nim as an example of my compiler dsl toolkit which doesnt really exist yet
16:46:52FromGitter<alehander92> but its obviously a crazy idea and i cant really do it and it probably cant work
16:46:54FromDiscord<mratsim> Readme driven development?
16:46:58FromGitter<alehander92> so ill just write some random stuff
16:47:06FromGitter<alehander92> of course, thats the best kind of development
16:47:15clyybberdeech: I like its explicit handling of proof
16:47:16clyybbers
16:47:23clyybberBut the syntax is just batshit insane
16:47:51FromDiscord<snluu> @mratsim how did the default hash table enforce that the key is hashable, without using concepts? compiler magic?
16:48:21FromGitter<deech> clyybber, have you seen it's error messages?
16:48:27FromGitter<alehander92> but i mean its like
16:48:28clyybberof course
16:48:29disruptekit doesn't work if it cannot hash.
16:48:30FromGitter<alehander92> https://news.ycombinator.com/item?id=21860713
16:48:38FromGitter<alehander92> btw guys the nim os thing
16:48:42clyybberdeech: Its the first thing I saw while trying to use it
16:48:44FromGitter<alehander92> would be good marketing i knew it
16:48:48FromGitter<deech> haha
16:49:27clyybberdeech: Have you seen its commit log?
16:49:33clyybberupdating very very minorly...
16:49:42clyybberlol
16:49:59FromGitter<deech> It's clear to me Dr. Xi just thinks differently ...
16:50:04Yardanicohttps://ru.wikipedia.org/wiki/420_(%D0%BA%D1%83%D0%BB%D1%8C%D1%82%D1%83%D1%80%D0%B0_%D1%83%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F_%D0%BC%D0%B0%D1%80%D0%B8%D1%85%D1%83%D0%B0%D0%BD%D1%8B)
16:50:09Yardanicosorry wrong window :(
16:50:25FromGitter<alehander92> russia
16:50:50FromGitter<alehander92> i was pro before, but i am kinda anti 420 now
16:50:50FromDiscord<snluu> holy shit. is that what all russian wiki urls look like? all the unicode characters get transformed to % something?
16:50:59FromGitter<alehander92> cyrillic is bulgarian
16:51:11Yardanico@snluu well it will work without url encoding as well
16:51:14FromGitter<alehander92> ok thats my duty as a internet bulgarian comment warrior
16:51:16Yardanicomodern browsers don't really care
16:51:18clyybberdeech: To be fair, updating very very minorly is better than whatever this is: https://github.com/githwxi/ATS-Xanadu/commit/9dd393cf5e1a1858ac84d76a28e7a77d91f64761
16:51:37FromGitter<deech> wow
16:51:50clyybberNice readme update dare I say
16:51:50FromGitter<alehander92> there were some amazing comments
16:51:59FromGitter<alehander92> spanning like blog articles inside the commi messages
16:52:03FromGitter<alehander92> but i cant remember where
16:52:46*endragor joined #nim
16:53:27FromGitter<deech> clyybber, did you hear how it got kicked out of the language benchmarks? Apparently no one could read it and could not tell if it was following the benchmark rules. Otherwise it was always right up there with C/C++ for years.
16:53:46clyybberI know, pretty funny
16:55:23FromGitter<alehander92> i still feel pluggable syntaxes
16:55:25FromGitter<alehander92> might be a good idea
16:55:40FromGitter<alehander92> but maybe people just like to connect semantic ideas with certain syntaxes
16:55:48disruptekyeah, otherwise how else will we confuse everyone?
16:55:51FromGitter<alehander92> maybe the reason this doesnt take off is how we think, not technical
16:56:09FromGitter<alehander92> disruptek come one everything has to be pluggable
16:56:33FromGitter<alehander92> myFunction(mygrammar, customgc, custombackend) -> int
16:56:46FromGitter<alehander92> just like usa and laws
16:56:55Yardanicolol
16:56:56FromGitter<alehander92> and my understanding of law
16:57:02disrupteki have a rot13 plugin ready to go.
16:57:26FromGitter<alehander92> nim probablty doesnt need
16:57:31FromGitter<alehander92> so i say put it in every function
16:57:32clyybber"international law"
16:57:38clyybber""""
16:57:43FromDiscord<snluu> alehander92: HN itself definitely has a boner for anything that looks like ruby syntax, so while the project is cool, im sure that community is also receiving it with a lot of positive bias
16:57:51FromGitter<alehander92> international programming
16:58:07FromGitter<alehander92> can you imagine if calling an api from usa required going through the customs guys api
16:58:12FromGitter<alehander92> amazing
16:58:14*Hideki joined #nim
16:58:37*Hideki is now known as Guest35270
16:58:38FromGitter<alehander92> snluu but i dont think so, if it was a nim "cool os" thing, people would still be similar
16:58:56FromGitter<alehander92> they also like python-y syntax, everything "hackerish" like hobby oses
16:59:15FromGitter<alehander92> and underdogs
16:59:25FromDiscord<snluu> maybe. last time nim was posted there, a bunch of them bitched about โ€œwhitespace significanceโ€
16:59:39FromDiscord<Rika> ah man that gets on my nerves
17:00:09FromGitter<alehander92> ah its very random
17:00:14FromGitter<alehander92> sometimes they do sometimes not
17:00:18FromDiscord<Rika> like okay i get it sometimes linters/formatters fuck it up real badly (vscode plugin im looking at you)
17:00:39FromDiscord<Rika> idk
17:00:49FromDiscord<Rika> i dont like the "fuck whitespace significance" thing
17:00:57FromDiscord<Rika> like -> get
17:01:40FromGitter<sheerluck> Bug #12691: "detectOs doesn't find Ubuntu 18.04"; it doesn't find Gentoo as well, bc `uname -o` is "GNU/Linux" so `result = ("-" & $d & " ") in uname()` is false :(
17:01:42disbothttps://github.com/nim-lang/Nim/issues/12691 -- 3detectOs doesn't find Ubuntu 18.04 ; snippet at 12https://play.nim-lang.org/#ix=25fq
17:01:45FromDiscord<Rika> maybe the formatter thing is that important for them
17:01:53FromDiscord<snluu> i mean, i somewhat get it. when you work on a big open source project, people come from all parts of the world. it comes from the whole tab vs space thing, etc
17:02:01FromDiscord<snluu> not everyone has editorconfig installed
17:02:10Yardanico@sheerluck as I said in the issue itself, it would be better to rewrite it a bit to actually use lsb_release
17:02:14Yardanicofor all distros
17:02:30FromGitter<alehander92> if there are interesting projects in nim
17:02:31FromDiscord<Rika> @snluu that applies to whitespaced bracketed languages too doesnt it
17:02:33Yardanicoor also read "/etc/os-release"
17:02:33FromGitter<alehander92> this wouldnt matter so much
17:02:38FromGitter<alehander92> if python managed
17:02:41FromGitter<alehander92> it cant be so bad
17:02:46FromDiscord<Rika> python is "managing"
17:02:49FromDiscord<Rika> but not really no
17:02:57FromDiscord<Rika> its still met with a fucktonne of whitespace haters
17:03:02FromGitter<alehander92> well python is like hugely popular
17:03:06FromGitter<alehander92> it doesnt really matter
17:03:09FromGitter<alehander92> you cant win everyone
17:03:18FromDiscord<snluu> @Rika the thing is, in bracketed languages, people just bikeshed about styling. in python & Nim, it fucks up a build ๐Ÿ˜†
17:03:53Yardanicowell except that Nim is more permissive than Python when it comes to indentation (with spaces)
17:04:05FromGitter<alehander92> i wonder what to do for my vacation mini project
17:04:05FromDiscord<Rika> @snluu how what i dont get it
17:04:10Yardanicoor maybe the same, IDK if you can have one function with 2 spaces indentation, and other one with 3 spaces
17:04:14Yardanicoin python
17:04:18FromDiscord<Rika> Yardanico, i'd say Nim is more restricted than python in general
17:04:21FromDiscord<Rika> (no tabs)
17:04:33YardanicoI know, that's why I mentioned (with spaces)
17:04:34FromDiscord<Rika> Yardanico, no you cant
17:04:35FromDiscord<snluu> @Rika
17:04:35FromDiscord<snluu> ```
17:04:35FromDiscord<snluu> ```
17:04:39FromGitter<alehander92> work on my "hobby os" , or make a language toolkit example, or the little gdb in rust thing
17:05:13FromDiscord<Rika> @snluu i dont see what you're trying to show
17:05:16dom96I originally created https://github.com/dom96/nimkernel/ with the intention of doing something similar to lilith
17:05:19FromDiscord<Rika> is that intended...?
17:05:25FromDiscord<snluu> @Rika
17:05:25FromDiscord<snluu> ```
17:05:25FromDiscord<snluu> function x() {
17:05:25FromDiscord<snluu> doX()
17:05:25FromDiscord<snluu> doY()
17:05:26FromDiscord<snluu> }
17:05:26FromDiscord<snluu> ```
17:05:26FromDiscord<snluu>
17:05:27FromDiscord<snluu> ```
17:05:29FromDiscord<snluu> proc x() =
17:05:30FromDiscord<snluu> doX()
17:05:31FromDiscord<snluu> doY()
17:05:33FromDiscord<snluu> ```
17:05:34FromDiscord<snluu> one works, one doesnt
17:05:37Yardanicoplease use paste services :(
17:05:46FromDiscord<Rika> "fuck irc!"
17:05:55YardanicoD:
17:05:56FromDiscord<snluu> oh ops my bad
17:05:57FromGitter<alehander92> @dom96 i have https://github.com/alehander92/lodka which i based on nimkernel and https://github.com/samanthadoran/Mero
17:06:09FromDiscord<Rika> im joking, i'm `aeverr` on matrix
17:06:24dom96alehander92: where is the GUI and HN post? :P
17:06:46FromGitter<alehander92> thank you ! for nimkernel
17:06:51FromDiscord<Rika> @snluu you could argue that it shouldnt build because it doesnt work cognitively
17:06:52dom96Rika: nothing like running an embedded browser just to chat over the internet huh? :P
17:07:01FromGitter<alehander92> so one idea i had was to modularize this stuff
17:07:11FromDiscord<Rika> dom96, i wish discord wasnt like this
17:07:11FromGitter<alehander92> to libs like x86 / interrupts / etc
17:07:13FromGitter<alehander92> like rust
17:07:22FromGitter<alehander92> so its easier for people to construct hobby os-es
17:07:26FromDiscord<Rika> but i also wish irc had linebreaks and embed
17:07:33FromDiscord<Rika> add an s
17:07:52FromGitter<alehander92> @dom96 my idea for a gui is very TUI-ish :D
17:08:03dom96Rika: it just goes to show that perfection simply isn't necessary to gain millions of users. :)
17:08:33Araqperfection is rather harmful to this goal
17:08:40FromDiscord<Rika> why so?
17:08:43FromDiscord<snluu> @Rika I agree. Thatโ€™s why I use Nim. Just saying some people prefer to indent however they want
17:08:50FromGitter<alehander92> or "define my own custom gui framework and way to do things with no windows but with some other concept " thing which yeah no
17:08:54FromDiscord<snluu> comes from the language not having proper block support
17:09:17FromDiscord<snluu> where they wanna do things like โ€œopen fileโ€, everything in between indented, โ€œclose fileโ€
17:09:37FromGitter<alehander92> many languages have similar concepts today
17:09:38FromDiscord<Rika> ~~context manager~~
17:09:43FromGitter<alehander92> similar concept*
17:09:46FromDiscord<Rika> but i guess yeah that makes sense
17:09:58FromDiscord<Rika> usually i'd use comments for those
17:10:12Araqpersonally I would like to see Exokernels in Nim
17:10:30FromDiscord<Rika> like `# ~~~~ (repeated until col 80) \n # SOME NAME OR SOMETHING \n # ~~~~ (repeated until col 80)`
17:10:47*sealmove quit (Quit: WeeChat 2.6)
17:10:47FromDiscord<Rika> exokernel, thats a term ive learned pretty recently
17:11:20FromGitter<alehander92> exokernels sound fun
17:11:36FromDiscord<snluu> chemistry-dog.jpeg
17:11:47FromGitter<alehander92> so its like a library to write your own very low level application but still dont bother with too much arch/asm differences?
17:18:57*Guest35270 quit (Remote host closed the connection)
17:20:33FromDiscord<mratsim> oh zero-functional 1.0
17:22:09shashlickAraq: you here?
17:28:13FromGitter<deech> Is there an http file download library that supports `https` and `Digest` proxy server auth? The built in one only support `Plain`.
17:30:12Araqthe builtin one supports it just fine via -d:ssl
17:30:15Araqshashlick, pong
17:31:02FromGitter<deech> https://github.com/nim-lang/Nim/blob/devel/lib/pure/httpclient.nim#L136
17:33:32shashlickAraq: on #12939 - how do you reopen stdout
17:33:34disbothttps://github.com/nim-lang/Nim/issues/12939 -- 5stdout cannot be reassigned on some systems ; snippet at 12https://play.nim-lang.org/#ix=253B
17:33:47shashlickI get stdout redirected to a file, but how do I get stdout back?
17:34:07shashlicklike I mentioned in the issue, reassigning stdout works on posix, only not on windows
17:34:38FromGitter<deech> Sorry I meant `Basic` not `Plain`.
17:37:38shashlickAraq: I am using reopen on windows right now but I cannot recover stdout unlike on posix
17:38:22shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/toast.nim#L171
17:40:35FromGitter<sheerluck> Araq: This is my first contribution so be gentle please :) https://github.com/nim-lang/Nim/pull/12954
17:40:36disbotโžฅ fix for detectOs
17:41:48Yardanicolol
17:42:17FromDiscord<Rika> lmao did disbot fuck up unicode
17:42:35FromDiscord<Clyybber> lol
17:42:46disruptekdisbot: word on the street is you broke unicode. is this true?
17:42:47disbotyep. ๐Ÿ˜Š
17:42:50disruptekjesus.
17:43:47FromDiscord<Clyybber> fuck this shit, I'm going back to IRC where those fucking emojis are just fancy nice boxe
17:43:48FromDiscord<Clyybber> s
17:44:29livcdi am on irc and i see a smiley face
17:44:43disruptekhe's a smug mofo, isn't he?
17:46:12*GitterIntegratio quit (Quit: killed)
17:46:13*aeverr[m] quit (Quit: killed)
17:46:14*BitPuffin quit (Quit: killed)
17:46:14*Connor[m] quit (Quit: killed)
17:46:22*isaac[m]1 quit (Quit: killed)
17:46:22*nc-x[m] quit (Quit: killed)
17:46:22*Miguelngel[m] quit (Quit: killed)
17:46:23*yglukhov[m] quit (Quit: killed)
17:46:23*Balu[m] quit (Quit: killed)
17:46:28*lqdev[m] quit (Quit: killed)
17:46:32*planetis[m] quit (Quit: killed)
17:46:34*macsek1911[m] quit (Quit: killed)
17:46:34*pigmej quit (Quit: killed)
17:46:36*leorize[m] quit (Quit: killed)
17:46:38Yardanicorip matrix bridge
17:46:39*skrylar[m] quit (Quit: killed)
17:46:45*Manny8888 quit (Quit: killed)
17:46:48*watzon[m] quit (Quit: killed)
17:46:50*salotz[m] quit (Quit: killed)
17:46:51*xomachine[m] quit (Quit: killed)
17:46:54*Demos[m] quit (Quit: killed)
17:46:54*k0mpjut0r quit (Quit: killed)
17:46:56*zielmicha[m]1 quit (Quit: killed)
17:46:56*TheManiac[m] quit (Quit: killed)
17:46:56*spymasterd[m] quit (Quit: killed)
17:46:56*d-nice2[m] quit (Quit: killed)
17:46:56*vycb[m] quit (Quit: killed)
17:46:59*nergal[m]1 quit (Quit: killed)
17:46:59*LEdoian[m] quit (Quit: killed)
17:47:00*lasso[m] quit (Quit: killed)
17:47:17FromGitter<alehander92> oh love the holiday
17:47:23FromGitter<alehander92> what happens to matrix
17:47:40Yardanicomatrix<->freenode bridge dies from time to time
17:47:42ehmrythe bridge is written in nodejs
17:47:44FromGitter<alehander92> i am in a mood to throw stange dsl-s at people
17:47:49FromGitter<alehander92> sorry
17:47:49clyybberehmry: sad noises
17:47:53FromGitter<alehander92> we can rewrite it
17:48:08FromGitter<alehander92> we need better discord<->irc from long time
17:48:18clyybberalehander92: oh yeah, do it, throw something like breeze at macros.nim in a PR please :D
17:48:27clyybberthat would be fine D
17:48:57disruptekthe problem with the bridge is that it basically works.
17:49:27FromGitter<Willyboar> @alehander92 i have a nice holiday project for you
17:49:36disruptekit's hard to justify rewriting it because there aren't enough suggested improvements.
17:50:17FromGitter<alehander92> @Willyboar oh nice
17:50:21FromGitter<alehander92> how is nimux going
17:51:02FromGitter<Willyboar> This is your xmas project :p
17:52:02FromGitter<Willyboar> I finished the future structure and i want to write the cli part
17:52:38clyybbercligen?
17:53:00clyybberor do you mean something like ncurses?
17:54:11FromGitter<Willyboar> I want to write cli commands for create project, scaffold, migration files etc. I dont know if i will use cligen
17:54:55shashlickNo @leorize in a while now
17:55:07*Hideki joined #nim
17:55:09shashlickNeed some nimsuggest chops
17:55:10FromGitter<Willyboar> I want to keep the dependency list short
17:55:20disruptekcligen is practically stdlib.
17:55:30*Hideki is now known as Guest38521
17:55:53clyybberWillyboar: You should really use cligen
17:57:29clyybberbbl
17:57:30*clyybber quit (Quit: WeeChat 2.7)
17:57:39FromGitter<alehander92> i actually have a bigger idea
17:57:56FromGitter<Willyboar> Drop it
17:58:04FromGitter<alehander92> one can write a scaffolding framework
17:58:14FromGitter<alehander92> as many projects in many languages need a simple way to define scaffolds
17:58:17FromGitter<alehander92> but i think this exists
17:58:18FromGitter<alehander92> actually
17:58:21FromGitter<alehander92> i forgot its name
17:58:35FromGitter<alehander92> it was mostly about project structure maybe but it seems similar
17:58:36disruptek!repo nim_websitecreator
17:58:37disbothttps://github.com/ThomasTJdev/nim_websitecreator -- 9nim_websitecreator: 11Nim fullstack website framework - deploy a website within minutes 15 76โญ 2๐Ÿด
17:58:38FromGitter<alehander92> anyway its offtopic
17:59:28FromGitter<alehander92> but for nimux i think you can define
17:59:30FromGitter<Willyboar> Disruptek this is not framework
17:59:43FromGitter<Willyboar> Is more a cms
18:00:36FromGitter<alehander92> https://github.com/alehander92/http/blob/master/src/http.nim#L406 โŽ and
18:00:37FromGitter<alehander92> https://github.com/alehander92/http/blob/master/src/http.nim#L254 those
18:00:42FromGitter<alehander92> thats how i started doing it
18:00:48FromGitter<alehander92> but i admit its a bit too simple
18:00:49FromGitter<Willyboar> Nwx can be a wordpress alternative
18:01:16FromGitter<alehander92> https://github.com/alehander92/http/blob/master/src/http.nim#L386
18:01:30FromGitter<Willyboar> I have build projects from console with my static generator
18:02:01FromGitter<alehander92> i think some kind of a bit more general lib can just define lists with "templates" for each submenu
18:02:24FromGitter<alehander92> and high level commands
18:02:25FromGitter<Willyboar> This is not the difficult part
18:02:41FromGitter<alehander92> but i dont see a difficult part then
18:02:59FromGitter<alehander92> Araq : i decided to apply your fav idea in reverse
18:03:06FromGitter<Willyboar> The difficult is after that
18:03:10FromGitter<alehander92> code generators! need tokens. like lexers
18:03:21FromGitter<Willyboar> :) routing, dsl etc
18:03:52FromGitter<alehander92> for generation: e.g. `code a & "." & b` in my dsl would generate tokens and then depending on format / debuginfo options additional stuff for each token
18:04:01FromGitter<alehander92> @Willyboar oh i agree
18:04:12*nsf joined #nim
18:05:29FromGitter<Willyboar> Will see.
18:10:01FromGitter<alehander92> here it depends on stuff like middleware
18:10:24FromGitter<alehander92> i'd try to use more types there to somehow make validation more obvious
18:11:23FromGitter<alehander92> you can generate validators from stuff like `a: string(4..20)` and somehow propagate the validated values only "untainted" types internally
18:11:29FromGitter<alehander92> but probably thats a bit too far
18:11:44FromGitter<alehander92> i guess just a good dsl for validation and models is great enough
18:11:58*endragor quit (Remote host closed the connection)
18:12:28*Guest38521 quit (Ping timeout: 260 seconds)
18:13:43disruptekyou could generate the concepts surrounding the types.
18:14:30FromGitter<alehander92> but concepts wouldnt cut it
18:14:37FromGitter<alehander92> some of those checks can be only dynamic
18:14:44FromGitter<alehander92> so i imagine somehow just ensuring
18:14:51FromGitter<alehander92> what you can do is to simulate typepass
18:14:56FromGitter<alehander92> ugh i forgot it zah explained it once
18:15:02FromGitter<alehander92> typestate yeah
18:15:14FromGitter<alehander92> state machine for types
18:15:33disruptekright, but that can be generated, too.
18:15:36FromGitter<alehander92> you have validate(input: A) -> B, internalApi(input: B) -> C .. (C) -> Output
18:15:46FromGitter<alehander92> so you can only generate B after validation
18:15:55FromGitter<alehander92> and Output after e.g. other stuff
18:16:24FromGitter<alehander92> yeah, but no need, its mostly just "make only those procs take A"
18:17:03FromGitter<alehander92> but you probably need a small dsl to make it easier to make different "stages" of the same type with the same fields
18:17:15FromGitter<alehander92> but thats not really web framework specific, a general lib problem
18:17:59FromGitter<alehander92> e.g. you can generate it from case objects definitions indeed
18:20:35FromGitter<alehander92> but this is again probably not relevant for a web framework sorry for the spam @Willyboar
18:25:14FromGitter<alehander92> http://ix.io/25fW
18:25:18FromGitter<alehander92> clyybber Araq
18:25:25FromGitter<alehander92> this is the next iteration
18:25:29FromGitter<alehander92> of my idea :D
18:25:55FromGitter<alehander92> disruptek totally reusing npeg
18:26:16*luis_ joined #nim
18:26:39Zevv"reusing"?
18:28:30*leorize[m] joined #nim
18:28:30*Connor[m] joined #nim
18:28:31*BitPuffin joined #nim
18:28:31*GitterIntegratio joined #nim
18:28:31*lqdev[m] joined #nim
18:28:31*nergal[m]1 joined #nim
18:28:31*Demos[m] joined #nim
18:28:32*isaac[m]1 joined #nim
18:28:32*k0mpjut0r joined #nim
18:28:36*lasso[m] joined #nim
18:28:36*vycb[m] joined #nim
18:28:37*aeverr[m] joined #nim
18:28:37*spymasterd[m] joined #nim
18:28:37*xomachine[m] joined #nim
18:28:37*TheManiac[m] joined #nim
18:28:37*d-nice2[m] joined #nim
18:28:37*Miguelngel[m] joined #nim
18:28:37*zielmicha[m]1 joined #nim
18:28:38*nc-x[m] joined #nim
18:28:38*watzon[m] joined #nim
18:28:38*LEdoian[m] joined #nim
18:28:38*yglukhov[m] joined #nim
18:28:38*planetis[m] joined #nim
18:28:38*macsek1911[m] joined #nim
18:28:38*skrylar[m] joined #nim
18:28:39*Manny8888 joined #nim
18:28:39*salotz[m] joined #nim
18:28:39*Balu[m] joined #nim
18:28:39*pigmej joined #nim
18:29:00disrupteki think i'd need to be stoned to follow this paste.
18:29:15Zevvwhat's stopping you?
18:29:25disrupteki have to do some driving later.
18:29:42Zevvfair enough
18:29:58disruptekc'mon people, i need some bugs.
18:30:37Zevvhttp://zevv.nl/div/here-is-your-bug.png
18:30:38FromDiscord<Rika> merry christmas, your christmas gifts are bugs
18:31:24disrupteki mean, not bugs in nimble.
18:31:27disruptekbugs in nimph.
18:31:29Zevvooooh
18:31:31Zevv:)
18:31:40disrupteki wonder what that is.
18:32:28disruptekwhy are you even running `nimble build`?
18:32:33Zevvdude what is my computer doing. I only typed './boostrap.sh' and now it's downloading and building the whole world?!
18:32:44Zevvdisruptek: why not
18:33:20disruptekwhen i compile stuff i use a compiler.
18:33:32Zevvfunny man you are
18:33:39disruptekso i've been told.
18:34:01disruptekmy `nimble build` crashes too, but from a different bug.
18:34:26Zevverror messages being *italic* does probably not count as a bug, right?
18:34:40disrupteki thought you stripped those out?
18:34:50Zevvnot the italics, apparently
18:35:04disruptekthere is a compile-time option to turn them off. just for you.
18:35:09Zevvwow!
18:35:15disrupteki know, right?
18:35:29rockcaverahow to get the executable folder?
18:35:34disruptek--define:cutelogBland
18:35:47disruptek--define:cutelogMonochrome as well
18:35:57disrupteksee src/nimph.nim.cfg
18:35:59Zevvdude
18:36:03Zevv+1!
18:36:07disrupteki know, i know. merry christmas.
18:36:37disruptekalso i dunno if i ever tested them. so they might be bugged.
18:37:07disruptekit seems like they work.
18:37:10ZevvEven my christmas lights are green
18:37:19disrupteklol
18:37:37disruptekincidentally, are you color blind?
18:37:43ZevvI whish, sometimes
18:38:17Zevvboldblind and italicsblind would be ok every now and then as well
18:38:47disruptekjust turn your head.
18:38:53Zevvyes, works
18:38:53disruptekinstant italics-blindness.
18:39:36disruptekwhat i want to know is,
18:39:41disruptekwhy is reading from nil so wrong?
18:39:46Zevvok. I created a new project with nimble init. Now I run nimph without arguments and my screen is full or red and yellow italics
18:39:49Zevvis that a bug?
18:39:51disrupteki'm tired of being punished in the search for knowledge.
18:40:05disruptekZevv: probably not.
18:40:10Zevvhttp://ix.io/25g3
18:40:34disruptekwhat's in your nn.nimble?
18:40:42Zevvhttp://ix.io/25g4
18:40:44Zevvgenerated by nimble
18:41:00disruptekand nimble cannot read it?
18:41:03ZevvNope :)
18:41:07disruptekyou need "" around the strings.
18:41:12disruptekgah. wtf nimble.
18:41:35disrupteki swear it's like no one tests this stuff.
18:42:06Zevvhttp://zevv.nl/div/yeahIknow.gif
18:42:43disrupteki guess this is a scenario i can test for, maybe, somehow.
18:43:02Zevvmy nimble is ancient probably, again
18:48:12shashlickooo I found the nimsuggest log file, it's in my home dir
18:50:28ZevvI think I also have problems parsing alehander92 proposal doc
18:51:41*endragor joined #nim
18:53:41disruptekthere's a bug fix for ya.
18:55:33disruptekwe need someone to write an alehander92 parser doc parser.
18:56:13*endragor quit (Ping timeout: 260 seconds)
18:56:35disrupteki read from nil and you know what happened?
18:56:42disrupteknothing.
18:58:37Zevvwhat exactly does "Exception: 'version' is not accessible using discriminant 'kind' of type 'Release'" mean?
18:59:06disruptekit means Release is a variant object of the wrong variant to supply a version field.
18:59:22disruptekhey, i spent hours on that error message. it's not obvious enough?
18:59:38ZevvI must admit it eludes me what I should do to solve this
18:59:47disruptek0.6.3 is improved. try that.
19:00:11disruptekbut also, put your name in "". ditto the description.
19:00:15ZevvI did
19:00:18Zevvof course
19:00:21disruptekoh, you still get an error?
19:00:28Zevvyeah
19:00:44disruptekhmm, i can't reproduce using the same .nimble.
19:00:49Zevvhttp://ix.io/25gk
19:01:32disruptekpull and rebuild nimph please.
19:01:41ZevvI did - is ./boostrap.sh enough?
19:01:53Zevvafter 'git pull', of course
19:01:58disruptekto build it, yes, it should be.
19:02:01FromDiscord<Rika> disruptek, i'm already pretty fuckin high (not literally, cant find a better equivalent word in english) right now and i still cant understand alehander
19:02:18disruptekpretty fuckin' high is pretty fuckin' accurate, i think.
19:02:30FromGitter<alehander92> zevv disruptek
19:02:36FromGitter<alehander92> i just mean i would use
19:02:37nisstyrehow can you be high but not nigh
19:02:38disrupteknimph --version says 0.6.3?
19:02:42FromGitter<alehander92> npeg for the parser dsl
19:02:48FromGitter<alehander92> but maybe this gives somemore
19:03:01nisstyres/nigh/high/
19:03:21FromGitter<alehander92> https://gist.github.com/alehander92/d207c2f9a681e7c1e37c64b9576c2de7
19:03:27nisstyreAnyone hiring Nim developers?
19:03:28FromGitter<alehander92> context
19:03:33nisstyreor know of positions open
19:03:44FromGitter<alehander92> but more focused on "just building funny experiments" than "2nd impl"
19:04:09Zevvbttw @alehander92: not sure if you picked that up today: npeg got a bit of an upgrade today, it can now parse any seq[T] you put in - ideal for two stage lexer/parser for example
19:04:10nisstyre(doesn't have to be just Nim, it would be cool to use it for even part of a project)
19:04:37nisstyreZevv: so you could write all your compiler passes with a PEG?
19:04:39nisstyrethat's pretty cool
19:04:47disrupteknisstyre: drop a link to your cv?
19:04:56FromGitter<alehander92> great !
19:05:24FromGitter<alehander92> Zevv but anyway basically i want to also define dsl-s for several other things
19:05:28Zevvnisstyre: well, technically it already could do the same stages, but combined grammers with lexers/parsers tend to be nasty
19:05:36Zevvalehander92: DSL away!
19:05:39FromGitter<alehander92> and a conventional way to write all the other custom code
19:06:08nisstyredisruptek: sure, https://wesk.tech/weskerfoot.pdf
19:06:09FromGitter<alehander92> and make an example subset-of-c / minimal-subset-of-nim / myownthing impl
19:06:14FromGitter<alehander92> as an example
19:06:30FromGitter<alehander92> and the point of the `passes` thing is to demostrate
19:06:39FromGitter<alehander92> configuration which enables the framework
19:06:45FromGitter<alehander92> to compile parallelly
19:06:48FromGitter<alehander92> and with caching
19:06:58FromGitter<alehander92> if the structure of the lang/config allows it
19:07:09Zevvsweet
19:07:25nisstyreZevv: I agree, I think a lot of people still write the lexer by hand for performance/control too
19:07:46FromGitter<alehander92> and it should also make it easy to autogenerate debug info + server stub for repl/langserver
19:07:48nisstyrealso for certain things like, e.g. precedence parsing, PEGs aren't necessarily a great solution
19:07:53FromGitter<alehander92> but this is like a huge wannabe thing
19:08:35FromDiscord<Rika> thats a lot of likes
19:08:39FromGitter<alehander92> but you can imagine a single language impl which can be very scripted/configured
19:08:54Zevvnisstyre: true, that was a big PITA for NPeg as well. I got around this by extending PEG with knowledge of precedences, which works quite well
19:09:11FromGitter<alehander92> so if you can adapt your hobby lang code to somehow fit the "convention" structure
19:09:16Zevvnisstyre: https://github.com/zevv/npeg/blob/master/misc/rod.nim#L181 for example
19:09:16FromGitter<alehander92> / interfaces
19:09:20FromGitter<alehander92> it should be kinda fine
19:09:35FromGitter<alehander92> of course people think this is insane
19:10:06FromGitter<alehander92> and they are kinda right that it is very confusing
19:10:13FromGitter<alehander92> so i need to write a bigger example project
19:10:43nisstyreZevv: if you use an algorithm like precedence climbing you can make it possible to define operators within the language itself too, since all you need is to add it to a table with the associativity/precedence and you're good
19:10:50nisstyrenot sure if your solution allows for that or not
19:10:51Zevvalehander92: maybe make it more concrete already, just make up an example DSL to show a practical example?
19:11:06FromGitter<alehander92> i made a bit for the type checking
19:11:16FromGitter<alehander92> and the passes config
19:11:21nisstyrelooks like it probably could with some tweaking
19:11:29*sagax quit (Read error: Connection reset by peer)
19:11:29FromGitter<alehander92> e.g. the passes thing shows you can parse the input files
19:11:45FromGitter<alehander92> oh wait, it needs some tweaking to find out imports sooner
19:11:54disrupteki just can't reproduce this issue.
19:12:02Zevvnisstyre: that's basically whats happening here. There's precedence climbing inside the generated parser, certain paths of the parse tree are only available depending on the current precedence, recursion will hit a dead end and will backtrack to the previous level
19:12:17nisstyreZevv: oh, that's awesome
19:12:18Zevvwell, not backtrack - continue from there, basically
19:12:24nisstyreI'm going to have to dig into that later
19:13:04FromGitter<alehander92> but after that it would be : parse files parallelly in a queue then generate their dependency graph, then semcheck them in several passes parallelly, then apply local optimization paralellly, but then optionally global one serialy(as you probably cant isolate that well) and then join those jobs and finish with parallel codegen (and here it depends on the backend if you have linking etc)
19:13:35FromGitter<alehander92> and you can see that you can cache on "finish of stage for module A" here
19:13:41Zevvdude dont overdo it :)
19:13:46FromGitter<alehander92> and autogenerate caching strategies
19:14:00FromGitter<alehander92> i am only beginning!
19:14:26FromGitter<alehander92> but i dont really think its overdoing it, its mostly just functions in pipelines of processess
19:14:39FromGitter<alehander92> small blocks
19:14:43FromGitter<alehander92> combined with other blocks
19:16:18disruptekzevv: gimme another screenshot?
19:16:46Zevvof what?
19:16:53disruptekwhatever this bug is.
19:17:01ZevvException: 'version' is not accessible using discriminant 'kind' of type 'Release'
19:17:19disruptekbut the input is just the .nimble file?
19:17:29disrupteknothing else in the directory? because i cannot achieve that error.
19:17:33ZevvI guess? I just type 'nimph' without arguments
19:17:53Zevvthere's src/nn.nimp which echo "hello" in there
19:18:15disruptekmaybe your binary is not up-to-date.
19:18:23FromGitter<alehander92> and yeah we need something like stuff easily loadable from memory
19:18:24*nsf quit (Quit: WeeChat 2.6)
19:18:45Zevvdisruptek: http://ix.io/25gB
19:19:00FromGitter<alehander92> and a "database"-y thing so processes can indeed share some global stuff, but i hope its not so much slower
19:19:17disruptekthis is nuts.
19:19:34Zevvalehander92: sounds like a project - I'll be watching you
19:19:39leorize[m]shashlick: you were looking for me?
19:20:16*luis_ quit (Quit: luis_)
19:20:29disruptekZevv: you must have some broken package in ~/.nimble/pkgs
19:20:44*luis_ joined #nim
19:20:46disruptekecho '--clearNimblePath' > nim.cfg
19:20:57*sagax joined #nim
19:21:03leorize[m]you can configure nimsuggest by editing 'autoload/nim/suggest.vim' in nim.nvim
19:21:09Zevv๐Ÿ‘Œnn version 0.1.0 lookin' good
19:21:11*luis_ quit (Client Quit)
19:21:19disruptekthat helped?
19:21:22leorize[m]shashlick: add '--log' to extraArgs
19:21:22Zevvit seems
19:21:37*luis_ joined #nim
19:21:48disruptekthanks. this gives me something to try to repro.
19:23:15disruptekecho '--nimblePath="$config/deps/pkgs/"' >> nim.cfg
19:23:17FromGitter<bung87> anyone rember a arcticle about string cstring shallow copy ?
19:23:25disruptekthen you can play with local deps.
19:24:39disruptekleorize[m]: is there an option to toggle completion for keyword identifiers?
19:25:52shashlick@leorize ya got lucky and found the nimsuggest log
19:26:09shashlickI've fixed the issue, now nimterop generated symbols will work
19:26:29shashlickAs long as you run with nim c at least once so that symbols get cached
19:27:49disruptekyou're kidding.
19:29:08*luis_ quit (Ping timeout: 248 seconds)
19:29:14FromDiscord<mratsim> The last hour of discussion is hell to parse on Discord
19:29:43federico3why?
19:29:43Zevvswitch to IRC then :)
19:29:44disruptekshashlick: is that in trunk?
19:29:52disrupteksrsly
19:30:08FromDiscord<mratsim> no one saw my post :/ https://www.reddit.com/r/programming/comments/eenkf2/zerofunctional_10_zerocost_functional_programming/
19:30:43FromDiscord<mratsim> or this one: https://news.ycombinator.com/item?id=21865204
19:31:21Zevvmratsim: is that yours? I didnt even know!
19:31:39disruptekit's not new.
19:32:07Zevvno, but it's 1.0.0. Which is always reason to celebrate
19:32:37dom96bah, how is it possible for Nimble's package parser to disintegrate without me updating Nim or Nimble at all
19:33:14disruptekcosmic radiation.
19:33:26Zevvbit rot
19:33:27FromDiscord<mratsim> @dom96, pretty sure findExe is broken
19:33:41disrupteksince when?
19:33:44dom96First this error appeared after my task finished successfully, which was odd but I ignored it
19:33:50dom96and now it just fails outright: https://gist.github.com/dom96/6b0b8279dbbf72047912d8d893ccedec
19:33:53FromDiscord<mratsim> it's broken when using git bash under windows
19:34:32FromDiscord<mratsim> oh this one seems new, though there is still the "." in the error message
19:35:06disruptekgit bash under windows?
19:36:26skrylar[m]consteval: because running m4 wasn't good enough
19:36:30skrylar[m]or something.
19:36:58dom96wtf this line isn't under the `when nimvm` branch
19:37:03skrylar[m]i kind of agree with go's approach of just giving you the compiler as a lib so you can parse your code and then saying good luck just generate any meta crap you need out of band
19:37:16dom96I swear I will rip out nimscript from Nimble, *sigh*
19:37:50skrylar[m]you could just make a wasm backend and run wasm from nimble ๐Ÿคฃ
19:38:00shashlickdisruptek: just pushing, laptop crashed
19:38:37dom96oh, it is my fault after all
19:38:57shashlickit is in the issue144 branch, running through CI
19:39:00dom96My .nimble file imports a file which now does a `staticExec`
19:40:28dom96the error message here is absolutely horrible :(
19:43:22disruptekskrylar: nim /does/ provide the compiler as a lib.
19:44:06dom96disruptek, barely
19:44:40FromGitter<alehander92> zevv disruptek this is not a vacation project
19:44:44disruptekshashlick: awesome! it works!
19:44:47FromGitter<alehander92> i feel i need bell labs to do it
19:44:56shashlickdisruptek: awesome, thanks for checking ๐Ÿ™‚
19:45:04disruptekw000h0000000
19:45:29disruptekwow i've gone so long without leorize's benefit. good to have you back, buddy.
19:45:37disrupteknearly 8,000 lines of bullshit error messages.
19:45:49shashlickseriously, he showed up and it works
19:45:53disruptekright?
19:46:09disruptekit's christmas over here.
19:46:17disrupteki got the colored lights up for zevv and everything.
19:46:30disrupteki even got a bug report.
19:46:37disruptekh0 h0 h0 merry merry merry
19:47:04FromGitter<alehander92> yeeee
19:51:03disruptekman this is huge.
19:53:04lqdev[m]leorize: you here?
19:55:55dom96shashlick, does Nimble store cache anywhere but /tmp/nimblecache?
19:56:50dom96I've literally stashed my changes and I'm still getting this error.
19:57:37skrylar[m]@disruptek
19:57:56skrylar[m](and then i fail at tagging) that was mostly a reply to a few hours ago when people were dissing c++'s far reaching nonsense
19:58:29skrylar[m]they seem to be gifted at realizing the hundreds of pages of nonsense is not safer or simpler than just letting someone defmacro
19:58:53disruptekgo, you mean?
19:59:28skrylar[m]no, they were talking about c++ consts
20:00:10skrylar[m]i can respect go since they would rather just not do something than do it badly
20:00:59disruptekoh, i see. m4.
20:03:10*azed joined #nim
20:08:29disruptekzevv: i think your bug is fixed.
20:09:35*Hideki joined #nim
20:09:57*Hideki is now known as Guest30967
20:12:58*nsf joined #nim
20:14:25*Guest30967 quit (Ping timeout: 265 seconds)
20:15:58skrylar[m]go put in that thing where you can put a backtick string on struct fields and sort of shrugged it off as a generic way to meta-tag stuff, which is a little clunky but it does scale.
20:16:10skrylar[m]before my laptop died i saw one of the cryptopunks here complaining that their bignum lib in nim built slow
20:22:11FromGitter<alehander92> disruptek do you have a movie bot
20:22:15FromGitter<alehander92> !disbot give movei
20:22:19FromGitter<alehander92> ok english bad
20:40:06*jonafato quit (Quit: ZNC - http://znc.in)
20:40:07*Trustable quit (Remote host closed the connection)
20:40:16*jonafato joined #nim
20:42:52*oculux quit (Ping timeout: 268 seconds)
20:46:17*oculux joined #nim
20:52:02shashlickdom96: just should be that place
20:55:19shashlickdisruptek: merged to master and tagged
21:10:34Zevvdisruptek: i think my bug is fixed.
21:11:53Zevvwhy doesn't the doctor fix my tags?
21:12:37Zevvoh 'nimph tag' just fixed my tags retroactively, sweet
21:13:05*oculux quit (Ping timeout: 258 seconds)
21:13:28Zevvyou ask for bugs when you have *fourty six* open issues?!
21:16:08*oculux joined #nim
21:18:59*Mister_Magister quit (Ping timeout: 265 seconds)
21:23:27*Mister_Magister joined #nim
21:24:29*leorize joined #nim
21:31:06*gour quit (Remote host closed the connection)
21:47:17disruptekyeah, it does retroactive tagging.
21:47:45disruptekthe problem with that feature is that github ranks the releases by date, so...
21:48:10disrupteki guess it's still correct, but not perfect.
21:49:28Zevvnot something you can help, github problem
21:50:03disrupteki sort on version anyway. maybe we will one day be able to fix the timestamps, too.
21:50:34disruptekyou can use the graph command to look for missing tags in advance.
21:50:48disruptekor, it warns you in --dry-run, right?
21:50:57Zevvi dindnt dry run
21:51:34Zevvi saw in my git reflog that it messed about alot though. checkking out all the tags etc?
21:51:58disruptekyeah; if the repo is clean it will roll it around to find out when the version changed.
21:52:24Zevvmake sense
21:52:29disruptekif it's dirty, it can only look at tags but not the .nimble file.
21:53:13disruptekwould upgrade nimterop from 0.4.2 to v0.4.3
21:53:15disruptekwoohoo
21:55:35disruptekso what should i prioritize, zevv?
21:59:47*watzon quit (Quit: WeeChat 2.7)
22:00:09leorizedisruptek: there aren't any option for keyword completion
22:00:35disruptekmfiano was pretty upset. said he couldn't write nim without proper keyword completion.
22:00:49leorizelqdev[m]: o/
22:01:04leorizethere are only a handful of them...
22:01:20disrupteki know. i showed him the keywords.txt. ๐Ÿคท
22:04:41leorizeusually I'd add more features but the keywords are so short it's kinda useless for autocompletion
22:04:56disruptekagree. he wanted completion for `proc`.
22:05:12leorizejust point them to tabnine if they really need that :P
22:06:09disrupteki like to think that i'm intolerant of crappy software, but that surpasses even my high standards.
22:07:43*Vladar quit (Quit: Leaving)
22:08:18skrylar[m]tabnine no longer offers their offline options
22:08:28skrylar[m]or rather they're sub-only now :|
22:09:35*NimBot joined #nim
22:09:52leorizethere's the tabnine professional in beta
22:10:25skrylar[m]the algorithm they used to use isn't all that complex.. needs some doing tho
22:11:22skrylar[m]well if everything is on one line you can just look for repeating tokens and replace those with {1} and so on... multi-line expressions a bit harder because you have to find where to split those, but none of the examples on their site used to show it with multi-line expressions so i don't know if it ever supported it
22:13:37leorizeanyone wanna volunteer to help this person? https://github.com/alaviss/nim.nvim/issues/19
22:13:38disbotโžฅ Can't install, Please help
22:14:19disrupteki don't use vim package managers. i just git clone stuff. is that weird?
22:15:02leorizei use a small script wrapping git clone, but basically the same idea
22:20:20disruptekif i don't specify `installExt = @["nim"]`, nimble doesn't install .nim files for my hybrid project? is that right?
22:20:23skrylar[m]pathogen :c
22:22:02FromGitter<bung87> @zevv https://github.com/bung87/nlm/blob/master/src/nlm.nim#L123 can you help find out why it doest match?
22:23:54solitudesfif you have `bin` set, it cant know that your project is hybrid
22:24:28disruptekhmm, i just did `nimble init` and it created a "hybrid" .nimble that includes installExt and bin.
22:25:03disruptekalso, zevv, the strings seem to've been written correctly. so, y'know, upgrade your nimble.
22:25:09solitudesfwell, yes, you have to have both to count as hybrid
22:25:18disruptekso that's what nimph should do?
22:32:03*solitudesf quit (Ping timeout: 260 seconds)
22:35:17*jken_ quit (Ping timeout: 268 seconds)
22:39:44*jken joined #nim
22:39:51shashlickvire is my vim package manager
22:43:06*clyybber joined #nim
22:45:55*clyybber quit (Client Quit)
22:50:39*koltrast joined #nim
22:53:27*nsf quit (Quit: WeeChat 2.6)
22:53:37FromDiscord<Milerius> Hey is it possible to have a thread name in the logging module ?
22:53:47FromDiscord<Milerius> So we can set in each thread the name of our current thread
22:54:05disrupteksure, you can control the format string used for logging.
22:54:09FromDiscord<Milerius> https://nim-lang.org/docs/logging.html#basic-usage-format-strings It's will be fantastic to have it here
22:54:20FromDiscord<Milerius> Yeah but there is nothing for the thread name ?
22:54:22FromDiscord<slymilano> Curious what you Nim vets think. What things would move the needle to increase Nim mindshare? More packages in the nimble directory? More API wrappers and such?
22:54:57shashlickmore people using nim every day to build real things
22:55:07shashlickand being noisy about it
22:55:19disruptekprobably noise is the main thing.
22:55:32FromDiscord<slymilano> Yeah Iโ€™m building consumer apps with Nim and posting on HN and Reddit
22:56:00FromDiscord<slymilano> A single static binary thatโ€™s 6MB is incredibly compelling and good publicity bait
22:56:11disruptek6mb?
22:56:12FromDiscord<Milerius> What i would like is something like
22:56:16*endragor joined #nim
22:56:19disruptekmy pants are getting tight.
22:56:25FromDiscord<slymilano> I meant 1MB binary 6MB ram on use hehe
22:56:26FromDiscord<Milerius> `var consoleLogger = newConsoleLogger(fmtStr="[$levelid][$date $time][$thread_id]: ")`
22:56:40FromDiscord<Milerius> But i don't think it's possible atm to add the thread ID
22:57:04disruptekjust alter the format string inside your thread.
22:57:11FromDiscord<slymilano> Jester is awesome but a more traditional Rails/Phoenix would be amazing
22:57:28FromDiscord<slymilano> If anyone starts one hopefully I can learn enough Nim to help
22:57:37disruptek!repo nimx
22:57:38disbothttps://github.com/yglukhov/nimx -- 9nimx: 11GUI library 15 580โญ 54๐Ÿด 7& 1 more...
22:57:49disrupteknot that one. what is mr. boar's repo called?
22:57:58disruptek!repo willyboar/
22:57:58disbothttps://github.com/Willyboar/nimux -- 9nimux: 11WIP Nim MVC Web Framework 15 4โญ 0๐Ÿด
22:58:03disruptekthere you go.
22:58:10FromDiscord<slymilano> Nice gonna check that out
22:58:20shashlickthere are lots of opportunities but we need to have a zero bug experience
22:58:20FromGitter<Willyboar> don't do it
22:58:31disruptekDON'T DO IT
22:58:32FromDiscord<slymilano> My app is simple af but useful
22:58:44FromDiscord<slymilano> !repo torrentim
22:58:45disbothttps://github.com/banenen/torrentImdb -- 9torrentImdb: 11Conencts torrent page to IMDB information popup 15 0โญ 0๐Ÿด
22:58:55FromDiscord<slymilano> No wrong repo
22:59:02FromGitter<Willyboar> @smyliano it's not completed
22:59:03FromDiscord<slymilano> Why donโ€™t do it? Is it abandoned?
22:59:30FromGitter<Willyboar> In fact it's not even started
22:59:42FromDiscord<slymilano> Oh lol
22:59:49FromDiscord<slymilano> Letโ€™s start one fuck it
22:59:58FromDiscord<exelotl> one day I wanna make an open source clone of adobe fireworks
23:00:26FromGitter<Willyboar> You are welcome to contribute if you want
23:00:30FromDiscord<slymilano> Imagine a rails like single binary, handle 300,000 req per second on minimal hardware.... Nim on the map
23:00:41FromDiscord<slymilano> Iโ€™ll take a look
23:01:29FromGitter<Willyboar> But this is my target too. A rails app compile din a single binary
23:01:33FromGitter<Willyboar> :)
23:01:38FromDiscord<exelotl> all the image editing software out there is horrible, tailored to a specific purpose or costs 1000 moneys
23:01:38skrylar[m]you'll still have to gently nudge the gophers once you get there
23:02:23FromDiscord<slymilano> I want people to care about performance again
23:02:51*endragor quit (Ping timeout: 268 seconds)
23:02:52FromDiscord<slymilano> The solution is to give people these tools
23:02:59FromGitter<Willyboar> The other target is to attract more people to use nim
23:03:20FromDiscord<slymilano> Hell yeah
23:03:57FromDiscord<slymilano> Iโ€™m already writing som easy Nim guides to increase ease of use
23:04:11FromDiscord<slymilano> Thinking about making a YouTube channel as well
23:04:18FromDiscord<slymilano> Send email with Nim etc etc
23:04:22FromDiscord<slymilano> Bullshit like that
23:04:33FromGitter<Willyboar> Nim is great
23:05:04FromGitter<Willyboar> I build a static blog generator in my second week in nim
23:05:18FromGitter<Willyboar> and i am not a programmer
23:05:30FromDiscord<slymilano> Well you kinda are now ๐Ÿ˜„
23:05:54FromGitter<Willyboar> nah i am too old to become one
23:06:06FromGitter<Willyboar> i just do it for fun
23:07:58FromGitter<deech> What does this syntax mean? `proc f(`a`,b:string)`
23:08:15FromDiscord<snluu> is there some way to create a module and import it from nim playground? I'm trying to show repro of an issue that requires importing another module
23:08:18FromGitter<deech> Sorry, `proc f(``a``,b:string)`
23:08:34skrylar[m]just means a is quoted for no reason
23:09:14skrylar[m]there are some reserved words you can still use if you quote it in backticks but you have to do that everywhere it gets referenced
23:09:19FromGitter<deech> Here for example: https://github.com/nim-lang/Nim/blob/version-1-0/lib/system/nimscript.nim#L224
23:09:50Araqfrom is a keyword, must quote it
23:09:56skrylar[m]yes, that's to stop the lexer from eating `from` as a keyword
23:10:01FromGitter<deech> Ah, got it.
23:11:59FromDiscord<snluu> so the linter has this small bug. if you have a name collision, and need to specify the module name, it will bark and says that the name should be without the prefix (at least it repros when I try to do `var xs: seq[mymodule.MyObjectWithNameCollision]`
23:13:53FromDiscord<snluu> something like this: https://gist.github.com/snluu/4d5abd441817761bf91797f59bc3edda
23:17:00FromDiscord<snluu> output: main.nim(9, 21) Hint: 'fileinfo' should be: 'FileInfo'
23:17:33disruptekoh bother.
23:17:59FromDiscord<snluu> well, i have --styleCheck:error set
23:18:07leorizemore AST traversing bugs I s'pose :P
23:18:08FromDiscord<snluu> so the build breaks unless i alias it or something
23:18:31leorizesee posix.nim for how to ignore style in an area :P
23:18:43FromDiscord<snluu> ๐Ÿ˜ฎ
23:24:18FromGitter<Willyboar> Araq is are you struggling to releasse arc for xmas?
23:25:00FromDiscord<snluu> I'm just aliasing the module for now. Regardless, reporting it here: https://github.com/nim-lang/Nim/issues/12955
23:27:10FromDiscord<Milerius> That's strange i'm setting name of thread from 2 different thread with different name and now they have same name in the logger ๐Ÿค”
23:28:45FromGitter<bung87> maybe just one thread write logs
23:36:00deependhow do I add a .ico icon to my binary on windows?
23:36:32deependlooks like koch is linking to the compiled resource file
23:37:01deependdo I need to use a windows tool to create a resource file or can I do this with nim compiler?
23:39:21*tobbez quit (Ping timeout: 250 seconds)
23:40:54*tobbez joined #nim
23:45:27disruptekshashlick: why is json preferable in #12950? don't you want the fully typed object instead?
23:45:28disbothttps://github.com/nim-lang/Nim/pull/12950 -- 3Add getCompileOptionString() to get Nim config at compile time
23:52:59deependrc is only for 32bit? guess rsrc for golang will work..
23:53:05deependdon't know what I'm doing but it's working now
23:53:06deependยฏ\_(ใƒ„)_/ยฏ
23:57:05shashlickdisruptek: I would but doubt compiler can give such access
23:57:49shashlickOnly int, float and string data types
23:58:24disruptekyeah but really?
23:58:57shashlick?