<< 03-09-2020 >>

00:01:08FromGitter<alehander92> what are zombies?
00:05:38FromDiscord<dk> What exactly happens when a socket is disconnected before `asyncnet.recv` finishes?
00:05:42FromDiscord<dk> `FutureError`?
00:06:45FromDiscord<dk> I mean `asyncnet.send`
00:12:53*awe00__ quit (Ping timeout: 260 seconds)
00:21:08*a_chou joined #nim
00:25:37FromGitter<gogolxdong> How to deal with `/mnt/c/Users/asus/.nimble/pkgs/chronos-2.5.2/chronos/transports/common.nim(516, 4) Error: expression cannot be cast to ptr SeqHeader`
00:26:02*audiofile quit (Quit: Default Quit Message)
00:26:55FromGitter<gogolxdong> cast string to cast[ptr SeqHeader] where SeqHeader is an object with two int fields
00:29:14donpdonpfrom a couple hours ago when redis-0.3.0 couldnt find net.Socket, there is a local ./src/net.nim in my project and it was loading the local net, not the nim's net.
00:29:38donpdonpeven though ./src/config.net does import redis, and has no problem finding the nim's net
00:32:18*donpdonp renames the local net.nim to nnet.nim
00:32:58Yardanicodonpdonp: you don't need to
00:33:05Yardanicoyou can just use the "std" prefix for all stdlib module imports
00:33:08Yardanicoimport std/net
00:33:32Yardanicoimport std/[os, strutils, json] as an example for multi-module import syntax with std
00:33:40donpdonpid have to submit that edit to redis
00:33:44Yardanicowhat edit?
00:33:52Yardanicoah right
00:33:56donpdonp'import net' -> 'import std/net'
00:34:10donpdonpthx though, i'll give thta a try and submit a PR
00:34:16Yardanicowell you can just make a PR and in the meantime use your own fork
00:34:21*donpdonp nods
00:34:22Yardaniconimble supports specifying git urls for packages
00:34:40*donpdonp claps
00:47:10donpdonpand done. https://github.com/nim-lang/redis/pull/20
00:47:11disbotimport std/net to allow for local 'net' module
00:58:52FromDiscord<19> quick question: how can i create a set from a seq
00:59:43FromDiscord<19> in py you just: x = set(myList)
01:02:04*apahl_ quit (Ping timeout: 244 seconds)
01:02:22Yardanicowhat kind of set do you want?
01:02:26Yardanicoa hash set or a bit set?
01:02:42Yardanicofor hashsets - https://nim-lang.org/docs/sets.html
01:02:46FromDiscord<19> just the usual mathematical set
01:02:53Yardanicowell, it depends on the type :)
01:02:58Yardanicobut yeah, hash sets will work
01:03:05FromDiscord<19> set[in16]
01:03:08FromDiscord<19> whats this
01:03:28*apahl joined #nim
01:03:42Yardanicoa built-in nim set
01:03:51Yardanicohttps://nim-lang.org/docs/manual.html#types-set-type
01:03:57FromDiscord<19> ohhh
01:03:59Yardanicothey're bit vectors actually
01:04:02Yardanicoso you might not want to use them
01:04:07*willp_001 joined #nim
01:04:11Yardanicothey're more useful for stuff like chars or enum members
01:04:13*vicfred joined #nim
01:04:25*enthus1ast quit (Ping timeout: 240 seconds)
01:04:52FromDiscord<19> this is HashSet vs OrderedSet
01:04:57Yardanicono
01:05:03Yardaniconim's builtin set type is "set"
01:05:09Yardanico"sets" module provides both hashset and orderedset
01:05:31FromDiscord<19> the built in set type is the bitvector?
01:05:34*willp_001 quit (Client Quit)
01:05:34Yardanicoyes
01:05:48FromDiscord<19> i see
01:06:12FromDiscord<19> what should i use instead? hashset?
01:06:52FromDiscord<19> i will explore all of these, thank you Yardanico
01:13:44*arecacea1 quit (Remote host closed the connection)
01:14:08*arecacea1 joined #nim
01:23:33FromDiscord<Avatarfighter> there is a redis client for nim?
01:23:47disruptek!repo redis
01:23:48disbothttps://github.com/nim-lang/redis -- 9redis: 11Official redis wrapper for Nim. 15 70⭐ 21🍴 7& 10 more...
01:23:52FromDiscord<Avatarfighter> just read a snippet of an above conversation, just wanted to see if anyone has actually seen
01:23:53FromDiscord<Avatarfighter> oh
01:23:55FromDiscord<Avatarfighter> I like
01:24:04FromDiscord<Avatarfighter> thanks disruptek
01:24:12disruptekYOU ARE WELCOME
01:25:07disruptek.msg disbot kill Avatarfigter
01:33:27*apahl quit (Ping timeout: 272 seconds)
01:34:40*apahl joined #nim
01:40:11FromGitter<gogolxdong> Who is Lee Ting Ting, is she here?
01:43:07FromGitter<gogolxdong> She wrote Nim-libp2p Tutorial.
01:57:26*abm quit (Read error: Connection reset by peer)
02:17:07*muffindrake quit (Ping timeout: 260 seconds)
02:19:03*muffindrake joined #nim
03:06:39*vicfred quit (Quit: Leaving)
03:44:14*enthus1ast joined #nim
03:56:24*rockcavera quit (Remote host closed the connection)
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:38*supakeen joined #nim
04:17:14*waleee-cl quit (Quit: Connection closed for inactivity)
04:18:16*vicfred joined #nim
04:19:23*vicfred quit (Max SendQ exceeded)
04:19:51*vicfred joined #nim
04:21:04*vicfred quit (Max SendQ exceeded)
04:21:31*vicfred joined #nim
04:41:23*arecacea1 quit (Remote host closed the connection)
04:41:41*arecacea1 joined #nim
04:49:25*vicfred quit (Quit: Leaving)
04:52:26*solitudesf joined #nim
05:05:55FromDiscord<Clyybber> disruptek why do you have to lift to toplevel?
05:07:26disrupteki dunno, because methods are dumb?
05:07:37disruptek~python is https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
05:07:38disbotpython: 11https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
05:07:52disruptekthis is really, like, one of the best tutorials for nim i've ever seen.
05:08:00disruptekjc is off the fuckin' chain.
05:08:37FromDiscord<Clyybber> why use methods?
05:09:06disruptekit seemed like a good idea at the time.
05:09:47FromDiscord<Clyybber> instead of lifting to top
05:10:00FromDiscord<Clyybber> can we not use methods?
05:10:11disruptekwe aren't using methods.
05:10:16FromDiscord<Clyybber> or are you talking user methods annotated with cps
05:10:21FromDiscord<Clyybber> oh okay
05:10:25disruptekbecause we cannot lift them to top. 😉
05:10:47FromDiscord<Clyybber> wait
05:10:58FromDiscord<Clyybber> user methods?
05:11:02disruptekno.
05:11:20FromDiscord<Clyybber> why would we use methods
05:11:21FromDiscord<Clyybber> what for?
05:13:17disruptekvan morrison can kiss my ass.
05:14:48disruptekbecause as we move continuations around we don't want to replace the result().
05:15:38disruptekwe want result() to yield the last valid result for the continuation type regardless of how it had to accrete new variables.
05:15:56FromDiscord<Clyybber> listen kid my vattery is running out and i need answers
05:16:19FromDiscord<Clyybber> also my mesaages are taking years to arrive and probably outoforder
05:16:28disruptekyeah, i'm crashing, myself.
05:16:59disrupteki'm overloading int() right now. that's my "solution."
05:17:09FromDiscord<Clyybber> lol
05:17:23disruptekor whateverthefuck the return type is.
05:17:50FromDiscord<Clyybber> can we do without methods?
05:17:56disruptekWE ARE.
05:18:04disruptekdamnit i just felt a twinge.
05:18:06FromDiscord<Clyybber> well thats good isnt it
05:18:12disruptekno.
05:18:15disruptekit means
05:18:16FromDiscord<Clyybber> lets not use methods
05:18:17disruptekah fuck
05:18:34disruptekthe balls, the balls they are a'throbbin'
05:18:41disruptekdamnit clyybber.
05:18:44FromDiscord<Clyybber> lmao
05:19:08FromDiscord<Clyybber> quick quick my vattery
05:19:08disruptekah jesus
05:19:41disruptekwhat do you want damnit
05:20:02FromDiscord<Elegant Beef> The fuck are you guys
05:20:29disrupteki think the ahhh
05:21:00disrupteki think the code
05:21:20disrupteki think the code has sufficient comments.
05:21:21disruptekfuck
05:21:41disruptekhttps://github.com/disruptek/cps/blob/typed/cps.nim#L355
05:28:52disruptekthe vattery gottem
05:33:22FromDiscord<Clyybber> hold on; a battery pack just flew by, I might just catch it
05:35:23FromDiscord<Clyybber> got it
05:35:23disruptekeven if resym worked the compiler will choke on it like an underage hooker.
05:35:41disruptekso there's no rush.
05:35:51*narimiran joined #nim
05:37:24disruptekanything with a period is bad news, ya feel?
05:37:51disruptekman i need some snacks.
05:39:45disrupteki can't even remember what you wanted me to do to skiplists.
05:46:22*maier joined #nim
06:03:37*tane_ joined #nim
06:27:43*PMunch joined #nim
06:48:21*gmaggior quit (Quit: Leaving)
06:50:41*Oddmonger quit (Changing host)
06:50:41*Oddmonger joined #nim
07:05:39Araqping narimiran
07:13:41FromDiscord<Clyybber> Araq: Morning, regarding the asynce thing, how do we do it currently?
07:14:33Araqwe don't, effect tracking is pessimistic for async
07:14:39FromDiscord<Clyybber> disruptek: Use multiple sequences instead of building a literal tree
07:14:49Araqit's always .raises: [Exception], tags: [RootEffect]
07:14:57FromDiscord<Clyybber> Araq: Ah, I see. And asynce would discard all effects instead of the ones specified?
07:15:08FromDiscord<Clyybber> (edit) 'instead' => 'except'
07:24:43FromGitter<alehander92> what would happen to the event loop' internal effects
07:25:16*hnOsmium0001 quit (Quit: Connection closed for inactivity)
07:26:10Araqno, the problem is that we don't expose the computed .raises information
07:26:21Araqso instead I ask the programmer to write it down again
07:26:38Araqand then we emit code to check the redundant info is correct
07:26:58Araqand we have the raises information available and can propagate it
07:30:32*tane_ quit (Quit: Leaving)
07:33:46FromDiscord<Clyybber> Why don't we automate it?
07:34:12Araqhow so? that's the question
07:34:38FromDiscord<Clyybber> getImpl?
07:35:08FromDiscord<Clyybber> eh, getType
07:35:27FromDiscord<Clyybber> or getTypeImpl; whatever works
07:35:52FromDiscord<Clyybber> we look at the effects of the proc we are calling and propagate it upwards
07:37:51*a_chou quit (Quit: a_chou)
07:41:20AraqgetTypeImpl currently doesn't expose it
07:44:29FromDiscord<Clyybber> oh, do we not attach the Effects to the type?
07:49:44FromDiscord<Clyybber> oh not in sempass1 I see
07:54:53Zevvs
07:55:48FromDiscord<Clyybber> Zevv: agreed
07:56:23PMunchWell this is fun, between v1.0 and v1.2 strutils.wordWrap changed named to std.wordWrap.wrapWords..
07:57:04PMunchSo if you want to support v1.0 and future versions you need a little when case around an import and a small template..
07:58:03PMunchHmm, what is this flag for? https://nim-lang.org/docs/system.html#nimCoroutines
08:00:01PMunchhttps://play.nim-lang.org/#ix=2w0P
08:00:27AraqPMunch, doesn't v1 have std.wordwrap.wrapWords already?
08:01:37PMunchAh, indeed it does
08:01:50PMunchIt's only <0.20 that doesn't have it
08:01:53*Vladar joined #nim
08:05:05FromDiscord<iWonderAboutTuatara> I'm still having some major issues with macros
08:05:14FromDiscord<iWonderAboutTuatara> I think the main issue is that the errors are very unhelpful
08:05:16*pietroppeter joined #nim
08:05:34FromDiscord<iWonderAboutTuatara> If the errors helped out a little bit more this might be easier
08:05:53FromDiscord<iWonderAboutTuatara> But I'm kind of taking shots in the dark and hoping I solve the problem nowadays
08:06:23Araqby the time we improved the error messages you've learned how to write macros, so only other newcomers will benefit from your complaints ;-)
08:06:32Zevvdude
08:06:41AraqI'm not really serious
08:06:46ZevvI know :;
08:06:55Araqso give us a gist to work with
08:07:06ZevviWonderAboutTuatara: share your code and your error messages
08:07:24FromDiscord<iWonderAboutTuatara> Lmaoo
08:07:34FromDiscord<iWonderAboutTuatara> Nah my computer is off
08:07:47FromDiscord<iWonderAboutTuatara> But half the time it gives me the error as the name of the macro
08:08:00FromDiscord<iWonderAboutTuatara> Which is pretty hilarious but also very unhelpful
08:08:27FromDiscord<iWonderAboutTuatara> I also don't really understand how to pass a block of code to a macro
08:08:44FromDiscord<iWonderAboutTuatara> I don't think I've been doing it right though
08:09:38FromDiscord<iWonderAboutTuatara> Similarly, calling vars in `quote do` without the `\`` is not a very clear error message
08:09:44FromDiscord<iWonderAboutTuatara> (edit) '`\``' => '```'
08:09:55FromDiscord<iWonderAboutTuatara> (edit) '```' => '`\`'
08:10:03FromDiscord<iWonderAboutTuatara> (edit) '`\`' => '`''`'
08:10:22FromDiscord<iWonderAboutTuatara> Trying to think of others
08:10:39FromDiscord<iWonderAboutTuatara> Not an error message issue, but this is probably the most confusing concept I've learned in a while
08:12:31FromGitter<alehander92> well passing a block
08:13:17FromDiscord<iWonderAboutTuatara> I know thats the goal yeah
08:13:47FromDiscord<iWonderAboutTuatara> Don't know how to get from "I want to pass in a block" to "I've passed in a block" yet
08:14:02FromGitter<alehander92> is just having `macroName: <newline> block`
08:14:23FromGitter<alehander92> and block is just an argument
08:15:13PMunchHmm, maybe I should write more about writing macros..
08:15:15FromDiscord<iWonderAboutTuatara> You can do that?
08:15:19FromDiscord<iWonderAboutTuatara> Please
08:15:25FromDiscord<iWonderAboutTuatara> There are no good beginner tutorials
08:15:30FromGitter<alehander92> we really need
08:15:33FromDiscord<Elegant Beef> Pmunch i agree we should 😛
08:15:36FromDiscord<iWonderAboutTuatara> They all assume you already know a fair bit about writing macros
08:15:37FromGitter<alehander92> well commented examples
08:15:39FromGitter<alehander92> i think
08:15:40FromDiscord<iWonderAboutTuatara> Which is kind of pointless
08:15:42FromDiscord<iWonderAboutTuatara> Not even that
08:15:44FromGitter<alehander92> that's what helps me most usually
08:15:51FromDiscord<iWonderAboutTuatara> There are literally no good beginner tutorials
08:15:52PMunch@iWonder this might be helpful: https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html
08:16:05narimiranin the mean time: https://nim-lang.github.io/Nim/tut3.html
08:16:09FromDiscord<iWonderAboutTuatara> I'll save that link
08:16:11PMunchEven though it's not that friendly as a complete beginner tutorial I think
08:16:16FromDiscord<iWonderAboutTuatara> I read the tut 3 like 10 times
08:16:26FromDiscord<iWonderAboutTuatara> Am almost as lost as the first time
08:16:33narimiranPMunch: maybe you can improve tut3? :/
08:16:42FromGitter<alehander92> awesome exactly like this blog
08:18:06PMunchHmm, just scrolling through tut3 it looks pretty good. But I guess it might be a bit too technical and not have enough examples
08:18:35PMunchThe article I wrote on it was more to show my process in designing a macro and how I go about implementing it
08:19:11FromDiscord<iWonderAboutTuatara> Templates are actually not too bad
08:19:28FromDiscord<Clyybber> @iWonderAboutTuatara are you using vscode?
08:19:29FromDiscord<iWonderAboutTuatara> They're pretty possible to get your head around with a little bit of time and dedication
08:19:32FromDiscord<iWonderAboutTuatara> Yeah
08:19:46FromDiscord<iWonderAboutTuatara> Even running it gives the weird error which is just the name of the macro and nothing else though
08:19:59PMunchHmm, that does sound weird
08:19:59FromDiscord<Elegant Beef> Macros really arent too bad really, once you grasp they're just developing AST using nim code 😄
08:20:28FromDiscord<Elegant Beef> I always compare the AST from the macro to written code
08:20:36FromDiscord<Elegant Beef> When it breaks
08:20:39FromDiscord<iWonderAboutTuatara> I used a symbol thing, eg `macro `!$+&`()`
08:20:42PMunch@Elegant, true, but they are a bit confusing sometimes
08:20:49FromDiscord<iWonderAboutTuatara> (edit) '`macro `!$+&`()`' => '/`macro /`!$+&`()`'
08:21:16PMunchAnd yeah, `echo result.repr` or `echo result.treeRepr` goes a long way to debug stuff
08:21:26FromDiscord<iWonderAboutTuatara> Should try that
08:21:32FromDiscord<iWonderAboutTuatara> I never set result to anything though
08:21:46PMunchWait, what are you doing then?
08:21:52FromDiscord<iWonderAboutTuatara> I think it's supposed to be easier to use quote do
08:22:01FromDiscord<iWonderAboutTuatara> Or so I've been told by tutorial 3
08:22:13PMunchYeah, typically you would do `result = quote do: <whatever>`
08:22:20PMunchOr something similar
08:22:24FromDiscord<iWonderAboutTuatara> Wait, you can do that?
08:22:29AraqI never use 'quote do' :-)
08:22:36PMunchDo what?
08:22:41FromDiscord<iWonderAboutTuatara> Lol
08:22:46Araqtoo old for this new stuff, I use helper templates and getAst
08:22:49PMunchAraq, I use `superQuote do` :D
08:23:25FromDiscord<iWonderAboutTuatara> 50/50 on that being a joke
08:23:35PMunchThat's pretty much what quote does though, just without the extra work
08:23:35FromDiscord<iWonderAboutTuatara> It's either fake or part of your macros package I think
08:23:52PMunch@iWonder, not a joke, it's part of my macroutils package :P
08:23:52FromDiscord<iWonderAboutTuatara> What's superquote do?
08:24:01FromDiscord<iWonderAboutTuatara> 1/2 chance lol
08:24:09Araqit's a fixed quote
08:24:21Araqquote without the many quirks
08:24:28FromDiscord<iWonderAboutTuatara> Sure
08:24:45PMunchWell, with a different set of quirks :P
08:24:47PMunchhttps://nimble.directory/pkg/macroutils
08:24:59FromDiscord<iWonderAboutTuatara> I don't have any idea what that means lol, but I don't think it matters too much at my level
08:25:47PMunchIt basically allows you do to things like "result = superQuote do: echo `$input[0].name`" where `input` is a sequence of things with a name property that can be stringified
08:26:11*krux02 joined #nim
08:26:23FromDiscord<iWonderAboutTuatara> Interesting
08:26:46FromDiscord<iWonderAboutTuatara> 95% of this is miles over my head lol
08:27:08PMunchhttps://play.nim-lang.org/#ix=2w0W
08:28:03FromDiscord<iWonderAboutTuatara> Wait it let's you $ things in a quote do?
08:28:05FromDiscord<iWonderAboutTuatara> That's useful
08:28:51PMunchYeah, it basically pulls the content of `` pieces out into something like `let x = <content>` and spits out a do with the content replaced with `x`
08:29:35FromDiscord<iWonderAboutTuatara> I think I kind of understand that
08:30:00PMunchHaha, don't worry about it, you'll hit the limitations of quote at some point, then you can have a look at superQuote
08:32:10FromDiscord<iWonderAboutTuatara> I think I need to understand what it's doing before I worry about limitations :p
08:32:18FromDiscord<iWonderAboutTuatara> I'll get there eventually
08:32:29FromDiscord<iWonderAboutTuatara> Sooner feather than later, hopefully
08:32:55FromDiscord<iWonderAboutTuatara> Dom96's book is actually really good, it's a shame I can't afford at the moment
08:33:04FromDiscord<iWonderAboutTuatara> I've been using the free online version
08:33:52PMunchYeah, it's a pretty good book :)
08:34:42FromDiscord<iWonderAboutTuatara> It's very simple and eelll thought through
08:35:07FromDiscord<iWonderAboutTuatara> It's the 2nd best source I've found for macros, first being this discord/irc/gitter
08:35:19PMunchAnyone wants to get GeSHi syntax highlighting for Nim up and running so Rosetta Code can highlight stuff for us? https://rosettacode.org/wiki/Rosetta_Code:Village_Pump/Syntax_highlighting#Relationship_Between_Rosetta_Code_and_GeSHi
08:36:43FromGitter<alehander92> just look at macros
08:36:45FromGitter<alehander92> as functions imho
08:36:56FromGitter<alehander92> which take nodes and return a node
08:37:16FromGitter<alehander92> not as in something very advanced
08:37:48FromDiscord<Elegant Beef> I mean i showed them how easy it is to make a go walrus operator using macros, so they know it can be rather simple 😄
08:38:23FromGitter<alehander92> quote is just similar as well: it takes some stuff and returns a node corresponding to it
08:38:43FromGitter<alehander92> don't look at it as something complicated
08:39:34FromDiscord<Elegant Beef> Yea in nim it's very much just code replacement using code
08:41:02FromDiscord<Elegant Beef> I also didnt expect to be able to use macros as operators, that was wild
08:44:38krux02Elegant Beef: One of the unique features in Nim is, that macros also have type information of their arguments. In many other programming languages, macros are limited to work on the text (C, afaik D), or the raw ast without type information (lisp, afaik rust)
08:49:31*awe00__ joined #nim
08:58:57FromDiscord<iWonderAboutTuatara> @Elegant Beef yeah that was some shoes clean code
08:59:05FromDiscord<iWonderAboutTuatara> I think the issue comes when scaling up
08:59:34FromDiscord<iWonderAboutTuatara> It's easy to juggle a small AST in my head, much harder to keep it straight and fix the errors when the possibility space is so much larger :)
08:59:52FromDiscord<iWonderAboutTuatara> (edit) 'shoes' => 'very'
08:59:57FromDiscord<Elegant Beef> What are you currently trying to do?
09:00:05FromDiscord<iWonderAboutTuatara> I've honestly forgotten
09:00:11FromDiscord<iWonderAboutTuatara> I'm not at my computer right now
09:00:26Araqit scales just like ordinary programming does, use helper procs working on NimNode
09:00:58FromDiscord<Elegant Beef> Yea, you can use a bunch of the constructor Nodes + nim nodes to generate macros relatively easy
09:02:02FromDiscord<Elegant Beef> For instance this macro
09:02:03FromDiscord<Elegant Beef> https://forum.nim-lang.org/t/6759#41996
09:02:26FromDiscord<Elegant Beef> *Not a very smart implementation, but it "works"*
09:04:33FromDiscord<Elegant Beef> Do have to say I've seen "Macros cant change the syntax, which sucks", but after playing around with these macros for specific behaviour it's relatively easy to generate "new syntax"
09:09:36ZevvI disagree
09:10:11FromDiscord<Elegant Beef> With which part?
09:10:11ZevvI'm not saying that it sucks, it's just the way it is
09:10:30Zevvbut the available syntax choices are limited, it's still the Nim parser that has to agree
09:14:09Araqafter all these years I still think the current design works best
09:14:49Araqif you depart too much from the existing Nim syntax, you need to use triple quotes and parse it at compile-time and the syntax highlighters are not confused then
09:15:48Araqit's a sweet spot in language design.
09:16:01ZevvI agree
09:17:10FromGitter<alehander92> i .. almost agree
09:17:29Araqdifferent topic: I'm pausing on https://github.com/nim-lang/Nim/pull/15251
09:17:30disbotnew-style concepts implemetion, WIP
09:17:33FromGitter<alehander92> but php and html already have tags which are very popular and which ide-s learn to recognize
09:17:41FromGitter<alehander92> and apply different highlighting there
09:17:45FromGitter<alehander92> so it's technically possible
09:18:00FromGitter<alehander92> still it's cool that the syntax looks consistent so this point is probably important
09:18:33Araqphp doesn't have a macro system so I fail to see the connection
09:18:45FromGitter<alehander92> it's about tooling
09:19:02FromGitter<alehander92> editors can show different syntaxes based on some pattern in the code already
09:19:26Araqyeah so better have these detectable patterns in your code then
09:19:37FromGitter<alehander92> so one can imagine that a convention like `dsl[lang]: token macro` in nim on theory
09:19:45FromGitter<alehander92> which would be highlightable correctly
09:20:07FromGitter<alehander92> not different than ```<lang>``` in github markdown
09:20:18FromGitter<alehander92> or script tags in html
09:20:20Araqsilly non-sense, the '[lang]' part is poorly specified for custom macros
09:20:50FromGitter<alehander92> eh i am talking for when e.g. C / asm code is emitted
09:21:19Araqwhat is the '[nim-sugar-dup]' lang and how many of these illdefined micro-languages do you want to add to your editor?
09:21:22FromGitter<alehander92> if it's just custom dsl, then yeah, no benefit except if the person writes a custom config file for it
09:21:50FromGitter<alehander92> wait i am talking about stuff like hypothetical c/asm emitting or reader macros
09:23:42Araqyeah I have no idea what you're talking about
09:25:00FromGitter<alehander92> offtopic anyway :D
09:32:53*krux02 quit (Read error: Connection reset by peer)
09:33:59*krux02 joined #nim
09:35:04FromDiscord<Varriount> Oh, hey Araq
09:35:12FromDiscord<Varriount> How are things going?
09:36:02Araqwell, 1.4 is just around the corner
09:36:37FromDiscord<Varriount> Gasp!
09:36:51*abm joined #nim
09:37:31Araqand I might write an RFC about typeParam[T]
09:37:47Araqwhich is typedesc[T] without its bugs :D
09:38:13Araqand then bugfixes don't break anybody's code
09:38:30FromDiscord<Varriount> The problem with those RFCs is that I feel incapable of making any substantial comments
09:39:16FromDiscord<Varriount> It always feels like Mratsim and Zahary have the best insights
09:39:31FromDiscord<Varriount> Though, I can certainly ask questions.
09:42:14FromDiscord<lqdev> hold up
09:42:24FromDiscord<lqdev> wasn't 1.4 supposed to have IC?
09:42:57FromDiscord<lqdev> or is that postponed until 1.6
09:43:12Araq1.4 adds --gc:orc
09:43:40Araqwe planned to have it --gc:orc as the default but we decided we won't make it the default until 1.6
09:43:45*tane_ joined #nim
09:44:00FromDiscord<dom96> hah, that would be pretty aggressive
09:44:03FromDiscord<lqdev> so incremental is postponed indefinitely?
09:44:50Araqlqdev: IC is hoped to arrive by end of October
09:45:01FromDiscord<lqdev> righty-o
09:45:38FromDiscord<dom96> for the 1.4 release notes you should ask people to test --gc:orc
09:45:47FromDiscord<dom96> and mention that the plan is to make it default in 1.6
09:46:00AraqYardanico and narimiran did plenty of testing
09:46:09Araqbased on our "important packages"
09:46:18Araqbut yeah
09:46:20AraqI agree
09:46:36FromDiscord<dom96> Yes, that doesn't affect what I said
09:55:33FromDiscord<Rika> i found jester+httpbeast murdered my ram using orc but not with default, not sure if its just my code or an issue with httpbeast
09:55:40FromDiscord<Rika> let me test again with a newer devel
09:56:27Araqit's a reported bug, not sure if it's jester or httpbeast
09:56:48Araqsome smaller program that reproduces the problem would help, as usual
09:56:56FromDiscord<dom96> you can check easily: -d:useStdlib IIRC
09:57:36*arecacea1 quit (Remote host closed the connection)
09:57:59*arecacea1 joined #nim
10:04:21FromDiscord<Rika> it seems to not happen anymore, odd
10:05:26Araqprobably because of my cursor inference fixes. Fun fact: "strict" funcs and cursor inference use the same algorithm and "borrow checking for openarray" will use it too
10:05:54Araqbuy one, get two for free.
10:06:37FromDiscord<dom96> Nim's new business model is the same as most supermarkets now
10:07:43Araqlol, well also have the "get bought by Yahoo!" business model
10:10:47*agent0x00 joined #nim
10:14:33FromGitter<alehander92> IC <3
10:14:39FromGitter<alehander92> dom96 haha
10:32:22Araqhttps://github.com/nim-lang/RFCs/issues/248 feedback appreciated
10:32:25disbotUnquoted indentation-based string literals ; snippet at 12https://play.nim-lang.org/#ix=2w1m
10:32:43Araqnote that this isn't my RFC
10:36:18FromDiscord<dom96> My main question is why do we need this?
10:36:28FromDiscord<dom96> Why are triple quoted string literals not enough?
10:38:09Araqmy main question is why my VSCode cannot highlight Nim code properly
10:38:22FromDiscord<Rika> probably wants `strutils.unindent` to be automated
10:38:27Araqit doesn't understand Nim's string literals
10:38:52FromDiscord<dom96> because the VS Code extension hasn't been written by the core team
10:39:03FromDiscord<dom96> It may be about time to create an official extension
10:42:28*nc-x joined #nim
10:42:44nc-xD also has separate literals for the syntax highlighting reason
10:42:45federico3any new idea for https://github.com/nim-lang/Nim/pull/6481 ?
10:42:45disbotAdd support for the blockdiag suite in docgen
10:43:06nc-xotherwise there is no way for the compiler to detect that a string contains code
10:45:12FromDiscord<dom96> there is in nim: `cpp"""int x = 0;"""`
10:52:20Araqfederico3, I used 'markdeep', how does it compare to 'blockdiag'?
10:53:21nc-xisn't markdeep simply a kind of markdown alternative?
10:53:48Araqno.
10:54:01nc-xoh. it also supports diagrams/
10:55:54federico3markdeep is similar to asciidoc: an entire markup language instead of just the diagram generation. Also it requires you to actually draw the diagram in ascii instead of simply writing e.g. "client -> dispatcher -> worker1, workerDots, workerN;"
10:58:53Araq"simply writing", well how simple does it remain when I decribe a graph?
11:01:19Araqlol I can run gedit via WSL
11:01:29Araqfeels like magic
11:09:29*lritter joined #nim
11:09:33Araqbootstrapping works, valgrind works, everything works, should have done that earlier
11:12:25*zama quit (Ping timeout: 240 seconds)
11:12:34federico3Araq: "A -> B -> C \n B -> D \n B-> A" and so on. The point of graphviz & co is to generate simple diagrams automatically
11:13:16*zama joined #nim
11:19:02*awe00 joined #nim
11:21:58*awe00__ quit (Ping timeout: 260 seconds)
11:22:29*nc-x quit (Remote host closed the connection)
11:31:23FromDiscord<Varriount> Hm. Anyone have input on the herestring RFC? I can't seem to think of a reason _not_ to add it other than "we already have 3 other string literal types"
11:32:43FromDiscord<Rika> i think its redundant
11:33:13FromDiscord<Varriount> (though to be fair, if I had to choose between triple quoted strings and herestrings, I would pick the latter)
11:35:12FromDiscord<Rika> it sounds more complicated for a regex syntax highlighter to parse, i think
11:35:45*agent0x00 quit (Ping timeout: 240 seconds)
11:35:59FromDiscord<Varriount> I never liked the magical "eat leading whitespace" behavior that triple quoted strings have. Even though it's helpful, I find it unintuitive, since the other string literals don't have that kind of behavior.
11:41:24Araq "we already have 3 other string literal types" is pretty compelling
11:41:34*MyMind quit (Read error: Connection reset by peer)
11:42:04*awe00 quit (Ping timeout: 256 seconds)
11:43:47*awe00 joined #nim
11:43:52FromDiscord<Varriount> Araq: I'm sure we can boost that to a good half-dozen
11:44:35FromDiscord<Rika> lol
11:49:06planetis[m]clyybber: I tried an example and needs addr everywhere: https://gist.github.com/planetis-m/e39abac03c90cb37066ffb96b7b552b1
11:59:15FromDiscord<Hearthstone> Is there any alternatives to dynlib?
11:59:33FromDiscord<Hearthstone> The nim module-
11:59:43FromDiscord<Hearthstone> I'm asking because I'm curious
12:04:44*rockcavera joined #nim
12:05:54FromDiscord<haxscramper> I'm writing longer response on github, but just to make sure: `strutils.unindent` "removes **all** indentation composed of whitespace from each line in s". Which means the tring you get is not unindented but rather 'stripped on leading whitespaces', which is not the same thing. Or I'm missing something?
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:37*supakeen joined #nim
12:09:34FromDiscord<Rika> @haxscramper https://play.nim-lang.org/#ix=2w1I but in short it only removes however many whitespaces you put in the arg
12:10:11FromDiscord<Rika> unless you use the other unindent, which sounds like its doing something wrong imo
12:11:38FromDiscord<haxscramper> When I say unindent I mean "strip equal number of prefix whitespaces from each line". With stdlib unindent you don't get the same string you wrote in the code.
12:12:12FromDiscord<Rika> `Unindents each line in s by count amount of padding. Sometimes called dedent`
12:12:14FromDiscord<Rika> as ive said
12:12:19FromDiscord<Rika> the other unindent is prolly wrong
12:12:24FromDiscord<Rika> but the one i demoed is correct
12:34:30narimiranhohoho, i just got `Error: 'BiggestUint' should be: 'BiggestUInt'`. goddammit, why nim can't be case-insensitve?!? :P
12:37:08FromDiscord<dom96> wat
12:38:01FromDiscord<Rika> wat
12:38:13narimiranit's time to reverse-complain about case (in)sensitivity! :D
12:38:34federico3??
12:38:40narimiranfor the uninitiated: you cannot be sloppy anymore when it comes to stdlib code
12:39:34narimiran(it has been like that for quite some time, but today it was the first time i made a typo and hit that error)
12:39:51FromDiscord<dom96> wow, can we get the same for all code? 😛
12:40:22federico3hint: nimfmt
12:40:41narimiran@dom96: `--styleCheck:error`
12:41:32narimirancheckmate, HN comments!
12:41:51FromDiscord<dom96> nice nice, now can we make it default for all code 😛
12:42:29narimiranso we get hate from both sides? :D
12:43:02FromDiscord<dom96> In all seriousness, it would be interesting to do some research
12:43:38narimiranthere is `--styleCheck:hint` as a first step
12:43:40FromDiscord<dom96> to determine how much code actually makes use of style insensitivity
12:43:40*CcxWrk quit (Ping timeout: 246 seconds)
12:44:15FromDiscord<dom96> if it's less than 1% then that may be a good excuse to get rid of this once and for all
12:44:28FromDiscord<dom96> then we just need to figure out qualified imports by default and HN will love us 😛
12:45:47narimiranFTW!! :D
12:47:08FromDiscord<exelotl> Style insensitivity is nice because is keeps out intolerant dinguses :p
12:47:34FromDiscord<exelotl> (edit) 'is' => 'it'
12:48:19FromDiscord<Rika> just redirect the intolerant to zig
12:48:37federico3dom96: that's what nimfmt is for
12:48:42*CcxWrk joined #nim
12:51:11FromDiscord<haxscramper> > to determine how much code actually makes use of style insensitivity↵@dom96 I checked arraymancer with this script - https://gist.github.com/haxscramper/2dd304e8b103b956892702fb1fef9b0d - out of `50083` identifiers detected only `7900` used snake case. It is an open question how things like `alllowercasenounderscores` should be categorized, though. But without some kind of NLP for string splitting it is really hard to tell.
12:52:35FromDiscord<dom96> haxscramper: that's worrying and not what we should be counting IMO.
12:52:48FromDiscord<dom96> You need to determine the style for a library
12:53:05FromDiscord<dom96> then check how many times it uses that style when it calls into a proc that has a different style
12:53:12FromDiscord<dom96> since that is the purpose of this feature
12:53:54federico3haxscramper: https://github.com/FedericoCeratto/nimfmt#nim-code-formatter--style-checker
12:54:58*pietroppeter quit (Quit: Connection closed for inactivity)
12:57:46FromDiscord<exelotl> I found case insensitivity in the wild on the forums just a couple of days ago. `nimlua` exposes all functions in lowercase but the author of the post was (perfectly correctly imo) writing `doFile` instead of `dofile`
12:59:10FromDiscord<exelotl> Guess that's just anecdotal but it seems that people like this feature and are using it as intended
13:01:58FromDiscord<dom96> I think doing this research and writing up something on the results would actually do well to explain why Nim has this feature
13:02:12FromDiscord<dom96> and hopefully make people feel less uneasy about it
13:03:43FromDiscord<haxscramper> This script just scans everything in `/tmp/nimrepos` I can just clone some meaningful number of packages and check it.
13:03:44*agent0x00 joined #nim
13:04:06FromDiscord<haxscramper> Or `cat | jq | xargs git clone` nimble package list
13:06:40*Trustable joined #nim
13:17:23*solitudesf quit (Remote host closed the connection)
13:18:24*solitudesf joined #nim
13:19:08FromGitter<alehander92> Araq I like the heredoc thing
13:25:45*CcxWrk quit (Ping timeout: 240 seconds)
13:31:53*CcxWrk joined #nim
13:40:23*rockcavera quit (Remote host closed the connection)
13:46:24disruptekclyybber: you remember why we're using linked lists instead of sequences, right?
13:47:12*vivus joined #nim
13:54:05*awe00_ joined #nim
13:56:52*awe00 quit (Ping timeout: 265 seconds)
14:07:49*waleee-cl joined #nim
14:08:24*audiofile joined #nim
14:09:23*PMunch quit (Quit: Leaving)
14:14:32FromDiscord<Varriount> @haxscramper I <3 jq
14:14:52*agent0x00 quit (Quit: WeeChat 1.9.1)
14:15:53FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2w24
14:16:19FromDiscord<haxscramper> When I watched output of the script I saw a lot of filenames that were certainly auto-generated
14:16:33FromDiscord<haxscramper> But there is ~8.5 million lines of nim code total
14:16:37FromDiscord<Rika> nice
14:16:41FromDiscord<dom96> again, you need to do a more sophisticated analysis like I described above
14:17:08FromDiscord<dom96> although it depends on your goals
14:17:21FromDiscord<dom96> a snake vs camel case is interesting itself
14:17:38FromDiscord<haxscramper> My goal is to waste 40 minutes on this while I should be doing important things
14:17:44FromDiscord<haxscramper> I succeded
14:18:29FromDiscord<haxscramper> And I highly suspect a lot of snake case comes from auto-generated C wrappers
14:19:06*pietroppeter joined #nim
14:19:28*vivus quit (Quit: Leaving)
14:46:55*awe00_ quit (Read error: Connection reset by peer)
14:47:58*awe00_ joined #nim
14:49:52FromGitter<alehander92> wait what's this analysis for
14:52:19FromDiscord<Rika> for more concrete evidence that style insensitivity is usefu
14:52:21FromDiscord<Rika> (edit) 'usefu' => 'useful'
14:59:57*vicfred joined #nim
15:00:35*hnOsmium0001 joined #nim
15:01:06disruptekthere's only 8.5 million lines of nim?
15:02:11FromDiscord<haxscramper> According to some commenters it is more like evidence that style-insensetivity won't destroy the world and it is quite possible to write millions of lines in it without fear of brain damage.
15:04:46FromDiscord<Rika> some fucker can just declare all of us who write nim as brain damaged tho
15:07:41FromDiscord<lqdev> talkin' 'bout HN?
15:08:11Zevvwe should make it typo insensitive as well, so you can just type "usefu" ant it will work
15:08:42FromDiscord<lqdev> make it use gcc's typo detection
15:10:27*arecacea1 quit (Remote host closed the connection)
15:11:16*arecacea1 joined #nim
15:26:37*narimiran quit (Ping timeout: 264 seconds)
15:28:02disruptekseems like mangling works everywhere but jsonutils and earlier versions of nim.
15:33:05*maier quit (Ping timeout: 240 seconds)
15:44:29disrupteki mean, how important is it that nim-1.0 can build the compiler? honestly...
15:53:52*rockcavera joined #nim
16:03:32*a_chou joined #nim
16:06:34*arecacea1 quit (Remote host closed the connection)
16:07:07*arecacea1 joined #nim
16:10:46disrupteki guess mine is the first use of concepts in the compiler, and sure enough, they don't work.
16:11:26FromDiscord<mratsim> I doubt it would break as much as "not nil" when it was revamped a year ago
16:11:55FromDiscord<mratsim> for 4 days if you found a commit that could compile/bootstrap you had to make sure you saved it
16:12:05disrupteklol
16:12:22disruptekthat's pretty awesome.
16:12:29FromDiscord<haxscramper> How do I defile graph type in gram? If I understand correctly `F` parameter must be a static value for a set of graph flags, like `{Directed}` for example. But when I try to use `Graph[string, bool, {Directed, ValueIndex}]` I get `cannot instantiate Graph got: <type string, type bool, static[set[GraphFlag]]({Directed, ValueIndex})>`
16:12:36FromDiscord<mratsim> defile a graph?
16:12:42FromDiscord<haxscramper> define*
16:12:43FromDiscord<mratsim> wrong community 😉
16:12:52disruptekno, he's in the right place.
16:13:01disruptekthere's a newGraph template that sets it up for you.
16:13:22disruptekit casts the set to an int, basically.
16:13:32disruptekyou can copy that if you want to hack at it.
16:13:48FromDiscord<mratsim> I'm not sure static sets work
16:13:49disruptekif you can come up with a better way to do that, i'll happily switch.
16:14:07FromDiscord<haxscramper> I need to have this as a field in another object, not just create graph value
16:14:11FromDiscord<mratsim> static enum and integers are fine, but static objects are all kind of broken so static set might also be
16:14:24disruptekthey've been working for me.
16:14:56disruptekhaxscramper: there are supporting procs that let you play with the flags. toInt, toFlags, flags, etc.
16:15:06disruptekthey are all exported on the same line in the source.
16:24:16FromDiscord<Kiloneie> is "ref" only used for defining ref objects ? Is there a way to make traced/safe references to variables(not ptr) ?
16:24:43disruptekno, it's not; so, yes, there is.
16:25:22FromDiscord<Kiloneie> Explain ?
16:25:32FromDiscord<lqdev> `ref` can be applied to any type
16:25:34FromDiscord<lqdev> eg. `ref int`
16:25:44disruptek~manual
16:25:45disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
16:26:27*NimBot joined #nim
16:28:17FromDiscord<Kiloneie> Man i form bad questions... il be back later xD
16:29:08disruptekyou form questions that are typical for those that are unfamiliar with the language and need more experience working with it.
16:29:23disruptekmaybe try some small projects to get some practice.
16:29:40disruptekor, y'know, just jump right into teaching others. that could work, too.
16:29:54disruptekit's 2020, after all.
16:29:57*abm quit (Quit: Leaving)
16:32:06FromDiscord<Kiloneie> thing is i know ref is used for defining types on the heap, was actually asking how to get a traced pointer of a variable, but idk what my brains spit out xD...
16:32:29*arecacea1 quit (Remote host closed the connection)
16:32:36FromDiscord<Kiloneie> you only get a safe pointer if the type you used for declaring is a ref/heap type...
16:32:43FromDiscord<Rika> you can make any type a ref type
16:32:46FromDiscord<Rika> primitive or not
16:32:51FromDiscord<Kiloneie> i know
16:33:02*arecacea1 joined #nim
16:35:17disrupteki think what you're asking is if you can get a ref to a value type that's on the heap.
16:35:27disruptekthis doesn't really make sense.
16:36:06FromDiscord<Kiloneie> no, i think i need to go eat something, lack of energy D:...
16:36:27disrupteka ref is a contract between you and the language. it's an agreement that you each will share some responsibility for memory management.
16:37:27FromDiscord<Kiloneie> Yeah, since stack values are automatically freed by scope.
16:38:10disruptekvalues can exist on the heap and of course they can have addresses, but if they aren't refs, they don't share the same semantic contract.
16:42:54FromDiscord<Kiloneie> I think what i wanted to ask was if i make a variable "a" and several other variables that take "a.addr" a's memory address, which you have to free, if there was a way to make GC do it for you. I wrote it horribly.
16:46:09FromDiscord<haxscramper> Like `var a: ref T = <something>` and `let b = addr a`, `let c = addr a`?
16:46:42Yardanicothen you'll have a pointer to a GC'd reference, no?
16:46:47disruptekeither `a` is on the stack, in which case you don't have to free it or any other variables that hold pointers to it as produced by `a.addr`, or `a` is a ref, in which case the GC will free it for you regardless of how many pointers you record to it.
16:47:51FromDiscord<Kiloneie> Oh... okay, i didn't catch that from the manual
16:49:44disruptekpointers don't change when the memory they point to changes, just like if you remove the contents of an envelope, the mailing address doesn't spontaneously change.
16:49:56disruptekyou get that, right?
16:50:20FromDiscord<Kiloneie> Yes
16:50:28disruptekokay. 👍
16:51:22FromDiscord<Kiloneie> Sometimes i jump to stupid conclusions, D:. Goes over my head.
16:52:05disruptekindirection can be confusing at every level.
16:56:37FromDiscord<Kiloneie> Yeah. At least i can ask just about anything here(unlike how i started with Game Maker when i was 13, asked a question and either it took days for a reply which may or man not have been helpful at all)
16:59:24*superbia1 joined #nim
16:59:58Yardanicowell it always depends on size of the community and where you're asking
17:00:34FromDiscord<dom96> depends on how passionate the community is too 🙂
17:00:46FromDiscord<Kiloneie> That community was 99% as experienced as i was
17:01:07FromDiscord<Kiloneie> I wished for someone to help me.
17:01:39FromDiscord<Kiloneie> That with my english not being at the level required was a pain.
17:02:01*superbia quit (Ping timeout: 264 seconds)
17:06:41*solitudesf quit (Remote host closed the connection)
17:29:39*maier joined #nim
17:32:41FromDiscord<Avatarfighter> What's good party people
17:34:52*maier quit (Ping timeout: 246 seconds)
17:37:48leorize[m]disruptek, @lqdev, Zevv, narimiran: so I'm gonna resume work on nim.nvim, any requests?
17:38:40disrupteki'm mostly in the compiler and you know how it is.
17:40:01leorize[m]@Clyybber is interested in fixing that nimsuggest bug, so maybe nudge him a bit? :p
17:40:24Zevvno no no
17:40:47Zevvwe need him for the Clybber Patch Service
17:42:51disruptekClyybber Patch Service mostly works in the compiler, too. 😉
17:43:09leorize[m]I'll work on a feature to automatically capture nimsuggest crashes
17:43:22leorize[m]and if he still haven't fix that bug by then I'll look into it
17:43:41ZevvWe should start paying him
17:46:34FromDiscord<Avatarfighter> wow that convo died
17:46:40disruptekcapturing crashes is probably more important.
17:48:15FromDiscord<Clyybber> ayy
17:48:34FromDiscord<Clyybber> unindent should probably be fixed, I don't think its that useful in its current state
17:48:53FromDiscord<lqdev> leorize: error checking please
17:49:00disruptekunindent?
17:49:08FromDiscord<lqdev> you mean <ing?
17:49:10FromDiscord<Clyybber> https://play.nim-lang.org/#ix=2w1I
17:49:36FromDiscord<Clyybber> IMO it should only strip the whitespace that all lines share
17:49:37*donpdonp left #nim ("WeeChat 2.6")
17:49:53disrupteki think i've used a deindent in the past or something.
17:49:55leorize[m]strutils.unindent
17:50:19disruptekhard to tell if it doesn't anything on the playground.
17:50:51leorize[m]it's the equivalent of running trim() on every line of your string by default
17:51:08disrupteki could go for some trim right about now.
17:51:20FromDiscord<Clyybber> Hmm, maybe we should introduce another proc instead, otherwise its a bit of a breaking change I suppose
17:52:40FromDiscord<haxscramper> I can PR this into stdlib - https://play.nim-lang.org/#ix=2w2V
17:52:52FromDiscord<Clyybber> Oh
17:53:00FromDiscord<Clyybber> Yeah, I was about to replace unindent by that
17:53:01FromDiscord<haxscramper> Not sure about exception though
17:53:07leorize[m]@lqdev noted
17:53:26FromDiscord<haxscramper> Is it better to silently cut off incorrect lines or blow up?
17:53:27FromDiscord<Clyybber> @haxscramper I'm gonna go with a easier approach
17:53:42FromDiscord<Clyybber> I first find the lowest common shared leading space count
17:53:45FromDiscord<Clyybber> and then cut that off
17:53:59FromDiscord<Clyybber> no exceptions and thats how I would expect it to work
17:54:23disruptekthat's not how the compiler calculates indent, though.
17:54:32FromDiscord<Clyybber> ?
17:54:36FromDiscord<Clyybber> thats not the point
17:54:46FromDiscord<Clyybber> its not related
17:55:35disruptekmaybe it would be useful to determine how many columns were removed, or to make that a separate proc or a var param.
17:56:06FromDiscord<Clyybber> I think it should be simple
17:56:22FromDiscord<Clyybber> if you want to determine the shared indentation a different proc should be used
17:56:28FromDiscord<Clyybber> and piped into the other unindent overload
17:56:42FromDiscord<Clyybber> wtf
17:56:46leorize[m]just do it like python
17:56:50FromDiscord<Clyybber> the current unindent is just unindent(1000)
17:56:53disruptekwell, please expose your counting proc.
17:57:15disrupteki'd like to be able to reproduce your behavior, you see.
17:57:20disruptekotherwise, i really don't care.
17:58:21FromDiscord<Clyybber> whats the reason we are using extern and rtl on all strutils procs again?
17:58:22FromDiscord<Clyybber> I forgot
17:58:30FromDiscord<haxscramper> Like this? https://play.nim-lang.org/#ix=2w2Z
17:58:31Yardaniconimrtl ?
17:58:51FromDiscord<haxscramper> Not it's `n log n`, but that doesn't really matter tbh
17:58:58FromDiscord<Clyybber> @haxscramper oh nice
17:59:07leorize[m]yea it's for nimrtl
17:59:08FromDiscord<Clyybber> why is it n log n?
17:59:12FromDiscord<Clyybber> Shouldn't it be n
17:59:30FromDiscord<haxscramper> I sort lines to find common prefix. I can iterate over each one and increment indentation ..
17:59:43leorize[m]the rtl thing should be made into a template/macro
17:59:47FromDiscord<haxscramper> Oh, yeah, should've done that. I just copied my common prefix implementation
18:00:26FromDiscord<Clyybber> Hmm, I don't see why you would need to sort them
18:00:48FromDiscord<Clyybber> we have to go over each one anyways
18:01:09disruptekagree, evaluating for the purposes of sort is equivalent.
18:01:18FromDiscord<Clyybber> oh, eh, maybe I'm misunderstanding
18:01:18disruptekat best.
18:01:28FromDiscord<Clyybber> do you mean n log n with respect to the amount of lines?
18:02:57FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2w31
18:04:31disruptekor just make a static one.
18:05:34FromDiscord<haxscramper> I wrote my `commonPrefix` when I needed to have something quickly and haven't touched it since then
18:07:11FromDiscord<haxscramper> > do you mean n log n with respect to the amount of lines?↵@Clyybber Now it's linear in respect to number of lines
18:07:11FromDiscord<Hearthstone> !repo dynlib
18:07:13disbothttps://github.com/aerosoul94/dynlib -- 9dynlib: 11IDA Pro plugin to aid PS4 user mode ELF reverse engineering. 15 44⭐ 12🍴 7& 29 more...
18:07:28FromDiscord<Hearthstone> Oof-
18:07:39FromDiscord<Hearthstone> Dynlib is apart of the stdlib
18:07:41FromDiscord<Hearthstone> Right?
18:08:30FromDiscord<Rika> yes
18:08:34FromDiscord<Hearthstone> That explains it-
18:10:01FromDiscord<Hearthstone> Hm
18:10:06FromDiscord<Hearthstone> !docs dynlib
18:10:12FromDiscord<Hearthstone> Oof
18:10:19FromDiscord<Hearthstone> ~dynlib
18:10:20disbotdynlib: 11shared library creation; documented at https://nim-lang.org/docs/dynlib.html
18:10:25FromDiscord<Hearthstone> There-
18:10:41FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2w34
18:11:33FromDiscord<haxscramper> * sad RFC noises *
18:11:40FromDiscord<Rika> lol
18:11:44FromDiscord<Clyybber> @haxscramper then its also linear in respect to the number of chars
18:13:32FromDiscord<haxscramper> Well, yes, technically it is `O(lines * prefix-len)` which is potentially `O(lines^2)`. Getting indentation by first one is `O(lines)` and sorting is `O(lines * log(lines))` if I'm not mistaken
18:13:35*a_chou quit (Quit: a_chou)
18:14:05disrupteki have to get out of this country.
18:14:30FromDiscord<Clyybber> @haxscramper no its O(n) to get the common indentation
18:14:35FromDiscord<Clyybber> and O(n) to strip it
18:15:01FromDiscord<Clyybber> since in the worst case you go over each char, count it as indentation and strip it later
18:15:17FromDiscord<Clyybber> right?
18:15:48FromDiscord<haxscramper> > I don't think we need a whole new special string syntax for it, we can do so much with the available constructs already↵@exelotl Well, it is pretty clear that new syntax is not going to be added anyway - majority voted against, I don't feel so strongly about it anyway. Most of the arguments are "it just looks better" which is like *super* subjective.
18:19:02FromDiscord<haxscramper> > right?↵@Clyybber "case you go over each char" - that's when `prefix-len` factor comes from. You go over each char in each line *until* you find non-whitespace. Oh, yeah, it is actually `O(lines * min-lines-len)`, not `^2`. And this is unlikely scenario anyway unless you have string literal with `79` leading whitespaces and single column on the right `|`
18:19:51FromDiscord<Clyybber> Yeah, but see this "until you find non-whitespace" is at worst the \n for the next line
18:19:58FromDiscord<Clyybber> or the \0
18:20:08FromDiscord<Clyybber> so at worst you go over each char once
18:20:14FromDiscord<Clyybber> which is O(n)
18:20:38FromDiscord<Clyybber> but yeah, what you said makes sense
18:22:43FromDiscord<haxscramper> Anyway, real-world input is unlikely to have anything above 4-12 leading whitespaces. If current one is ok in terms in naming I might PR it right now
18:24:13FromDiscord<Clyybber> I think my version looks a bit simpler
18:24:49FromDiscord<Clyybber> But if you want to make a PR go ahead?
18:24:55FromDiscord<Clyybber> (edit) 'ahead?' => 'ahead'
18:25:12FromDiscord<Clyybber> I'm making one too
18:25:13FromDiscord<Clyybber> :D
18:25:42FromDiscord<Clyybber> I'll send my version in in just a bit
18:25:55FromDiscord<Clyybber> maybe you find a spot where it could be better
18:29:04FromDiscord<dom96> This makes me think that we should teach people to use `import std/` everywhere
18:29:06FromDiscord<dom96> https://github.com/nim-lang/redis/pull/20
18:29:07disbotimport std/net to allow for local 'net' module
18:31:56ZevvI really wonder if people complaining about Nim error messages have ever even touched or have been near c++
18:36:38FromDiscord<lqdev> @dom96 i do it already :)
18:36:47FromDiscord<lqdev> for clarity tho
18:37:28disruptekyeah, i've been using std/ for months. it's not 100% correct afaik, though
18:37:46FromDiscord<Clyybber> ? wdym not correct?
18:39:05FromGitter<alehander92> well why compare with c++
18:39:11FromGitter<alehander92> if we can compare to other langs
18:39:20FromGitter<alehander92> at a certain X
18:39:35disruptekwhether i should be preventing a monkeypatch, or even capable of doing so, is worth debate. also, i use std/ habitually; it amounts to FUD.
18:39:40Zevvbecause comparing to C++ makes us look _sooo_ good and sexy
18:41:10FromDiscord<Recruit_main707> iterators have a result variable also or not?
18:41:19FromDiscord<Clyybber> afaik no
18:41:37FromDiscord<Clyybber> it wouldn't make sense
18:41:51disruptekno.
18:42:05*gmaggior joined #nim
18:42:16FromDiscord<Recruit_main707> youd need to yield it manually, but you woudnt initialise it, i guess not having to do it has made me lazy :P
18:42:46disruptekclyybber: one bizarre change i had to make in mangling codegen was to s/Result/result/.
18:43:21FromDiscord<Clyybber> huuuuuuuuuh
18:43:25FromDiscord<lqdev> why?
18:43:33disrupteki have no idea.
18:43:41FromDiscord<Clyybber> investigation
18:43:59disruptekwho cares.
18:44:31disrupteksee fillResult()
18:44:57FromGitter<alehander92> oii
18:45:30disrupteksup sasha
18:45:30FromGitter<alehander92> zevv yes if we talk speed and platforms etc
18:45:34FromGitter<alehander92> not if we talk errors
18:45:56FromGitter<alehander92> hey i have to catch up with my previous nilability stuff disruptek
18:46:11disruptekoh yeah?
18:46:19disruptekyou got a talking-to from araq, too, huh.
18:46:23FromGitter<alehander92> and also read a bit about frama c this days
18:46:28FromGitter<alehander92> oh ok you did as well
18:46:32FromGitter<alehander92> cool so you get me
18:47:07FromDiscord<haxscramper> C++ **template**/linker errors look like text volcano eruption. But in terms of missing `;`, type mismatches and incorrect spelling `clang` is pretty good.
18:48:01disruptek.global forvars. how is this a thing.
18:48:14FromDiscord<Clyybber> global forloop
18:48:16FromDiscord<Clyybber> thats how
18:48:33disruptekyeah but no but just no.
18:48:35FromDiscord<Clyybber> arguably a bit stupid
18:48:38alehander92disruptek so you're ic-ing
18:52:12*wiml joined #nim
18:52:19disruptekon the proverbial cake, baby.
18:53:01disruptekhowever, this ic is gonna be based on frosty and not sqlite.
18:54:04alehander92i actually asked araq if i can help with your or the other milestones if i happen to finish my one on time
18:54:31disruptekmasochist, huh.
18:54:33alehander92but looking at my cps lack of input i think i'll just keep spamming you motivational letters
18:54:38alehander92about having it
18:54:58disruptekcps lack of input?
18:55:20alehander92i mean that i barely managed to help with cps
18:55:31alehander92so i have to talk less
18:55:38disrupteki'm still waiting for you to help with cps.
18:55:44disruptekwhere's my pr?
18:55:44alehander92well
18:56:08alehander92not planning on it.
18:56:08disrupteksmells like i need a shower but i just had one in july.
18:56:14alehander92oh dude
18:56:18alehander92it's my cousin's day
18:56:23alehander92i keep forgetting
18:56:27disruptekoh yeah?
18:56:31FromDiscord<Clyybber> yeah, put him in the shower
18:56:32disruptekget out the hose.
18:56:39alehander92he is 44
18:56:40alehander92dude
18:56:46disruptekit puts the lotion on its skin or it gets the hose.
18:56:48alehander92he can kick my butt
18:56:49disruptekyou know the drill.
18:57:00alehander92i haven't been to the army
18:57:06alehander92i don't know many drills
18:57:16alehander92wow he is so old that he actually has
18:57:23alehander92when we still had a draft
18:59:06disruptekmy cousin has a sheep with a pretty mouth.
18:59:44disrupteki mean, do we /really/ need macros?
19:00:03*Vladar quit (Quit: Leaving)
19:00:13Zevvyou still haven't told me what the alternative would be
19:01:46disruptekjust nim all the way down.
19:03:40FromDiscord<Rebel> sent a long message, see http://ix.io/2w3r
19:04:39disrupteki just don't understand why i need to download text like this from ix.
19:05:37disruptekrebel: doesn't matter.
19:05:46disruptekuse whatever is easiest.
19:05:49disruptek!repo asynctools
19:05:50disbothttps://github.com/cheatfate/asynctools -- 9asynctools: 11Various asynchronous tools for Nim language 15 61⭐ 20🍴
19:06:53disruptekif you need to change things later, it won't be difficult.
19:08:02wimldumb question: I'm trying out the nim snap on ubuntu, running into problem similar to this: https://github.com/sirredbeard/nim_lang_snap/issues/11 is this PEBCAK or ?
19:08:04disbotCan't import any stdlib ; snippet at 12https://play.nim-lang.org/#ix=2w3s
19:09:21disruptekpass --lib=/some/where/nim/lib to your compilation and then figure out what the fuck happened to snap.
19:09:59disrupteknothing in the repo appears to be working, so i wouldn't bother with it.
19:10:02disruptek~gitnim
19:10:02disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
19:10:08disruptekthis is what i use and it is reliable.
19:16:10wimlyeah, not super fond of snap, but checking for something a little less ... err ... curl|sh than choosenim. I'll look at gitnim
19:16:48wimlor just go back to building from source
19:17:27FromDiscord<Rebel> interesting so it won't matter if I mix asyncio + threading whether it be by manually creating threads or using spawn? Wanted to see how threadpool works under the hood but it just had the magic pragma so that wasn't very helpful.
19:18:04disrupteki use source builds but for reproducing builds, gitnim makes the most sense, since it uses binaries built from nim's ci/cd process.
19:18:57disruptekrebel: i doubt it will matter for your application.
19:19:26FromDiscord<Rebel> awesome I will just use spawn then seems to be the easiest approach at least the way I am going about it then having to deal with manually creating threads and passing around the lock
19:23:09*pangey quit (Ping timeout: 272 seconds)
19:24:05*pangey joined #nim
19:27:11disruptekwhat lock?
19:28:03Zevvdisruptek: what is the status of the typed branch then, I see you are doing stuff?
19:28:25disruptekwell, i did most of the shim last night.
19:28:30Zevvwhat's the shim
19:28:41disruptekthere's a bug that's probably mine and there are one or two compiler bugs.
19:28:57disruptekthere's a drawing in the commit.
19:29:51disruptekhttps://github.com/disruptek/cps/blob/typed/cps.nim#L355
19:30:13Zevvthat's not a drawing
19:30:14Zevvthat's prose
19:30:30disruptekbut clyybber made my nuts hurt so bad i had to get into bed with a heating pad and massage them until i passed out.
19:31:09Zevvso, how did you make this up
19:31:11Zevvwhat does it solve
19:31:22disrupteklet x = someCpsCall(somevar)
19:31:22*maier joined #nim
19:31:51disrupteki had to impl some other rewriting and return-value handling, too, so there's that also.
19:32:40FromDiscord<Rebel> Nim Locks
19:33:00disrupteknim locks make my teeth sweat.
19:34:17ZevvI don't see it - what does the shim bring
19:34:28disruptekdamnit.
19:34:43disruptekhttps://github.com/disruptek/cps/issues/36
19:34:44disbotneed a shim for continuation results as rvalues
19:35:06disrupteklet x = someCpsCall(somevar) # currently puts a continuation into x.
19:35:17Zevvoh dang right
19:35:19FromDiscord<Rebel> why do nim locks make you sweat lol
19:35:21Zevvsorry I'm blind
19:36:05ZevvI didn't realize the pre- and post- echo were the same
19:36:17Zevvthis is pretty smooth dude
19:36:17disruptekbbiab, dog needs beating.
19:36:33disruptekno, it doesn't work.
19:36:38*maier quit (Ping timeout: 260 seconds)
19:42:27gmaggiorwhat is '?' in Nim?
19:42:44FromDiscord<Elegant Beef> Fairly certain by default an unused operator
19:43:53FromDiscord<lqdev> it's unused yeah
19:45:18*solitudesf joined #nim
19:45:30gmaggiorthx (it is because I tried defining proc odd? just to check if it is possible. Not)
19:45:32Zevvwell, I wouldn't say it's unused. It's just an operator you can use however you want.
19:45:48FromDiscord<lqdev> gmaggior: nim is not ruby :p
19:45:50FromDiscord<Elegant Beef> did you use backticks to declare the proc?
19:45:54FromDiscord<lqdev> we use `isOdd` here
19:46:02FromDiscord<lqdev> also you can't use a proc with a suffix like that
19:46:04FromDiscord<lqdev> it's a syntax error
19:46:21FromDiscord<Elegant Beef> Thought we could cheese operators with the name, or is that only assignment?
19:46:31FromDiscord<lqdev> nope
19:46:33gmaggior:) fine
19:46:43FromDiscord<lqdev> ruby allows you to add `?` or `!` to the end of a method name
19:46:52FromDiscord<lqdev> so you can do stuff like `if 3.odd?`
19:47:03FromDiscord<Elegant Beef> we can put `=` at the end though for properties
19:47:45FromDiscord<lqdev> yup
19:48:09FromDiscord<Elegant Beef> You said no
19:48:36FromDiscord<Elegant Beef> "or is that only assignment" 😛
19:52:41FromDiscord<lqdev> my bad
19:52:49FromDiscord<lqdev> didn't understand your question fully :p
19:54:39FromDiscord<haxscramper> How do I get node from immutable gram graph? There is a `[]` but it only accepts mutable graph
19:56:19FromDiscord<Clyybber> @haxscramper Oh, I see you made a PR too :D Mine hits a compiler bug though I think
19:56:54FromDiscord<dk> is this stupid https://media.discordapp.net/attachments/371759389889003532/751168861952278618/unknown.png
19:59:18FromDiscord<Clyybber> how can I expand the processing dots again?
20:01:08FromDiscord<haxscramper> One of the big advantages for nim & the fact it recompiles whole program from scratch each time is that I can just open currently opened packages and do some quick-fix that I'm hitting in particular edge case. Bad practice in the long run though
20:01:25*drewr quit (Ping timeout: 240 seconds)
20:01:27disruptekhaxscramper: nah, that's good.
20:01:38disruptekmakes developing many deps at the same time really nice.
20:01:46*lritter quit (Ping timeout: 258 seconds)
20:02:06FromDiscord<haxscramper> Really similar how emacs/other lisp systems are intended to be used
20:02:17disruptekyeah, i mean, it makes sense.
20:02:21*lritter joined #nim
20:03:19disruptek[] requires a var because nim's [] usually yields a var, so...
20:03:29disruptekin gram, i mean. we can change that if it's dumb.
20:04:21*drewr joined #nim
20:04:24disruptekZevv: so you see the problem.
20:04:28FromDiscord<Rebel> Do you need the .thread pragma for a proc that calls spawn? Doesn't seem to play well with the .async. pragma?
20:04:31Zevvsure
20:04:48Zevvit just seems that I am able to forget most of all this in three weeks
20:05:08FromDiscord<haxscramper> Oh, so it's not me being blind again. Good to know this
20:05:18Zevvit
20:05:20disruptekno, this is a very new library.
20:05:30Zevvit's jus that I didn't connect this to the term "shim"
20:06:02disruptekyeah, i don't really know how to works yet because there are a few ways to do it.
20:06:07disruptekso i just call it "shim."
20:06:14FromDiscord<haxscramper> By the way, is there any plans to add basic graph algorithms: topological sorting etc.?
20:06:22disrupteksure.
20:06:49Zevvdid you decide in the end if we really need to rewrite all env vars or do we get away with the trippy templates
20:07:07Zevvbecause shims will maybe complicate a bit with stuff like tuple assignments etc
20:07:11disrupteki was going to just wrap another library but i couldn't find anything that seemed like a good candidate.
20:07:14alehander92hm
20:07:31voidpiwhat is the meaning of &=
20:07:33voidpi?
20:07:36disruptekZevv: tuples should be fine.
20:07:45disruptekvoidpi: concat-and-set-value-of
20:07:57FromDiscord<Clyybber> basically add
20:08:03FromDiscord<Clyybber> not basically, literally
20:08:04voidpidisruptek: thanks
20:08:35voidpisorry, new to nim
20:08:46FromDiscord<haxscramper> I asked it before, but is there any way to write proc for both mutable and immutable parameters if I use `mitems` or `mpairs`?
20:08:46Zevv"Appends in place to a string"
20:08:48FromDiscord<Clyybber> don't be sorry
20:09:09FromDiscord<haxscramper> Or the only whay is to use some kind of `when compiles(mitems(...))`
20:09:20disruptekconcepts
20:09:33Zevvdisruptek's got a new hammer
20:09:38Zevvnow everything looks like a concept
20:09:45disruptekmost stuff is.
20:09:57disruptekbut i'm not writing concepts anymore.
20:10:09*disruptek crys into his hands.
20:10:12FromDiscord<Clyybber> haxscramper: You could define your own smartitems that is mitems or items depending on the mutability of its argument
20:10:13disruptekcries, too.
20:10:15voidpiClybber: but also happy, now I know
20:10:39FromDiscord<Clyybber> :)
20:11:01FromDiscord<haxscramper> I just want to do quick-fix on `[]` in gram - I could just copy-paste immutable version and change `mitems` to `items`, but there should be something better. But without writing macro
20:11:10disruptekhaxscramper: you're seeing var refs because they allow dispatch, though it obviously isn't exactly sensical.
20:11:21FromDiscord<Clyybber> haxscramper: Extract the impl to a template
20:11:30FromDiscord<Clyybber> and pass in mitems or items
20:11:35FromDiscord<Clyybber> depending on which you want
20:11:44FromDiscord<haxscramper> Oh yes
20:11:44disruptekjust change it if you think it makes sense. i don't care.
20:12:01disrupteki publish this shit so other people can enhance it.
20:12:16disruptekZevv: are you telling me that tuples don't work in typed?
20:13:18disruptekoh shoot, they are denied.
20:23:56*narimiran joined #nim
20:27:09*literal_ is now known as literal
20:27:56rayman22201disruptek, you say crazy shit and I have to come out of lurking to because I have so many questions: "this ic is gonna be based on frosty and not sqlite." WTH is frosty?
20:27:56rayman22201"i mean, do we /really/ need macros?" - how would you do async or cps without macros?
20:28:14disruptek!repo frosty
20:28:15disbothttps://github.com/disruptek/frosty -- 9frosty: 11Serialize native Nim objects via Streams and Sockets ⛄ 15 11⭐ 0🍴
20:28:30disruptekmacros are dumb.
20:28:40FromDiscord<lqdev> macros are half-baked.
20:28:51*vsantana joined #nim
20:29:02rayman22201a very well thought out and reasoned argument I see. So much is explained now, thank you :-P
20:29:17Yardanicodisruptek: yeah we all should instead duplicate stuff everywhere and who needs DRY :)
20:29:31Yardanicoit's better when users pay a runtime cost on every launch
20:30:11rayman22201No seriously, what's the discussion. I literally have no context here?
20:30:39FromDiscord<Clyybber> macros aren't half baked and not dumb either
20:30:40disruptekgimme a sec to finish this commit.
20:30:57FromDiscord<lqdev> @Clyybber have you ever tried doing type introspection with macros?
20:31:07Yardanicorayman22201: disruptek is mostly trolling like always
20:31:11rayman22201lol. np. do real work, it's fine. I'll get in line to take a shower I guess :-P
20:31:14FromDiscord<Clyybber> @lqdev yeah.
20:31:18Yardanicoyou should never believe what he says by default :)
20:31:26FromDiscord<Elegant Beef> Yard dont say that you might make his balls throb
20:31:32FromDiscord<Clyybber> half baked is a bit of an overstatement
20:31:39Yardanicoexactly
20:31:40disruptekyard is mostly full of shit like always.
20:31:44FromDiscord<Recruit_main707> its not half baked, it lacks some sugar
20:31:59Yardanicodisruptek: i wonder if you will stop trolling some time in the future :P
20:32:04Yardanicoespecially when newbies join this chat
20:32:23Yardanicomaybe they heard about macros and stuff, and here you are "macros are dumb" :D
20:32:26FromDiscord<lqdev> think i'm gonna write an rfc about improving the current sym introspection situation.
20:32:29FromDiscord<Rika> I don't see that happening in the future
20:32:30FromDiscord<Elegant Beef> Someone was asking how to convert types and he was just saying "RTFM div operator"
20:32:37disrupteklqdev: i would work on that problem with you.
20:32:51FromDiscord<Clyybber> @lqdev can you elaborate on the problems
20:33:05FromDiscord<Clyybber> I'm working on something thats about syms and types
20:33:07FromDiscord<Clyybber> and macros
20:33:07FromDiscord<Rika> I think macros right now are pretty clunky but eh it's fine for me
20:33:09FromDiscord<lqdev> most notably: resolving an ident is a PITA
20:33:16FromDiscord<Clyybber> heh
20:33:18FromDiscord<Clyybber> guess
20:33:19FromDiscord<Clyybber> what
20:33:22FromDiscord<Clyybber> I'm working on :D
20:33:29FromDiscord<lqdev> cool!
20:33:32FromDiscord<lqdev> can't wait
20:33:39FromDiscord<Clyybber> https://github.com/nim-lang/Nim/pull/15252
20:33:40disbotTurn proc params into syms
20:33:44rayman22201disruptek's trolls are usually based in some kernel of something interesting. I just have to put on my bullshit boots first.
20:34:11FromDiscord<lqdev> but what i need more is something like bindSym but it binds syms from the callsite
20:34:14FromDiscord<haxscramper> How do I revert `nimble develop`
20:34:22disruptekrm -rf
20:34:32FromDiscord<Clyybber> /*
20:34:36FromDiscord<lqdev> don't
20:34:38Yardanicodoas
20:34:42FromDiscord<haxscramper> `--no-preserve-root`
20:34:46Yardaniconah that's old
20:34:51Yardanico /* is better
20:35:14Yardanicodoas<spc>rm<spc>-rf<spc>/*
20:35:18Yardanicodoas is better
20:35:29FromDiscord<Clyybber> why the <spc>?
20:35:38Yardanicowell i doubt a lot of people have doas anyway
20:35:38FromDiscord<Clyybber> is your space key broken :p
20:35:42Yardanicobut so just no one pastes it
20:35:45Yardanicoand blames me for it
20:35:50FromDiscord<Clyybber> heh
20:35:53FromDiscord<lqdev> what's doas for
20:35:55FromDiscord<Clyybber> sudo
20:35:59FromDiscord<Clyybber> but generalized
20:36:00Yardanicolightweight alternative of sudo
20:36:14disruptekZevv: this tuple code works but i really don't understand how.
20:36:17FromDiscord<haxscramper> Will try this when I finally move to docker for development instead of just collecting everything in the `~/workspace/git-sandbox`
20:36:24Yardanicofor 99% of sudo users all of their usage can be replaced with doas
20:36:45disruptekhaxscramper: just use nimph. you'll like it.
20:36:49FromDiscord<Clyybber> but only for 50% of doas users all of their usage can be replaced by sudo
20:37:32FromDiscord<haxscramper> Back to my question: I did `nimble develop` and I want to undo it. How can I do this?
20:37:48disruptekrm any nimble-link files
20:37:49Yardanicojust install
20:37:50disruptekrm .git
20:37:53Yardanicothe package or something
20:38:07FromDiscord<Clyybber> nimble uninstall to remove the link probably
20:38:10disruptekor, like i said, rm -rf
20:38:23Yardanicodisruptek: that defeats the purpose of the pkg manager
20:38:24FromDiscord<Clyybber> I'm about to rm -rf you
20:38:28shashlicknimble uninstall packagename
20:38:31Yardanicodo you rm -rf when you remove packages in your distro?
20:38:38Yardanicosounds very smart
20:38:43FromDiscord<Clyybber> hell yeah
20:39:24FromDiscord<Clyybber> especially on distros where you can't verify your pm managed integrity
20:39:44*awe00 joined #nim
20:39:46*awe00 quit (Client Quit)
20:39:48disruptekYardanico: what can i say?
20:39:55disruptekthere's no purpose to nimble.
20:40:07disruptekrayman22201: i'm just tired of writing in two languages when i really just want to write in one.
20:40:14FromDiscord<Clyybber> Yardanico: can pacman do what xbps-pkgdb -a does?
20:40:17Yardanicodisruptek: well I know that you're always very critical
20:40:25disruptekit's my super-power.
20:40:52Yardanico@clyybber not sure
20:41:06FromDiscord<Clyybber> rayman22201: Nothing interesting behind it today, disrupteks crying about nnkNodeKind vs nkNodeKind
20:41:17rayman22201lol. I see
20:41:38disruptekmacros, great, it's nim, but with more limitations.
20:41:42disruptekwhy do i want this?
20:41:43disrupteki don't.
20:41:55Yardanicothen write in common lisp :)
20:42:15disrupteki probably will end up impl a proper lisp in nim.
20:42:17FromDiscord<Clyybber> disruptek: Hey, your mumble is *still* online
20:42:25disruptekoh yeah?
20:42:26FromDiscord<Clyybber> did you pay in advance for a lifetime or what?
20:42:32Yardanicoit's hosted by his friend afaik
20:42:33*awe00_ quit (Ping timeout: 260 seconds)
20:42:39Yardanicoso I guess it's "eternal"
20:42:40FromDiscord<Clyybber> oh cool
20:42:51rayman22201I was daydreaming about the idea for a structural editor for Nim. It already exposes the AST pretty directly, why not make an editor that just spits out Nim AST instead of text.
20:42:54disrupteknah, i pay for it, but it's like $20 for 3 years or something.
20:43:01Yardanicooh you do
20:43:02rayman22201but that's the kind of weird shit I think about
20:43:58disruptekclyybber: i was on there yesterday talking to araq.
20:44:10FromDiscord<Clyybber> oh cool
20:44:16FromDiscord<haxscramper> Nimph installs packages using git, correct?
20:44:21FromDiscord<haxscramper> i.e as submodules
20:44:34disruptekversion 1 doesn't use submodules, really.
20:44:44disruptekyou can use 'em but it's not smart about it.
20:44:51disruptekit's smart about git.
20:44:55rayman22201seems like many of the restrictions of macro code keep getting smaller. People like Clyybber keep fixing it.
20:44:57disruptekversion 2 will be smart about submodules.
20:45:05FromDiscord<lqdev> @Clyybber proc params being syms is cool and all, but what about resolving symbols from callsite?
20:45:51disruptekhttps://github.com/disruptek/nimph/pull/140
20:45:52disbotnimph 2.0
20:46:03disrupteklqdev: do you do any callsite macros?
20:46:09FromDiscord<haxscramper> I'm mostly interested in doing quick-fix of my local package installation and then PR'ind it, instead of cloning package again and repeating all edits
20:46:20disruptekthat's what nimph is for.
20:46:33*lritter quit (Quit: Leaving)
20:46:46FromDiscord<haxscramper> Will switch to nimph tomorrow
20:46:57disrupteknimph fork gram; cd (nimph path gram); vi gram.nim; git commit -m fixup gram.nim; git push
20:47:00FromDiscord<Rika> I'm also pretty interested in nimph
20:47:22disruptekthis is literally what you can type to fix gram.
20:48:19disruptekrayman22201: frosty is a hack motivated by araq joyously celebrating parsing 2mb of C in 0.6s.
20:48:30FromDiscord<haxscramper> No, I mean I'm using already using gram in other code and I don't want to clone it separately. I want to edit user-installed package source code
20:49:00FromDiscord<Rika> You can do that with nimble too though
20:49:12disruptekso echo '--path="../gram/"' > nim.cfg and proceed.
20:49:15FromDiscord<Clyybber> @lqdev wdym?
20:49:29FromDiscord<Clyybber> do you mean binding idents from an untyped ast?
20:49:36disruptekyou can also clone using nimph from a local repository, if you want.
20:49:51FromDiscord<lqdev> @Clyybber right now you have to generate a call to a macro which accepts a typed param to turn an ident to a sym
20:50:03FromDiscord<lqdev> and no, bindSym isn't the thing i'm looking for
20:50:22FromDiscord<lqdev> basically there's eg. a proc `myProc` at the callsite
20:50:26rayman22201parsing 2mb of C in 0.6s is a cool thing to celebrate. Frosty reminds me of Python pickle. binary object storage basically. Good foundational lib to have.
20:50:27FromDiscord<lqdev> and i get it in ident form (from a DSL)
20:50:45FromDiscord<Clyybber> yeah, I think I know what you want
20:50:46disruptekrayman22201: i used to mention pickle in the readme but it wasn't very accurate.
20:51:14disruptekrayman22201: pickle is more of a binary marshal. this is even more low-level. platform-specific types and whatnot, no safety per se.
20:51:26FromDiscord<Clyybber> don't quote me on that, but I don't think something like this will be implemented
20:51:29FromDiscord<Clyybber> or even possible generally
20:51:31rayman22201pickle without the safety rails lol
20:51:53disruptekyes, but sometimes "i don't care." as he says.
20:51:54FromDiscord<lqdev> sad
20:51:57disruptekyes, but sometimes "i don't care." as He says.
20:52:10FromDiscord<lqdev> maybe my upcoming introspection package will help with that
20:52:24rayman22201little endian or big endian, who cares, not like I'm sending this binary blob over the network to a SPARC machine :-P
20:52:26FromDiscord<Clyybber> See, attaching scopes to indents would be a bad idea IMO
20:52:37disruptekrayman22201: or, if i am, i'll deal with it.
20:52:54FromDiscord<Clyybber> And wouldn't solve the problem since you wouldn't have anything in the scope from the AST that you passed to the macro
20:53:08FromDiscord<Clyybber> so you could bindSym to all semmed stuff from the callsite
20:53:17rayman22201I'm poking fun at you, but I actually think it's pretty cool. I like it.
20:53:23FromDiscord<Clyybber> but bindSymming to an actual symbol that was already defined in the arg ast itself wont work
20:53:32FromDiscord<Clyybber> because it hasn't been semmed yet
20:54:03disruptekrayman22201: yeah, i did some lmdb stuff and it was quick, but this is the right tool for the job simply because it's so simple. native nim and <100 lines iirc.
20:54:07FromDiscord<Clyybber> so the current way where you manually splice up the AST and pass it on to submacros that take typed params is IMO the best way
20:54:28disruptekhow do you figure?
20:54:39disruptekit's a pita no matter who you ask or where you see it.
20:54:47disruptekwho wants to write code this way?
20:55:15FromDiscord<Clyybber> But maybe we should have a "applyMacro" template
20:55:29FromDiscord<Clyybber> or magic?
20:55:37disrupteki think cps is proof that the context switch isn't even necessarily control-flow based.
20:56:00disruptekcps wants a callsite pragma.
20:56:21disruptekthis animal exists in concepts as foo() {.explain.}
20:56:28disrupteki want the same thing.
20:57:01FromDiscord<Clyybber> @lqdev Don't you think its possible to write a helper for the submacro pattern?
20:57:02disrupteksounds like lqdev is making the case for something similar as well.
20:57:11FromDiscord<lqdev> yeah, that's my current idea
20:57:42FromDiscord<Clyybber> maybe a "typeThis" magic could be sound?
20:58:51*pietroppeter quit (Quit: Connection closed for inactivity)
20:59:01*noonien quit (Quit: Connection closed for inactivity)
21:01:18*solitudesf quit (Ping timeout: 256 seconds)
21:01:32FromDiscord<haxscramper> skiplists 0.2.2 fail to compile with error `Error: undeclared identifier: 'Less'` which can be fixed by using `cmp.Less` instead of simply `Less`. Question: there is a problem with a liibrary or did I just completely mess something up on my side
21:01:47*a_chou joined #nim
21:01:47FromDiscord<haxscramper> `cmp` is pure enum
21:01:57FromDiscord<Clyybber> disruptek: Oh btw, what is it that keeps them from being seq based?
21:03:00FromDiscord<Clyybber> haxscramper: I think disruptek often has some paths of his lib in his --paths, so its probably not something on your side
21:03:26FromDiscord<Clyybber> oh, wait I misread, sorry
21:03:44disruptekno, that's just nim being dumb.
21:03:49*narimiran quit (Ping timeout: 246 seconds)
21:04:31disruptekthe point of skiplists is that they enable consistent performance of mutation
21:05:01disruptekthink insertion or deletion.
21:05:32FromDiscord<Clyybber> eh
21:05:42FromDiscord<Clyybber> seqs provide consisten performance of mutation
21:05:48FromDiscord<Clyybber> armortised
21:06:07*krux02 quit (Read error: Connection reset by peer)
21:06:32disruptekwut
21:06:43disruptekdo you know what that word means?
21:06:50disruptekor maybe it's a translation issue.
21:07:24*krux02 joined #nim
21:08:43FromDiscord<Rebel> Is there a way to await a future from threadpool's spawn on an async proc? I thought something like async ^retValue would work but getting an error (```Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]```) 😦 and doing await spawn asyncProc does not work. nor does spawn await asyncProc.
21:08:50disruptekif you're satisfied with seq performance, don't use linked-lists. 🤷
21:10:06disruptekhaxscramper: which version of gram were you using successfully? 0.0.9?
21:11:09*sagax quit (Ping timeout: 258 seconds)
21:12:20FromDiscord<Clyybber> disruptek: Yeah, I guess. What I'm thinking of probably doesn't count as skiplist anymore, guess I overfitted to the requirements when I implemented it
21:12:58FromDiscord<Clyybber> disruptek: What I was thinking of was using seqs for the high layers because those rarely get insertions anyways
21:13:01disrupteki think there could be a different skiplist that uses seqs to represent to depth of the list.
21:13:09FromDiscord<Clyybber> ah right
21:13:32FromDiscord<Clyybber> that was probably what I was thinking of last time I shit on your skiplists
21:13:34disruptekbut, like, i'd need to see the type you have in mind to figure out how it works.
21:13:44FromDiscord<Clyybber> I got it now
21:13:47FromDiscord<Clyybber> basically
21:13:54FromDiscord<Clyybber> if you know the depth
21:14:09FromDiscord<Clyybber> of the skiplist
21:14:43FromDiscord<Clyybber> just use a seq, where each element corresponds to the link to the next element in the respective layer
21:14:58FromDiscord<Clyybber> thanks for recollecting my memory buddy, I was struggling hard
21:15:24*FromDiscord quit (Remote host closed the connection)
21:15:31disruptekyeah, i'm not sure i really get it yet.
21:15:39*FromDiscord joined #nim
21:15:49disruptekso the longest list holds seqs of varied length according to depth?
21:16:32disruptekthey could maybe just be sequences, depending...
21:17:08FromDiscord<Clyybber> yeah
21:17:41disruptekyou'd have to cheat but eh.. no one is watching.
21:17:42FromDiscord<Clyybber> so that you only have an element once
21:17:56FromDiscord<Clyybber> and the pointer chasing gets turned into a inc i
21:18:12disruptekwell, a dec
21:18:45FromDiscord<Clyybber> yeah, doesn't matter
21:19:02shashlickhttps://www.reddit.com/r/programming/comments/im29cv/benchmarking_exercise_for_rust_nim_and_go_against/
21:19:12FromDiscord<Clyybber> but yeah, representing the lowest level with 0 is the best idea
21:20:00disrupteksieve of eratosthenes is one of the first algos i ever implemented in c.
21:20:35disruptek30 years ago.
21:25:07disruptekhaxscramper: you need to import skiplists where you import gram, i guess. silly, but i guess we can just force an export of cmp until nim is fixed.
21:27:06FromDiscord<Recruit_main707> `sieve(primes: ref seq[uint32])` 🥴
21:32:12*maier joined #nim
21:33:33*tane_ quit (Quit: Leaving)
21:34:36FromDiscord<lqdev> ref seq jesus christ
21:34:57FromDiscord<lqdev> somebody doesn't know the language and is benchmarking it~ 🎵
21:35:10Yardanicocheck the comments though :)
21:35:55FromDiscord<Rika> Why do they need ref semantics here
21:36:03Yardanicowell they actually needed to use "var seq"
21:36:37FromDiscord<lqdev> ^
21:36:42Yardanicoanyway the speed is the same with both versions
21:36:54Yardaniconeed to try with arc
21:37:23*maier quit (Ping timeout: 260 seconds)
21:37:39*Trustable quit (Remote host closed the connection)
21:37:41Yardanicoseems like it's mostly the same, maybe slightly faster
21:37:44Yardanicowell, that's to be expected really
21:38:13FromDiscord<Recruit_main707> what about using an array?
21:38:44FromDiscord<Rika> That changes the code too much
21:39:31FromDiscord<Recruit_main707> id say it doesnt really
21:39:42FromDiscord<Recruit_main707> and it would make more sense to have a ref
21:39:55FromDiscord<Recruit_main707> a few less lines
21:44:18FromDiscord<lqdev> it makes less sense
21:44:34FromDiscord<lqdev> it actually needs more lines
21:44:38FromDiscord<lqdev> and allocates on the heap
21:44:49FromDiscord<lqdev> that's a pointless double pointer deref
21:45:03FromDiscord<lqdev> as the seq's content is already on the heap
21:45:13FromDiscord<Recruit_main707> arent we agreeing then?
21:45:43Yardanicowell "var seq" is still required because seqs have value semantics
21:45:50FromDiscord<lqdev> you said "and it would make more sense to have a ref"
21:46:28FromDiscord<Recruit_main707> if he used an array
21:46:35FromDiscord<lqdev> ah
21:46:36FromDiscord<dom96> @Rebel the only thing you can do right now is: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42
21:47:57FromDiscord<Rebel> I'm not following, I am getting a return value it's just that it's Future[string] I would like to await it
21:48:18FromDiscord<Rebel> worse comes to worse I guess I can make that proc synchronous instead of dealing with a headache
21:50:15*FromDiscord quit (Remote host closed the connection)
21:50:32*FromDiscord joined #nim
22:08:11*wiml quit (Ping timeout: 240 seconds)
22:15:43*agent0x00 joined #nim
22:23:36*audiofile quit (Ping timeout: 258 seconds)
22:24:14disruptekDO IT
22:32:29*wiml joined #nim
22:43:42*a_chou quit (Ping timeout: 265 seconds)
22:50:24disruptekticking away, the moments that make up the dull day.
22:50:40disruptekwaiting for something or someone to show you the way.
22:50:44disruptekAM I RIGHT?
22:52:05*vsantana quit (Quit: leaving)
23:08:45*krux02 quit (Remote host closed the connection)
23:13:26*a_chou joined #nim
23:14:09disrupteknot a fan of jsonutils.
23:14:22disruptekthis basically ignores all the discussion about nulls, etc.
23:15:08*a_chou quit (Remote host closed the connection)
23:16:57disruptekpoor style.
23:17:01disrupteknot a fan.
23:17:03disruptekdon't like it.
23:19:33disruptekwhy even introduce code with bugs?
23:20:30*arecacea1 quit (Remote host closed the connection)
23:20:55*arecacea1 joined #nim
23:22:09disruptekterrible.
23:23:09*agent0x00 quit (Quit: WeeChat 1.9.1)
23:31:50*wiml quit (Quit: Leaving)
23:33:05*maier joined #nim
23:38:10*maier quit (Ping timeout: 246 seconds)
23:44:59*gmaggior quit (Quit: Leaving)
23:58:16*audiofile joined #nim