<< 17-05-2019 >>

00:00:41rutenlaha that's a better way to do it, thanks
00:00:56rutenlI had just changed it to TableRef, which seemed to work
00:08:25rutenlstill can't get more than 10000 recursion depth with a func, but it's 2 am so I have to sleep
00:08:33rutenlthanks for the help jrfondren
00:09:12FromGitter<jrfondren> you're calling negaMax in a tail context so it wouldn't benefit from TCO
00:09:32FromGitter<jrfondren> *not calling
00:10:32rutenlWhat's a tail context here? This is some new territory for me
00:11:05rutenlis it because it's branching out multiple times per level?
00:12:36*stefanos82 quit (Remote host closed the connection)
00:14:28*sacredfrog quit (Quit: WeeChat 1.9.1)
00:15:17FromGitter<jrfondren> erm. well visualize control-flow of normal function calls in a procedural language.
00:15:38FromGitter<jrfondren> proc foo = (a(); b(); c())
00:16:34FromGitter<jrfondren> to call a, you record where you are (instruction 1 of foo), and then enter a, and then somewhere in a you'll return (what was that? instruction 1 of foo? OK go there), and then you continue on to the next call to b
00:17:15FromGitter<jrfondren> this record/recall step is obviously necessary when you call a
00:17:16*sacredfrog joined #nim
00:17:29FromGitter<jrfondren> otherwise-- how could the program possibly continue?
00:18:10FromGitter<jrfondren> a recursive call in tail context though, is a cal where you don't *obviously* need this step, because what's already recorded is exactly what you would need to recall
00:19:25FromGitter<jrfondren> for example the c() call, in foo(), does it *really* need to say "oh I've got back to foo so that I can immediately return from foo" ?
00:19:40FromGitter<jrfondren> that "go back to whatever called foo" is already the next thing to recall
00:19:50FromGitter<jrfondren> because foo()'s caller put it there
00:19:53rutenlooh right
00:20:12FromGitter<jrfondren> so c() could skip that step, and then when it returns it'll use the information provided for foo(), and everything works just like you'd expect
00:21:04FromGitter<jrfondren> in other words a function call in tail context is just one that's immediately followed by return. `return c()`
00:21:23*sacredfrog quit (Client Quit)
00:21:47rutenlyea thanks, that wouldn't really work in this case then
00:22:11rutenlbut i really have to go now, thanks for the help!
00:22:31*rutenl quit (Quit: Page closed)
00:22:44*cyberjpn quit (Ping timeout: 258 seconds)
00:25:02*scaredfrog joined #nim
00:26:45*scaredfrog quit (Client Quit)
00:27:37*scaredfrog joined #nim
00:27:42*scaredfrog quit (Remote host closed the connection)
00:28:04*scaredfrog joined #nim
00:31:07*scaredfrog quit (Client Quit)
00:31:38*scaredfrog joined #nim
00:33:12*jjido quit (Quit: Textual IRC Client: www.textualapp.com)
00:36:14*rnrwashere joined #nim
00:38:38*seni joined #nim
01:00:31*cyberjpn joined #nim
01:04:59*rnrwashere quit (Remote host closed the connection)
01:12:07*scaredfrog quit (Quit: ZNC 1.7.3 - https://znc.in)
01:19:15*rnrwashere joined #nim
01:19:44*sacredfrog joined #nim
01:19:44*sacredfrog quit (Client Quit)
01:20:40*dddddd quit (Remote host closed the connection)
01:21:00*rnrwashere quit (Remote host closed the connection)
01:21:12*rnrwashere joined #nim
01:39:28FromDiscord<DeltaPHC> Huh. I'm new to Nim (but not new to programming), and I'm kinda skimming over the experimental features. Concepts (the type system feature) look pretty crazy
01:40:36FromGitter<kayabaNerve> Why does `high` work on int64 but not uint64? :thinking:
01:45:32FromGitter<kayabaNerve> Apparently this has been heavily debated. `not 0'u64` it is.
01:52:54*sacredfrog joined #nim
01:54:54*sacredfrog quit (Client Quit)
01:56:09*sacredfrog joined #nim
02:01:11*banc quit (Quit: Bye)
02:21:20*banc joined #nim
02:38:49*cyberjpn quit (Ping timeout: 258 seconds)
02:45:00*rnrwashere quit (Remote host closed the connection)
02:46:29*rnrwashere joined #nim
03:02:35*theelous3 quit (Ping timeout: 258 seconds)
03:03:56*smitop quit (Quit: Connection closed for inactivity)
03:26:04*cyberjpn joined #nim
03:36:43*cyberjpn quit (Ping timeout: 245 seconds)
03:39:38*cyberjpn joined #nim
03:46:51FromDiscord<treeform> @DeltaPHC, that is why they are experimental 😃 because they are crazy.
04:20:12*rnrwashere quit (Remote host closed the connection)
04:23:06*nsf joined #nim
04:36:12*laaron quit (Remote host closed the connection)
04:36:46*laaron joined #nim
04:41:08*cyberjpn quit (Ping timeout: 246 seconds)
05:05:59FromGitter<Kvothe87> Hi all. Would it be possible to call a c# dll from nim? I believe not, but asking never hurts
05:08:00*hema joined #nim
05:09:11*hema quit (Client Quit)
05:09:28rayman22201Can you call the dll from regular C? If you can call it from C then you can call it from Nim.
05:09:41*cyberjpn joined #nim
05:17:36FromGitter<Kvothe87> Honestly I don't know, I am totally a noon. From what I read online to call it from c it would have to be exported in special ways
05:18:21rayman22201A quick Google search says you would use the com interface.
05:18:49FromGitter<Kvothe87> *noob
05:19:18rayman22201I would say it's probably not super noob friendly. Theoretically it's possible though
05:20:11*narimiran joined #nim
05:20:32rayman22201It's actually way easier to go the other way. Call Nim from C#
05:23:03FromGitter<Kvothe87> Yeah I read in several places about the opposite direction. Thank you
05:26:25*cyberjpn quit (Ping timeout: 246 seconds)
05:33:23*hoijui joined #nim
05:33:37*cyberjpn joined #nim
05:41:17*cyberjpn quit (Ping timeout: 258 seconds)
06:06:12*Intensitea quit (Remote host closed the connection)
06:21:12*cyberjpn joined #nim
06:32:36FromGitter<albahhar> Hello. I just started nim yesterday. I want to initialize Game and I'm stuck. Please help.
06:33:03FromGitter<albahhar> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cde559fd22ba766a2aeb123]
06:34:31FromGitter<albahhar> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cde55f77c363c75a7f41c7e]
06:42:46*Vladar joined #nim
06:51:41*cyberjpn quit (Ping timeout: 246 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:11*krux02 joined #nim
07:04:45*gmpreussner joined #nim
07:36:58*cyberjpn joined #nim
07:51:19*laaron quit (Remote host closed the connection)
07:52:10*laaron joined #nim
07:55:03*sz0 joined #nim
07:55:21poopBotsorry i went sleep yesterday, so can somone explain to me why i cant assight card?
07:55:22poopBothttps://pasteboard.co/If1z4Lg.png
07:55:35poopBotand it is real error i tryed to compile it
07:56:18*cyberjpn quit (Ping timeout: 245 seconds)
08:04:24*cyberjpn joined #nim
08:04:33AraqpoopBot, because you need to use
08:04:46Araqfor ps in mitems(pt.player_slots):
08:06:15*stefanos82 joined #nim
08:07:04*laaron quit (Remote host closed the connection)
08:08:54*laaron joined #nim
08:09:13*floppydh joined #nim
08:12:18poopBotwhat
08:12:53poopBotoh lol i wrtied ps insted pt
08:13:42poopBotor noth it should be ps
08:15:04*kapilp joined #nim
08:16:03poopBotwith miitesm i get no error, would need to learn about that :)
08:27:43*cyberjpn quit (Ping timeout: 246 seconds)
08:41:38ZevvIt's been a few days now, but still *every* single time I read the nick 'poopBot', I get this graphical interpretation enforced on my minds eye...
08:42:32poopBotduno for me it sounds kinda fun
08:43:05Zevvoh, it is definately fun. But this visual representation just keeps popping up :)
08:46:19*hoijui quit (Ping timeout: 248 seconds)
08:48:08poopBotduno i visual is like lite robot droping mehanical crap
08:52:35*clyybber joined #nim
08:54:30Zevvmine is inspired by Bender I think :)
08:55:03*tdc quit (Quit: Leaving)
08:55:28FromGitter<mratsim> @miran: does the VM/runtime consistency maintain the speed boost from the original multihash in https://github.com/nim-lang/Nim/pull/11203/ ?
08:57:00*Sembei quit (Ping timeout: 252 seconds)
09:01:20*hoijui joined #nim
09:11:50*cyberjpn joined #nim
09:14:51*dddddd joined #nim
09:32:01narimiranmratsim i'm not pinged if you don't use narimiran ;) for speed boost, see https://github.com/nim-lang/Nim/pull/11203/#issuecomment-492551648
09:33:10narimiranthe problem are `hashIgnoreStyle` and `hashIgnoreCase`, as they are now implemented differently. if you have any idea how to speed them up—while keeping the assertions—that would be great
09:33:34*clyybber quit (Quit: WeeChat 2.4)
09:34:21*clyybber joined #nim
09:38:55*clyybber quit (Client Quit)
09:39:26poopBothmm if i have var thing1 :SomeObject, if i make an new var thing2 = thing1 , that will copy just reference to that object not whole object, right?
09:39:36*clyybber joined #nim
09:41:12clyybberpoopBot: depends on wether thing1 is a ref type
09:42:41poopBotand duno if i should use a array[52,Card] or just seq[] perfomace wise will have to shuffle it
09:43:26narimiranyou don't need to shuffle the array, you shuffle your "picks"
09:43:38FromGitter<mratsim> it really depends on the value vs ref semantics you want
09:43:51FromGitter<mratsim> parameter passing will be optimized whatever you end up using
09:44:22FromGitter<mratsim> Also if it's always 52 cards, it's either array or ref array
09:44:31ZevvIt's pretty straightforward: assignment of a var to a new var will copy the 'thing'. If the 'thing' is a ref, you have a copy of the ref
09:44:47FromGitter<mratsim> try not to put more than 200bytes on the stack, that's quite cumbersome
09:45:23FromGitter<mratsim> Also if you need to shuffle cards be sure to use a non-biaised shuffling strategy like Fisher-Yates
09:45:48FromGitter<mratsim> unless you want to simulate human imperfect shuffling
09:46:06narimiranmratsim: hey, guy is having some trouble with the basics, and here you come and throw all that at him :D
09:46:23poopBotif i am shuffuling picks would need to make a custom shuffle picker i that will not pick same ints tought that can work too
09:46:43narimiranpoopBot: https://nim-lang.github.io/Nim/random.html#shuffle%2CRand%2CopenArray[T]
09:46:48narimiranRTFM
09:47:40Zevvmratsim: why no more then 200bytes on the stack?
09:48:01FromGitter<mratsim> ugh, I think the shuffling in stdlib should be changed to something which distribute permutation evenly
09:48:19FromGitter<mratsim> @Zevv You have limited stack size, 2MB to 8MB on OS
09:48:30FromGitter<mratsim> depending on OS*
09:49:02ZevvYeah, but thats a few orders of magnitude away from 200 bytes?
09:49:06FromGitter<mratsim> also, moe low-level related but that creates a lot of noise on function entrance
09:49:52poopBotso whats then point of array if i should use seq to dump to heep
09:50:02FromGitter<mratsim> use ref array if it's fixed size
09:50:14poopBotnarimiran, am allreayd using shuffle
09:50:19FromGitter<mratsim> it depends on the byte size of your Card type
09:50:52FromGitter<mratsim> anyway, first, make your algorithm work
09:50:54poopBotCard has 1 int for suit and 1 int for rank
09:51:01FromGitter<mratsim> heap vs stack can bee done later
09:51:10poopBotwhat algoritam
09:51:28FromGitter<mratsim> Whatever you need for your program
09:51:52poopBotfor random? i allready done best hand processing in python just am now porting to nim
09:52:43poopBotin python i just used list for all now am just trying to be more like efficient :)
09:53:33FromGitter<mratsim> if it's always 52 in size use an array[52, Card]
09:53:50poopBotit is
09:56:38Araq"You can only pass globals or locations derived from globals to .noSideEffect procs"
09:57:43Araqyay, cannot use 'stdout' in a proc then :-)
09:58:05Araqoh wait ... that would still work
09:58:29poopBotduno if you asnwer to me or what cuz i lost you totaly xD
09:58:48*cyberjpn quit (Ping timeout: 245 seconds)
09:59:10Araqnever mind, thinking aloud
10:03:09poopBothmm 1 question, so when i create an object PokerTable, that has deck:deck52 (deck52 is array[5,Card]) and name = "dasda" so does variable deck in it go to stack and name goes to heep? i dident know that 1 object splits like that?
10:07:53ZevvIn general: atomic objects like objects and numbers go on the stack unless you ref them
10:08:12ZevvThe *contents* of containers like seqs and strings is managed by Nim and usually ends up in the heap
10:12:46*hoijui quit (Remote host closed the connection)
10:17:17FromGitter<mratsim> @poopBot, for reference: https://github.com/nim-lang/Nim/issues/11269
10:19:31FromGitter<kayabaNerve> We just need to build a computer where everything is on the stack. ez
10:20:19poopBotFromGitter <martsim> , ye i know this not real random, i can implement fishar yets myself i think i did that 1 time long ago in c#
10:20:56FromGitter<alehander42> btw araq, hownewruntime
10:21:05FromGitter<alehander42> deals with previous seq / string gc
10:21:32Araqprevious seq/gc?
10:21:35FromGitter<alehander42> e.g. if i decide to use nim on baremetal (kernel), with it, do i need to provide anything special?
10:22:03FromGitter<alehander42> i mean, now they dont need gc, so would they *just work* on almost-no-stdlib environment?
10:22:19Araqwith -d:useMalloc, yes
10:22:44FromGitter<alehander42> so they just need an allocator, and they would invoke its malloc/free
10:22:48poopBotZevv, i think i dont get this ref stuff, for me reference is a reference , like i have an object that i instated thats maped in memory, now a ref is just like a pointer to that object or am i getthing this wrong
10:22:58Araqalehander42: correct
10:23:06Zevvthat's all. A ref is a pointer
10:23:11FromGitter<alehander42> in this case, how much of the stdlib would i be able to actually use in a theoretical nimkernel ? all the newruntime-supported parts?
10:23:22FromGitter<alehander42> (with a simple allocator)
10:23:58Araqyeah. and with -d:nimQuirky exceptions you don't need exception support either
10:24:20*enthus1ast joined #nim
10:24:49FromGitter<alehander42> are they compatible with the current stdlib exceptions?
10:25:06Araqa bit, read my blog post :-)
10:25:17poopBotso if i want to make a ref to card object i have to create an type Card = object and if i just want to use ref to it i have to create a new type CardRef = ref object of type Card
10:25:25FromGitter<alehander42> yeah i wasnt sure if they have changed further after the post
10:25:36FromGitter<alehander42> but i forgot most of the post anyway, so might read it yeah
10:26:18narimiranpoopBot: you can directly have `type Card = ref object .......`
10:26:49Araqbut it's all based on silly folklore
10:26:50poopBotthats the issue thats confusing me how can i have a Ref object if i dident first have that Object istelf
10:27:16ZevvpoopBot: you must new() it
10:27:17Araqyou cannot use the C stdlib in kernel development, you cannot use e.g. glibc and nobody noticed
10:27:44Araqit's only always "Omg, I cannot use C++ in the kernel"
10:27:57Araqand then it's "omg D has a GC, cannot use it for kernels"
10:28:07FromGitter<alehander42> what is based on silly folklore
10:28:23FromGitter<alehander42> well yeah, but still, no gc makes some things a bit easier
10:28:57Araqlike what? you can have a GC in kernel mode, a GC needs an allocator and away to traverse the stack
10:29:13Araqlast time I checked Linux has a heap and a stack
10:29:23FromGitter<alehander42> yeah, but it's an additional thing to take into account
10:29:30ZevvAnd a GC - it is only used for detecting memory leaks, but it is basically a boehm
10:30:28FromGitter<alehander42> and if you develop very different primitives
10:30:42FromGitter<alehander42> e.g. different process model etc it might be harder to adapt the gc to the system
10:30:44*laaron quit (Remote host closed the connection)
10:30:47FromGitter<alehander42> but this is true for the stdlib as wel
10:31:16*laaron joined #nim
10:31:38Araqa GC might not be required or desirable but that applies equally well to the compiler I wrote
10:33:13Araqand anyway the common argument seems to be "I cannot use language X without its standard lib" and that is simply wrong and actually what is done for Linux kernel development in C
10:34:50Araqa variation of the argument is "ok, but then I might as well use C instead" which ignores language X's featureset completely. maybe at least X does distinguish between pointers and arrays ffs
10:35:41poopBotZevv, https://nim-by-example.github.io/oop/ hmm here it uses ref but i dont see anywhere a keyword new()
10:36:14FromGitter<kayabaNerve> I only just read the quirky exceptions article. I don't personally see the value, but I'd love a goto based exception system, if it offers higher speed. I throw Exceptions quite often 0_0
10:36:36Araqit doesn't offer higher speed than 'nim cpp'
10:37:17FromGitter<kayabaNerve> I use `nim cpp` for lib interop and zero-cost exceptions. That said, zero-cost exceptions are only zero-cost when not thrown.
10:37:21ZevvpoopBot: The Dog() and Cat() are the constructors, which do the new. See https://nim-lang.github.io/Nim/manual.html#types-object-construction
10:38:14FromGitter<kayabaNerve> So I guess it depends on the cost when an exception is thrown and how often Exceptions are raised. If you're saying the cost of raising an exception isn't faster than `nim cpp`, I'll be very happy to hear that.
10:38:19AraqkayabaNerve: then you seem to misuse exceptions :-)
10:39:28FromGitter<kayabaNerve> I don't like option based return values and deal with a network designed to resist invalid data and attacks.
10:39:53*Vladar quit (Read error: Connection reset by peer)
10:40:31Araqwell then patch the compiler to give us 'goto' based exceptions, I don't mind
10:40:44FromGitter<kayabaNerve> I have a ton of error cases and they're frequent. The only question is if I use Exceptions or Options.
10:41:08FromGitter<kayabaNerve> I did actually debate using Options + Enums. I just felt it like it was a lot of work for not enough gain.
10:41:23FromGitter<kayabaNerve> I might when I have the time ;p
10:41:39*Vladar joined #nim
10:47:33FromGitter<mratsim> @kayabaNerve did you check nim-result?
10:53:21*Vladar quit (Ping timeout: 268 seconds)
10:57:25*lritter joined #nim
11:01:22*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
11:02:48*Vladar joined #nim
11:03:30*laaron joined #nim
11:06:26FromGitter<kayabaNerve> Arne pitched it to me at one point
11:07:49FromGitter<kayabaNerve> I'm not a fan
11:08:56clyybberlritter: Hey there, I'm still waiting on your explanation of viewpropagation/borrow checking ;P
11:09:22Araqoh?
11:09:28AraqI missed that discussion
11:09:42Araqcan you give me a summary?
11:11:01clyybberAraq: lritter is the dev of scopes [https://bitbucket.org/duangle/scopes/wiki/Home] which uses some viewpropagation/annotation free borrow checking variant to manage resources
11:11:42clyybberthe documentation and the compiler isn't finished, though, so there isn't a description of what that actually is yet.
11:12:52AraqI see
11:13:01clyybberhttps://irclogs.nim-lang.org/07-05-2019.html#07:51:03 theres the IRC log
11:16:55Araqok, I don't understand it
11:19:14clyybberAraq: I hate to keep bothering you about it, but "var a = @[2, 2]" should be transformed to "var a; tmp = @[2, 2]; `=move(a, tmp)`" right?
11:20:13Araqright, @[2, 2] is not different from f()
11:20:25Araqf() produces a value and so does @[2, 2]
11:20:41Araqthat said, you might need to fix the codegen so that constants are never mutated
11:20:50clyybberyep, it ends up in nkBracket branch of the case statement in moveOrCopy
11:21:12Araqso far so good?
11:21:21clyybberAraq: Yeah, seems to work. The segfault is gone
11:22:13Araqbtw hurry up we want to have a stable --newruntime for 0.20 but we don't work on it
11:22:20AraqXD
11:25:04clyybberAraq: haha, I'm trying, but I'm doing this in tandem with my exams :p
11:25:21clyybberBtw wdym with "Well we don't anymore 'nil' y out, but we should" ? Should I just change the comment?
11:33:40*laaron quit (Remote host closed the connection)
11:35:15*laaron joined #nim
11:35:34*stefanos82 quit (Remote host closed the connection)
11:38:22*laaron quit (Remote host closed the connection)
11:40:54*laaron joined #nim
11:41:19*enthus1ast quit (Ping timeout: 256 seconds)
11:43:25lritter<clyybber> lritter: Hey there, I'm still waiting on your explanation of viewpropagation/borrow checking ;P
11:44:17lritterclyybber, sorry, lots to do. past week i had to take care of my dad in law, the time before i worked on "Scopes for C/C++ Users"
11:44:55lritter( https://scopes.readthedocs.io/en/latest/cpp_users.html )
11:48:38clyybberlritter: Np, :)
11:48:40lritterclyybber, fundamentally, borrow checking in scopes annotates types with two new qualifiers: the unique qualifier `N:` where N is a function local integer, and the view qualifier `%N|...:` where N is one or multiple unique integers. uniques are equivalent to regular values in rust, views are equivalent to borrowed references, except here they're not pointers.
11:49:16lritterthe rest is just about moving uniques through functions and doing bookkeeping with views
11:49:47lrittereach single unique has its own lifetime, that's a bit different from rust. you could say the N: is its lifetime symbol.
11:50:27lritterother than rust, we autogenerate function signatures based on how uniques are used in the function; i.e. if a unique parameter is never moved into a function, the signature converts it to a view parameter
11:52:28poopBotnarimiran, is there a refractor for Nim or should i just use neovim mass rename?
11:52:53lritterwe don't have any mutation exclusivity (yet); i'm planning to handle that a bit differently from rust too. we're going to track mutation events rather than references which are mutable.
11:53:42lritterclyybber, oh, and i came up with a generalization for compile time state tracking, called "sidebands" https://gist.github.com/paniq/8c39baea49692dcda34b7f031eeaddfe
11:53:52lrittermight also be interesting for nim
11:56:39clyybberlritter: Yeah, that looks really interesting.
11:57:29lritteri eventually want to move all qualifiers through on separate channels, and allow users to add their own. aside from existing use cases, a user suggested tracking e.g. GL context use
11:58:12clyybberat the first glance it sounds a bit like a proof system, based on a CFG
11:58:53lritteri don't have any formal training.
11:58:56*laaron quit (Remote host closed the connection)
11:59:00FromGitter<alehander42> so is it basically
11:59:14FromGitter<alehander42> a generalized notion of type/effect system?
11:59:26FromGitter<alehander42> a way to be able to track many things in a similar way as types
11:59:29lritteryeah.
11:59:41lritterafter i finished the borrow checker i realized many problems could be treated that way
12:00:18lritteryou can easily answer the question "can i track this state at compile time" by answering the question "how can i merge this state across branches?"
12:00:24FromGitter<alehander42> i see, and do the alternative qualifiers interact in any way
12:00:38lrittermost of the time they don't, but they could.
12:01:10lritteri currently handle keyed arguments, references and uniques/views as qualifiers
12:01:10FromGitter<alehander42> yeah, makes sense, i've noticed that nim's dataflow mechanism seems also often being ok for several types of checking
12:01:27FromGitter<alehander42> but e.g. a function has basically a different signature in each "system"
12:01:39FromGitter<alehander42> so a call has to satisfy all "systems" , right
12:01:45lritteri want to preserve doing it all in a single forward checking pass
12:01:55lritterso when the function gets a signature, it gets all signatures.
12:02:18FromGitter<alehander42> hmm and can the qualifiers support genericness too
12:02:25lritterin what way?
12:02:40FromGitter<alehander42> e.g. there are classes of things that you want to track
12:02:45lritter <alehander42> but e.g. a function has basically a different signature in each "system"
12:02:47lritteryes, btw.
12:03:06*laaron joined #nim
12:03:12FromGitter<alehander42> hm another question
12:03:13lritter<alehander42> e.g. there are classes of things that you want to track
12:03:22FromGitter<alehander42> does this support overloading based on quallifiers
12:03:32lritteri want to stick to kiss until i really need that kind of stuff.
12:03:39lritterintuitively i would say it could be added.
12:03:55FromGitter<alehander42> yeah, makes perfect sense, just trying to imagine how it works for the user
12:04:07FromGitter<alehander42> and is it easily pluggable
12:04:20FromGitter<alehander42> e.g. i can configure my project to use only this "config" of sidebands
12:04:37lritteralehander42, i have a bunch of open questions myself regarding the user API; esp reg data model
12:04:38FromGitter<alehander42> are all sidebands optional in a way
12:04:54lrittereach system is probably going to get a slot via symbolic token
12:05:45lritteror qualifier supertypes. dunno.
12:06:37lritter<alehander42> are all sidebands optional in a way
12:07:10lritteralehander42: see last paragraph. it's inavoidable that sidebands get added after many functions have already been typed, so each sideband needs to be able to handle the default i.e. absent case.
12:07:23lrittera missing qualifier must not be an error.
12:07:46lritterand as a further complication, local state looks different from signature state
12:08:14lritteri.e. we give a local id to each unique within a function, but for the signature, we want to canonicalize all parameters and return types so we can memoize function signatures.
12:10:27lritterso that means two parts the user must perform to add his channel: canonicalize qualifiers for the signature, and map canonicalized qualifiers back to a call instruction.
12:10:28lritterwell, three. signature fixing, mapping arguments to a call, and mapping the results.
12:14:43FromGitter<alehander42> yeah, sounds reasonable but stil have to play with it: sounds very interesting, i have to work but i ll probably ask some questions tomororrow!
12:16:19*skrylar[m] joined #nim
12:16:30skrylar[m]hiyo
12:18:47skrylar[m]Araq: to be fair in D1 you could use it for kernels, kind of. i think there was a warning that strings always assumed there was a GC, but the GC was really optional. A combination of D2's "phobos is so broken without the GC that we're going to just make the GC mandatory" and "the website spec is now invalid because we're selling a book" were why I dumped D :/ (and, it would appear that was wise as within a few months a large
12:18:47skrylar[m]amount of their early users left, and D seems to be fairly dead as of now)
12:19:45clyybberHey skrylar, you are the dev of the VCVRack Jack integration plugin right?
12:20:01skrylar[m]i am that skrylar
12:21:08clyybbercool to see you here
12:21:21skrylar[m]i was actually here before i was there, for quite some time :3
12:21:26*rnrwashere joined #nim
12:21:34clyybberoh, that must be before my time :p
12:21:43skrylar[m]maybe
12:23:07skrylar[m]i wandered off when it sounded like exceptions were getting nuked, although that appears not to have happened
12:23:20skrylar[m]have to see how much of my nimble stuff still works
12:25:31*rnrwashere quit (Ping timeout: 248 seconds)
12:28:24skrylar[m]mostly peeked in to ask 1) why are multimethods going behind a compiler option? 2) are `concepts` still what we're supposed to use to replace interfaces and 3) what do people think of the VCL/LCL? i know araq was a delphi-er back in the day, and i've been prodding around with lazarus/fpc for a bit; VCL seems a.. lot more straightforward than qt/wx/etc
12:31:09*floppydh quit (Quit: WeeChat 2.4)
12:31:51skrylar[m](although i suppose i could look at the old BeOS APIs too, since according to wikipedia the design for those was formally released under CC?)
12:32:04Calinouisn't VCL the toolkit used by LibreOffice?
12:33:25skrylar[m]different vcl
12:33:28*livcd quit (Quit: Lost terminal)
12:34:02*livcd joined #nim
12:37:32leorizeskrylar[m]: BeOS APIs live on in Haiku under the MIT license :)
12:37:51skrylar[m]yus, though i was just looking at architecture
12:39:20*livcd quit (Read error: Connection reset by peer)
12:39:25skrylar[m]reading over the be book on their site and the api seems remarkably clean
12:40:12*sealmove joined #nim
12:41:38*beatmox quit (Remote host closed the connection)
12:41:46Araqhi skrylar[m], welcome back
12:41:56AraqI didn't mean to pick on D, quite the contrary
12:42:44Araqmy point was that for C programmers only C counts and they then give us these bullshit "reason" for why they don't want to consider anything else
12:43:57Araqby their own reasoning C cannot be used for kernel development...
12:46:20*Snircle joined #nim
12:48:10*theelous3 joined #nim
12:50:45poopBothmm isent linux kernel done in some kind of C ?
12:51:09Araqsure it is, that's my point
12:52:09poopBotoh you meant cuz it not 100% pure C or something like that, i know i read long ago stuff when was trying to make my huion tablet work
12:52:45sealmoveit is pure C, pretty much
12:53:12Araqit's C without its stdlib ;-)
12:53:39Araqand when you use Nim for kernel development, it could be Nim without its stdlib
12:54:13Araqor D without its stdlib for that matter
12:54:50Araqor C+
12:54:56Araq+ without its STL
12:55:03poopBotyep i know it head some difrence jsut frogot what :)
12:55:32poopBottype mismatch: got <seq[Card]> but expected 'hand5 = array[0..4, Card]'
12:56:05poopBotam trying to var hand5 = seqofcards[0..4]
12:56:06skrylar[m]D2's gc is engrained in to everything now though IIRC
12:56:30clyybberAraq: Should "var a: ref something = nil" also introduce a temporary?
12:56:51poopBottrying to dump form array to seq, duno why i am even using array anymore xD
12:56:59*kapilp quit (Quit: Connection closed for inactivity)
12:57:01poopBot*from seq to array
12:57:03Araqcan you pass 'nil' by var? no you can't, so it needs a temp, clyybber
12:57:24clyybberOk, I figured that, so we always move, never copy. got that :)
12:58:06Araqskrylar[m], maybe but a GC can run in kernel mode anyway, there is no magic, you walk the stack quite like you walk it in userland
12:58:40Araqit worked for Oberon.
12:58:58sealmoveOberon the OS?
13:06:46Araqyes
13:09:24*nsf quit (Quit: WeeChat 2.4)
13:10:10skrylar[m]i don't plan to write any kernels any time soon, so i dun care :b
13:10:52skrylar[m]i read over the design docs for shenandoah when i was thinking about smalltalk/lisp stuff
13:12:39FromGitter<alehander42> yeah
13:12:49FromGitter<alehander42> i also dont care too much for the stdlib if i write a toy kernel
13:14:59*ng0 joined #nim
13:15:48FromGitter<alehander42> but it's still good to be able to use some parts
13:16:05FromGitter<alehander42> e.g. some collection abstractions
13:16:10FromGitter<alehander42> string algos etc
13:16:15FromGitter<alehander42> it doesnt make much sense to reinvent them
13:16:17*ng0 quit (Client Quit)
13:16:51FromGitter<alehander42> iterators
13:18:50FromGitter<alehander42> of course, i have no idea how to separate userland currently, i literally imagine a big event loop running all my programs in the kernel
13:19:04FromGitter<alehander42> context-switching task loop
13:25:30ZevvJust as in any os - you context switch by interrupting a process, saving the CPU state, restoring the CPU state of the other task and resume
13:25:38Zevvno reason that can not be done with Nim
13:26:06FromGitter<alehander42> yes, that would be my plan probably as well if i write a kern
13:26:08FromGitter<alehander42> el
13:26:10Zevvwell, not in 100% nim
13:26:40FromGitter<alehander42> i meant i am not entirely sure how to model userland as a separate layer
13:27:01FromGitter<alehander42> but this is just because i need to read some more osdev
13:27:04FromGitter<alehander42> kinda offtopic
13:27:08FromGitter<alehander42> not related to nim
13:28:04ZevvI tried a bare metal bootup of some arm Cortex in 100% nim though, not a single line of C or assembly required
13:28:28FromGitter<alehander42> hm nice, how do you get it to call your kmain
13:29:42poopBotso nim dosent have like python seq[-1] to acces last in list and -2 to acces 1 before right?
13:30:02FromGitter<alehander42> seq[^1]
13:32:07Zevvalehander42: ARM soc bootup is usually pretty simple. Linker script makes sure there's a sane stack pointer and start address in the vector table, at bootup you just jump into your code. zero the heap and off you go
13:37:18poopBotty
13:38:10FromGitter<alehander42> thanks
13:39:24*NimBot joined #nim
13:40:45skrylar[m]Araq: speaking of, did you have any thoughts on the list i posted? (re: multimethods, interface/concept, and VCL?)
13:54:40Araqmultimethods don't work well with generics and are a feature expensive to maintain
13:55:20AraqI've never written a single program that actually uses them, when I need dynamic dispatch I use closures heavily
13:55:55Araqthey also cover "interfaces" satisfactorily
13:56:14Araqconcepts should be redesigned, I'm working on an RFC
13:56:43FromGitter<liquid600pgm> what's wrong with the current design of concepts?
13:56:58FromGitter<liquid600pgm> the only thing that's bad imo is poor implementation
13:57:19Araqthe "poor implementation" went through at least 3 iterations
13:57:50FromGitter<liquid600pgm> so you're saying they're too hard to implement in their current form?
13:58:00FromGitter<liquid600pgm> implement well*, that is
13:58:29AraqVCL is pretty nice but event handlers benefit from closures which Delphi lacks/lacked
13:58:38Araqand it uses inheritance heavily
13:59:01Araqbut for UIs I never found anything more productive
13:59:16Araqsadly most of the world moved on to the web and SPAs
13:59:38skrylar[m]i seem to be one of those weird hold-outs doing native code 🤕
14:01:24Araqliquid600pgm: maybe not "too hard" but definitely too much work when you are also developing the PL with the best macro system and novel ways of doing memory management
14:01:33skrylar[m]i was looking through the vcl docs and saw it has a bit of interface use, and i think we don't have those? i also saw multimethods were being gated in the docs
14:01:58Araqas I said, an interface is just a tuple of closures and we do have those
14:02:01FromGitter<liquid600pgm> Araq: makes sense, thank you for the answer
14:02:38Araqskrylar[m], also, native UI or not, I personally want immediate mode UIs
14:03:00Araqthe UI should just be a function of the state that I keep elsewhere
14:03:10Araqgotta go, bbl
14:19:10*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:20:01*laaron joined #nim
14:20:35*solitudesf joined #nim
14:20:59poopBothow to get difrence betwin sequences, i tryed like for i in seq1: seq2.del(i)
14:21:18FromGitter<alehander42> that requires a diff runtime tho, which is a bit like gc-s and memory imo
14:21:33FromGitter<alehander42> it relieves you from syncing stuff and forgetting leaking "old state"
14:21:41FromGitter<alehander42> but it has overhead/issues
14:22:30FromGitter<jrfondren> poopBot, you can do it in O(n^2) with a loop and `in`. You could use sets instead if this is a frequent desire. Or you can use sets as well.
14:24:35ZevvpoopBot: If a set suits your data, it is as simple as A-B
14:25:27Araqalehander42: the diff runtime is only required because of the stateful DOM, it's an abstraction inversion
14:25:53Araqin a real immediate mode UI there is no diffing, you simply draw rectangles into a buffer
14:26:53poopBotits just 7 element 4 max so i wanted a loop but duno wats wrong with my
14:28:28shashlickHowdy
14:28:30FromGitter<jrfondren> well paste your code. there's nothing wrong in principle.
14:30:43*revere quit (Ping timeout: 250 seconds)
14:31:03poopBothttps://hastebin.com/zelefanape.php
14:32:49FromGitter<alehander42> Araq, ive read that immediate libs are harder to write tho, but maybe you're write
14:32:52FromGitter<alehander42> not much xp in this
14:33:23FromGitter<jrfondren> poopBot, what don't you like about that code?
14:33:52FromGitter<jrfondren> ahh it blatantly has a 1 in the end.
14:34:26poopBotyep tought this i run as just an example test my really code has objects but shoudl be same
14:34:27FromGitter<kayabaNerve> House
14:34:40FromGitter<jrfondren> poopBot, del() deletes by index, not value
14:34:42FromGitter<kayabaNerve> *You're not deleting the element. You're deleting the index.
14:35:14FromGitter<kayabaNerve> Sorry. Gitter mobile sends messages prematurely sometimes. Co that with Swype...
14:35:22FromGitter<kayabaNerve> *combine
14:35:23poopBotyep i figured out that too by reading docs but how to delete value do i do a sub loop where i==y
14:35:57FromGitter<jrfondren> you could do that yeah.
14:36:28FromGitter<alehander42> @kayabaNerve oh yeah i write a lot of those
14:36:36FromGitter<jrfondren> poopBot, try using sequtils.filter instead
14:36:51FromGitter<alehander42> autocorrect is like "whatever man you want to write HOUSE"
14:36:59FromGitter<jrfondren> you can filter based on `it in fdeck`
14:37:39poopBotok will check
14:40:37*revere joined #nim
14:41:14*rnrwashere joined #nim
14:42:13*tdc joined #nim
14:42:14*ng0 joined #nim
14:42:18*krux02 quit (Remote host closed the connection)
15:03:53skrylar[m]leorize: these seem clean and fairly easily nim-ized so far (Be APIs) but i'm still just reading the app kit
15:11:16*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
15:12:00*laaron joined #nim
15:15:08poopBothmm var test:bool = 1 in 0..4 how to write 1 not in 0..4, i tryed 1 not it but it wont compile, if i append not before not 1 in 0..4 it gives false even if i not 1 in 2..4
15:16:28FromGitter<jrfondren> notin
15:16:44*rnrwashere quit (Remote host closed the connection)
15:19:01FromGitter<jrfondren> asking again, can anyone improve on this? https://gist.github.com/jrfondren/e9d60761ce727acabc6256ebd22e6115
15:19:25*rnrwashere joined #nim
15:19:28skrylar[m]the off topic room isn't accessible from matrix 😅
15:20:43skrylar[m]jrfondren: this bit manipulation voodoo makes it hard to tell what this function is supposed to do, but it seems fine?
15:20:47*JustASlacker joined #nim
15:21:38FromGitter<jrfondren> sure, I'd prefer a case over a tuple of bools to this.
15:22:17leorizeskrylar[m]: login with NickServ and you can access it
15:22:41FromGitter<jrfondren> maybe the best way is to do the conditional logic in SQL.
15:25:06skrylar[m]probably not, because your data server is harder to scale
15:25:48FromGitter<jrfondren> eh this is an app that might have all of five people looking at it at the same time, ever.
15:26:03skrylar[m]then it really doesn't matter what you do :blobcoffee:
15:26:24FromGitter<jrfondren> craftsmanship is craftsmanship.
15:27:00*rokups joined #nim
15:27:56FromGitter<jrfondren> I'm not looking forward to having to double the sql"" in my code if a fourth boolean comes up.
15:28:35skrylar[m]so this is a query builder
15:29:57skrylar[m]in that case the crafty thing to do is build up a mini-AST and generate SQL from it. the dumpy way is to just use a string builder (you're not accepting user input, so there's no injection here)
15:31:11skrylar[m](or well, i don't know how your sql toolkit handles the parameters here; the ones i used back in the day you supplied those in separate calls)
15:32:58FromGitter<jrfondren> config.filter's user input, and this is just db_sqlite, but alright.
15:33:32skrylar[m]you usually dont have to filter input if you are using parameters
15:33:49skrylar[m]they get shipped in special containers so the db knows this isn't little johnny tables :)
15:34:19FromGitter<jrfondren> yeah I know. config.filter isn't filtered. It's a user-provided filter.
15:34:22skrylar[m]ah sqlite. so stored procedures aren't reaaaaly a thing
15:44:10*JustASlacker quit (Ping timeout: 246 seconds)
15:44:49*JustASlacker joined #nim
15:49:36WilhelmVonWeinercan you declare a variable to hold any given proc?
15:50:35FromGitter<jrfondren> same answer to "can you declare a variable to hold any given value?", it's got to be typed.
15:51:00WilhelmVonWeinerhm, okay.
15:55:26skrylar[m]pointers can point to anything, but then you're in to black magic territory
15:55:46*Perkol joined #nim
15:55:59WilhelmVonWeinerI would prefer to avoid that
15:56:45skrylar[m]what is your use case?
15:57:18WilhelmVonWeinerwriting a dispatch table for a simulator
15:57:36WilhelmVonWeinerso you just index into the array and call instructions[n]()
15:58:23FromGitter<mratsim> @WilhelmVonWeiner, be sure to look at this: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources#nim-implementation-benchmark
15:59:02WilhelmVonWeinerwell, it's not an optimisation thing
15:59:21WilhelmVonWeinerI just think case statements are big and ugly and harder to read
15:59:30FromGitter<mratsim> It will show you all the way to implement dispatch
16:00:03FromGitter<jrfondren> go down to InstrF and `funcTable`. it's an example.
16:00:04FromGitter<mratsim> That is not true in Nim
16:00:15WilhelmVonWeineroh, I see, thanks
16:01:10FromGitter<mratsim> This is dispatch via switch/computed goto (though it needs a bit of macro magic to build the case statement): https://github.com/status-im/nimbus/blob/master/nimbus/vm/interpreter_dispatch.nim#L24-L36
16:01:16FromGitter<mratsim> dispatched*
16:01:19skrylar[m]you can make a type for a particular function (your opcode handler), and then have an array of those
16:01:37skrylar[m](this is less efficient than static dispatching, but some people like them :shrug:)
16:04:12*laaron quit (Remote host closed the connection)
16:04:27skrylar[m]`Although designed with games in mind, nothing in the Game Kit is restricted to game applications, except that the user will have to deposit another 50 cents every three minutes.` *snerks*
16:04:32poopBot if samesuits.len() >= 5: and if i dont whitespace if samesuits.len() >=5: it gives error dident know i have to have space bewin >= and number
16:05:41*laaron joined #nim
16:06:30FromGitter<jrfondren> with the unbalanced spacing, it thinks you want a prefix >=
16:06:59FromGitter<jrfondren> one thing that's really obvious about Nim is that whitespace matters, so :)
16:07:38FromGitter<jrfondren> tuples are also surprising. compare `echo(1, 2)` and `echo (1, 2)`
16:07:56FromGitter<jrfondren> this just needs to be in a CAVEATS page.
16:08:35FromGitter<jrfondren> and it really is the unbalanced spacing that matters, as samesuits.len()>=5 is fine.
16:09:03poopBotgood to know
16:10:55*Perkol quit (Remote host closed the connection)
16:11:51poopBothow to remove doubles form seq , should i filter it or duno meybe convert it to set and back :)
16:12:34*sacredfrog quit (Quit: ZNC 1.7.3 - https://znc.in)
16:12:56poopBotlol there is deduplacate
16:13:02poopBoti am blind 200%
16:13:08FromGitter<jrfondren> you can loop over it once, populating a new seq if `x notin newseq`. or add a set/table for the more efficient `contains`
16:13:35poopBothttps://nim-lang.org/docs/sequtils.html#deduplicate%2CopenArray%5BT%5D so :)
16:13:40*sacredfrog joined #nim
16:15:09poopBotoh, deuplicate cant hlep cuz i only want to compere propetis not whole object, guess manual it is :(
16:15:27*sacredfrog quit (Client Quit)
16:22:07*rnrwashere quit (Remote host closed the connection)
16:22:25*rnrwashere joined #nim
16:24:55*sacredfrog joined #nim
16:26:12*rnrwashere quit (Remote host closed the connection)
16:27:46*rnrwashere joined #nim
16:30:24skrylar[m]well the game and device kit also aren't too class/interface heavy which is good
16:34:23skrylar[m]i wonder what performance considerations exist when every event in a gui is stored in hash tables like this
16:36:19sealmoveare threads in threadpool OS threads or pseudo-threads?
16:36:26FromGitter<mratsim> OS threads
16:36:52sealmovethx
16:37:38*Trustable joined #nim
16:42:30*banc quit (Ping timeout: 246 seconds)
16:46:48*banc joined #nim
16:59:03skrylar[m]another +1 from reading the Be docs; it seems to be one of the only GUI systems where the entire gui is multithreaded
16:59:23skrylar[m]each window supports one instead of "one master ui thread"
17:01:27*al_ joined #nim
17:01:38*natrys joined #nim
17:02:00shashlickdoes nimble do a `--noNimblePath` by default?
17:07:49*al_ quit (Quit: al_)
17:08:07*al_ joined #nim
17:09:01leorizeshashlick: yea
17:10:39shashlicki see it in the code and it is failing test on nimedlib just published
17:11:30shashlicksame src directory issue - nimedlib.nim is in the src directory and gets copied to root since srcDir="src" in the nimble file
17:11:54shashlickbut nimble test doesn't work with either nimble install or nimble develop since nimble doesn't add nimedlib to the --path
17:12:16shashlickit adds --path:. but cloned directory has a src dir and not nimedlib.nim right there in the root
17:23:17*Vladar quit (Remote host closed the connection)
17:28:10*al_ quit (Quit: al_)
17:28:30*al_ joined #nim
18:05:05*stefanos82 joined #nim
18:06:37*nsf joined #nim
18:06:42*rokups quit (Quit: Connection closed for inactivity)
18:12:36*Perkol joined #nim
18:27:40sealmovewhat's the difference between lists and deques?
18:28:09sealmoveis it more or less the same thing but with different implementation?
18:28:54shashlickdeque is built on top of seq
18:28:59shashlickbut more queue like
18:30:03sealmovewhen should I use the one and when the other?
18:30:59narimiransealmove: use deques when you want to add/remove stuff from the front
18:31:20narimiranaka FIFO stuff
18:34:50sealmoveBut lists also have procs like prepend :S I really don't get the difference. It seems to me that only the implementation differs.
18:36:07FromGitter<jrfondren> list append is O(N)
18:37:02sealmovehttps://nim-lang.github.io/Nim/lists.html#append%2CSinglyLinkedList%5BT%5D%2CSinglyLinkedNode%5BT%5D
18:37:04sealmovenope
18:37:22sealmoveboth append and prepend are O(1)
18:37:54FromDiscord<DeltaPHC> Lists (linked lists) aren't as cache efficient because the elements may not be contiguous in memory
18:37:54FromGitter<jrfondren> well it's bloody cheating, isn't it?
18:38:15sealmovejrfondren: maybe what you say is true for deques actually
18:38:32*Perkol quit (Remote host closed the connection)
18:38:39FromGitter<jrfondren> no, the whole point of deques is to get fast access to both ends
18:38:40sealmovemaybe it's that vs cache efficiency as DeltaPHC points out
18:38:50sealmovehmm
18:38:55sealmovefast access yes
18:38:56FromDiscord<DeltaPHC> Deques, the way it's implemented in Nim at least, are backed by seq, which means contiguous storage
18:39:00sealmovebut remove/add?
18:39:25FromGitter<jrfondren> just look at the source. It's all Nim.
18:39:53sealmovesure, I'll take a look later
18:40:00FromGitter<jrfondren> "A double-ended queue backed with a ringed seq buffer."
18:40:57sealmovethen I don't see the point of lists...
18:42:00FromDiscord<DeltaPHC> Most of the time a linked list is not what you want, unless your algorithm *logically* maps to a bunch of nodes that are linked to each other, that can change how they're linked
18:42:52FromGitter<jrfondren> a list can be cheaply made into a circular list, and then you can do thing like "advance 21 steps, then O(1) remove the step you're on"
18:43:13FromGitter<jrfondren> so lists are useful for Advent of Code problems.
18:43:23FromGitter<jrfondren> for everything else, they're not great.
18:43:41sealmove"change how they are linked" means weird transformations?
18:45:00sealmovehmm I guess deques don't have a "next" proc
18:45:00Zevvhaving a 1M element seq might cause a realloc & a large memcpy when adding a single element, while adding to a linked list is more predictable
18:46:07FromDiscord<DeltaPHC> It depends on your access patterns. If you're going to iterate through most/all of the nodes, the cost of jumping around in memory might not be worth it, esp. if you don't actually change links much
18:46:16sealmoveI get the implementation concerns, was mostly wondering if they *logically* the same, but it seems the lack of a "next" proc is crucial.
18:48:56FromDiscord<DeltaPHC> If you're going to iterate through all nodes very often, a regular array/seq will always be faster in that regard
18:49:12sealmoveyes, access pattern seems to be the distinguishing feature
18:49:30Zevvlike with all different container types and algorithms
18:50:02sealmovewell I'm still studying :3
18:50:14Zevvyou never stop
18:50:57ZevvI like how there's still these essential basic algos popping up when everyone seems to think all has been thought of by dijkstra
18:51:33Zevvskip lists, bloom filters, pretty recent
18:51:41*rnrwashere quit (Remote host closed the connection)
18:51:52sealmovemaybe hardware keeping changing is one reason
18:52:31Zevvvery true. The magnitudes of difference in access times between cache and main memory make for very different algorithms
18:52:37sealmove(not sure what you had in mind, if irrelevant ignore my last comment)
18:52:50ZevvYou might as well use 5 times more instructions and still be 10 times faster
18:52:58Zevvsealmove: very relevant actually, imho
18:53:01FromDiscord<DeltaPHC> That often happens with SIMD
18:53:42skrylar[m]bloom filters might be prevalent because things have also gotten a bit more .. big
18:53:47FromDiscord<DeltaPHC> A compiler might vectorize and/or unroll a loop, and it looks like more instructions, but it ends up being a lot faster
18:54:28*rnrwashere joined #nim
18:55:01Zevvfor example https://lemire.me/blog/2019/04/27/speeding-up-a-random-access-function/
18:55:29Zevv"So while the buffered version I coded uses three times as many instructions, and while it needs to allocate a large buffer, it still comes up on top."
18:58:44*Jesin quit (Quit: Leaving)
19:06:38*Jesin joined #nim
19:07:00*Trustable quit (Remote host closed the connection)
19:08:20*sz0 quit (Quit: Connection closed for inactivity)
19:18:23*rnrwashere quit (Remote host closed the connection)
19:20:25ZevvHow do I properly sort ["e", "a", "é", "f"] to ["a", "e", "é", "f"]
19:22:58FromGitter<jrfondren> hmm you could sort them as unidecoded
19:24:02FromGitter<jrfondren> or sort them as seq[Rune] and use unicode.<%
19:24:05Zevvthat's lossy, or I have to store everything twice
19:24:28FromGitter<jrfondren> or you could do a Shwartzian transform
19:25:14Zevvhm ok, lots of tricks, but there's no default way to do that - sorting UTF-8 strings with proper unicode ordering
19:25:15FromGitter<jrfondren> sort [("e", "e"), ("a", "a"), ("é", "e"), ("f", "f")] by `a[1] < b[1]`
19:25:45skrylar[m]oh boy, unicode
19:25:49skrylar[m]sorting that is all kinds of "fun"
19:25:51FromGitter<jrfondren> ah wait there is
19:25:58FromGitter<jrfondren> https://nim-lang.github.io/Nim/unicode.html#cmpRunesIgnoreCase%2Cstring%2Cstring
19:26:06narimiranjrfondren why not have tuples the other way around, and you just sort them `a < b`?
19:26:30narimiranso é is before f, but after e
19:26:35Zevvskrylar[m]: it seems Nim has all the parts on board, but misses a simple wat to use it
19:26:53skrylar[m]sorting unicode is not entirely simple
19:27:31skrylar[m]for example is `small a with umlaut` the same sort order of `small a` followed by `umlaut combining diacritic`
19:27:35FromGitter<jrfondren> @Zevv, unicode.cmpRunesIgnoreCase
19:28:09*rnrwashere joined #nim
19:28:19Zevvjrfondren: yes, I found that. But how would I use that without makeing a copy of all my utf8 strings into seq[rune] and sorting that
19:28:24FromGitter<jrfondren> @narimiran ehh, I wouldn't want to do a lot of extra work just to save on precision
19:28:39FromGitter<jrfondren> cmpRunesIgnoreCase works on strings.
19:28:48Zevvoh does it, let me check!
19:29:18skrylar[m]doesn't nim define runes as like, unicode code points
19:29:30FromGitter<jrfondren> yeah it does
19:29:39narimiranbut how do you sort first two items of [("e", "e"), ("é", "e"), ("f", "f")] if you just compare the second element of a tuple?
19:30:13skrylar[m]yea thats.. gonna have edge case issues then
19:30:28Zevvjrfondren: http://p.zevv.nl/?d072
19:30:39skrylar[m]maybe not if you normalize the keys
19:30:40FromGitter<jrfondren> it'd be a lot more expensive if it were normalising
19:31:24narimiranwith [("e", "e"), ("e", "é"), ("f", "f")] (unicode is second) and comparing `a < b` it first compares a[0] and b[0], and if they're the same, then a[1] and b[1]
19:31:54skrylar[m]if i were being ultimately silly i would say each normalization form would be a distinct string and you could only get unicode strings by importing from one of those, but that wouldn't be compatible with anyones apis
19:32:25FromGitter<jrfondren> @Zevv, oh. well, 233 is greater than 102
19:33:08FromGitter<jrfondren> @narimiran, the tuple is constructed from the unidecode of the other string
19:33:25FromGitter<jrfondren> and how you'd sort "e" vs. "e" is -- randomly, depending on whether the sort is stable.
19:33:36*al_ quit (Quit: al_)
19:34:20narimiran("e", "e") < ("é", "e") > ("f", "f"); vs ("e", "e") < ("e", "é") < ("f", "f")
19:34:32ZevvBut "é" comes before "f", right?
19:34:55FromGitter<jrfondren> 233 doesn't come before 102
19:35:11Zevvof course
19:35:15FromGitter<jrfondren> to sort 233 before 102 you'd need a collation and locale library
19:36:41ZevvI assumed the tables in unicode.nim contained those, but on closer inspection I see it's only upper/lower and classes
19:36:45Zevvthat explains
19:37:31FromGitter<jrfondren> https://github.com/jtauber/pyuca this sort of thing.
19:37:41ZevvI'll pipe trough unix sort then :/
19:38:52shashlickhow many of you program in Windows
19:39:43FromGitter<zacharycarter> I do
19:41:51Zevvnarimiran: what's the miran-unicode branch doing?
19:42:25narimiranZevv: isn't that deleted?
19:42:32shashlick@zacharycarter: how's it going 🙂
19:42:44shashlickam looking for some alpha testers for my text editor feud
19:43:02Zevvnarimiran: oh I still have it locally, not sure if it still lives on github
19:43:13FromGitter<zacharycarter> shashlick: good thanks! Finland is pretty cool!
19:43:37shashlickmore chill than the UofA hopefully
19:44:37narimiranZevv: haha, my biggest fan :P i'm not sure what exactly was that one about, it is probably about updating unicode.nim to unicode v12
19:44:49FromGitter<zacharycarter> It's different for sure - people seem a bit less crazy / random than they do in the US
19:45:16FromGitter<zacharycarter> also it's nice to be away from the constant political bickering that goes on at home
19:45:43shashlickjust made me proud - started feud on nim - opened *.nim - 2419 files
19:45:56Zevvnarimiran: I know only the basics about unicode, but I feel it would be a good thing to have solid support in the language to avoid pythonesque drama. Do you have insight in this stuff, how much effort and table size would it take to be able to properly sort an UTF-8 string for example?
19:46:07shashlickran for some time, but now uses 107MB of RAM
19:46:15shashlickwhat are the odds vscode can do that
19:46:43FromGitter<jrfondren> https://github.com/jtauber/pyuca/tree/master/pyuca looks pretty small, apart from the data files.
19:46:58FromGitter<jrfondren> 0% odds that vscode can do that.
19:47:45narimiranZevv: i also know only the basics ;) can you expand on 'pythonesque drama'?
19:48:02narimiranand what is a "proper sort"? you want to have é before f?
19:48:14dom96hello everyone, how's things?
19:48:32ZevvHi there dom
19:48:37shashlickfeud = Nim + Scintilla + WinApi
19:48:41shashlickawesome stuff
19:48:50Zevvnarimiran: well, the 'drama' is the difference between strings and unicode strings, and exactly these questions
19:49:06narimiranZevv: ummm, are you on python2?
19:49:14Zevvno, that was the point :)
19:49:51*rnrwashere quit (Remote host closed the connection)
19:51:02ZevvI once had to get a python2 app to run on python3, while properly handling unicode strings. That was a funny project with a lot of funny side effects
19:51:36narimirani can imagine
19:52:04FromDiscord<DeltaPHC> Should Nim's defer statement be used like in Go? The fact that it's rewritten to mean try..finally gives me pause, and I'm not sure of the implications
19:52:27FromGitter<jrfondren> what does "used like in Go" mean?
19:53:00FromDiscord<DeltaPHC> As a way to defer the cleanup of resources
19:53:12FromGitter<jrfondren> yeah that's what it's for
19:53:20*rnrwashere joined #nim
19:53:49FromGitter<jrfondren> if Go had exceptions, it'd be try...finally there as well.
19:54:08FromDiscord<DeltaPHC> Hm. I mean, I suppose if I actually wanted to handle the errors, I just wouldn't use defer?
19:54:37FromGitter<jrfondren> what?
19:55:34FromDiscord<DeltaPHC> It's a try..finally with no catch, so it seems like it'd just rethrow
19:55:45FromGitter<jrfondren> yeah of course it would
19:56:12FromGitter<jrfondren> if you wanted to handle the exceptions then you'd have your own try...except
19:56:46FromDiscord<DeltaPHC> So then is there any weirdness that comes from using try..except after a defer?
19:56:51FromDiscord<DeltaPHC> Or overhead
19:57:20FromGitter<jrfondren> there's no overhead beyond the overhead you already have from the defer
19:57:47FromGitter<jrfondren> what weirdness could there be?
19:58:45FromDiscord<DeltaPHC> Would it be rewritten as a nested try block?
19:58:57skrylar[m]@jrfondren collation and normalization isn't exactly hard, but tedious, and tends to require a chunk of memory dedicated to it. (i have a python script that reads the character database and builds deduplciated indexes of some character properties, and the data block + index tends toward 100k)
19:59:41FromGitter<jrfondren> yeah, I'd expect a nested try block
19:59:42shashlickif i am to make feud cross-platform, should i build on OSX or Linux first?
19:59:55FromGitter<jrfondren> https://gist.github.com/jrfondren/bf270df37e75bd49333da02058892d43 - defer examples
20:00:14shashlickhow many people want an efficient GUI text editor on these platforms?
20:00:54skrylar[m]linux users are more loyal, macos users are more numerous (and discerning, but they pay better)
20:01:00FromGitter<jrfondren> text editor space is pretty tight, but if you cleave to an existing editor and do it one better, you should get attention.
20:01:06FromDiscord<DeltaPHC> Thanks jrfondren
20:01:14skrylar[m]although text editors are grand master difficulty sells given how many already exist and how often the person who needs it already has one
20:01:16Zevvbut linux users tend to be quite happy in a terminal
20:01:23skrylar[m](cf. sell = also mind share ,even if free)
20:01:49shashlicknot interested in $ or large user base, mainly for efficient code editing environment that starts quick and isn't a slob with RAM and CPU
20:02:10FromGitter<jrfondren> if he's competing against vscode in particular, then he'll still get attention on other platforms, since vscode is a GUI app on Linux and macOS as well
20:02:19shashlickno way we can compete with legacies like vim/emacs or modern editors like vscode/sublime
20:02:27skrylar[m]don't forget kakoune
20:02:43FromGitter<jrfondren> well I like moe, a vi in Nim. it needs some work, it starts up faster than vim :)
20:03:02FromGitter<jrfondren> what? then you're giving up
20:03:18narimiranmoe? link?
20:03:19skrylar[m]i saw this in some docs and had a chuckle `An application's preferred app must be itself; an add-on is more flexible`
20:03:31shashlickwell, not really - i think feud is already quite feature rich and i use it full time
20:03:53shashlickfact that i can open 2400 files and not crash my system talks to how nim is a good foundation
20:03:57FromGitter<jrfondren> competing with vim is easy: do better than NimScript. competing with Emacs is hard, but you should start by targeting spacemacs instead. competing with vscode is easy: have any level of performance above "garbage".
20:04:20Zevv*VimScript* I made the same mistake earlier this week :)
20:04:21shashlickwell, all feud plugins are pure nim
20:04:26skrylar[m]i was going to ask what you were using for the data structure but.. i guess the answer is scite. :b
20:04:40shashlickscintilla
20:04:42FromGitter<jrfondren> moe has a gapbuffer
20:04:46skrylar[m]have made a rope and piece table... rope is so not worth
20:05:47FromGitter<jrfondren> oh, moe's at https://github.com/fox0430/moe
20:05:53skrylar[m]also spent a couple days implementing a knuth-plass line wrapper.
20:08:09shashlickmoe is a good find, will see if i can use any of it 🙂
20:08:24shashlickfact that feud is nim means i can develop features super fast
20:08:38shashlickeverything is accessible to plugins
20:09:27skrylar[m]do you have a full on plugin framework or is it static compiled
20:09:33shashlickwill be cool if community can review and provide feedback
20:09:56shashlickskrylar: it is full on - it detects file changes and recompiles and reloads
20:10:06shashlickpredates hot code reloading but does that
20:10:47skrylar[m]neat.
20:10:54shashlickit could be used mostly as is in other projects https://github.com/genotrance/feud/blob/master/src/plugin.nim
20:11:01skrylar[m]never really did much with plugins. one or two half hearted attempts to reverse engineer yapsy but. eh.
20:11:08*laaron quit (Remote host closed the connection)
20:11:37*laaron joined #nim
20:11:48shashlicki also have a binary flag which only loads compiled dlls so for production, it can be set to not require the source or monitor for changes
20:12:18shashlickultimate idea would be to compile in the plugins into the main binary for production but haven't found a need yet
20:12:52shashlickall features are built as plugins including the GUI window so that developing portions can be recompiled quickly
20:13:53skrylar[m]have been trying to tackle the rich text editor problem over here
20:14:14shashlickplease try out feud then and let me know what you think
20:14:28shashlicki'm a command line guy so everything is command line-ish
20:14:58*narimiran quit (Ping timeout: 252 seconds)
20:16:17skrylar[m]didn't you just say it doesn't run on linux ._.
20:16:31shashlickaah 🙂
20:17:59shashlickboth nim and scintilla are cross platform so shouldn't be too hard to port but winapi will have to be ported to gtk
20:18:34skrylar[m]when i last checked we didn't have gtk3 bindings, or well one guy made them but they weren't in nimble or something
20:18:41skrylar[m]scintilla has gtk2 bindings i think
20:19:09shashlickya so i'll have to use those - i use winim on windows
20:19:23*poopBot quit (Remote host closed the connection)
20:19:42shashlickbut that's why my question of GUI on linux
20:19:50shashlicki use vim on the cli in linux even with the desktop
20:20:12shashlickbut am planning on using the feud remote plugin to allow remote editing
20:20:40shashlickso that i can edit everywhere from my main workspace
20:21:42skrylar[m]i use either atom or emacs gui
20:21:49skrylar[m]terminal usually to kick off build commands or scripts
20:22:24shashlicki would like to do all terminal stuff in feud as well - right now i don't have live exec yet, the shell can run commands and get output into feud
20:22:38shashlickcan also pipe the buffer thru a command and get output back
20:22:45shashlickso you can do a sed or grep or something
20:22:59skrylar[m]i'm sure implementing vt100 is "fun" 🤕
20:23:28skrylar[m]i spoke with a plan9 fan some weeks ago, they had some things to say about acme+win
20:23:31shashlickhoping i don't need to go that far and just collect stdout for now
20:23:39shashlicktho many tools won't work
20:23:46shashlickbut all unix'y stuff will
20:24:24skrylar[m]i guess acme has some feature where you can put it in terminal mode and it just starts writing program output to the buffer, and you keep typing in to it and it just runs the shell until you tell it to stop, but each blob ends up as its own undo chunk
20:25:14shashlickinteresting
20:25:55skrylar[m]acme is an odd duck
20:26:07skrylar[m]does a lot of things through various mouse buttons and special regex triggers
20:27:38skrylar[m]be has an interesting approach to scripting
20:28:08skrylar[m]they just have a generic message object, but you can add a list of scopes to it, and they say "well you support scripting by just using the regular message system but checking if ith as a scope stuck to it"
20:28:53skrylar[m]this message system is the same for in-process and interprocess
20:31:36FromGitter<zacharycarter> has anyone used - https://bitbucket.org/wolfpld/tracy/src - before?
20:33:50skrylar[m]no but this sounds neat
20:33:56skrylar[m]the one i'm vaguely familiar with is hawktracer
20:34:01*laaron- joined #nim
20:34:25*laaron quit (Remote host closed the connection)
20:36:56FromGitter<zacharycarter> seems like it supports C code - when I get something to actually profile in my game engine I'll give a shot adding this in
20:40:07skrylar[m]still not finished with that thing? ;)
20:41:01shashlickquick video of the shell plugin - https://www.dropbox.com/s/mpzovgck6uflx1j/shell.gif?dl=0
20:42:07FromGitter<zacharycarter> hehe I wish - taken too many breaks / started over too many times
20:42:15FromGitter<zacharycarter> and life - ugh
20:42:35FromGitter<zacharycarter> but the move to finland and new job is helping to motivate me
20:42:56FromDiscord<SirHaswell> Hello how come nothing is displayed and I don't have an error?
20:42:56FromDiscord<SirHaswell> https://hastebin.com/subitawega.cs
20:43:50skrylar[m]zacharycarter: have been having nostalgia for the times i used to mess with gamemaker/mmf personally :b
20:44:45FromGitter<zacharycarter> should get back into it :)
20:45:28FromGitter<zacharycarter> SirHaswell - because nothing is being called? there's no code executing at the program's entry point
20:45:29FromGitter<jrfondren> @SirHaswell, there are no errors and you don't actually do anything.
20:46:09FromDiscord<SirHaswell> I have another file that calls the tokenize method and I know that the display_functions function is called
20:46:10skrylar[m]zacharycarter: well fusion 3 is apparently getting linux support, whenever that happens. their main devs are mac and linux guys now lol
20:46:33FromGitter<jrfondren> @SirHaswell, then the error may be in that other file.
20:46:55FromDiscord<SirHaswell> https://hastebin.com/obaminobub.sql this entry file
20:47:14FromDiscord<SirHaswell> oh no
20:47:17FromDiscord<SirHaswell> older version
20:47:36FromGitter<zacharycarter> skrylar[m]: oh cool! didn't know that
20:47:51FromGitter<jrfondren> ok that older version definitely does nothing but exit on command
21:03:58*laaron joined #nim
21:04:50*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
21:13:25*lritter quit (Quit: Leaving)
21:16:15*natrys quit (Quit: natrys)
21:22:42*seni quit (Remote host closed the connection)
21:34:49*Jjp137 quit (Quit: Leaving)
21:39:35*Jjp137 joined #nim
21:47:03*JustASlacker quit (Remote host closed the connection)
21:48:10*JustASlacker joined #nim
21:54:57*solitudesf quit (Ping timeout: 258 seconds)
22:02:18*jjido joined #nim
22:07:50*xet7 quit (Quit: Leaving)
22:10:53*vlad1777d quit (Ping timeout: 245 seconds)
22:14:37*nsf quit (Quit: WeeChat 2.4)
22:15:29*clyybber quit (Quit: WeeChat 2.4)
22:30:52*ng0 quit (Quit: Alexa, when is the end of world?)
22:35:15*rnrwashere quit (Remote host closed the connection)
22:53:37*JustASlacker quit (Ping timeout: 246 seconds)
23:07:19*rnrwashere joined #nim
23:07:47skrylar[m]leorize: finished reading over the be book 😓
23:14:47*stefanos82 quit (Remote host closed the connection)
23:17:31jjidoBe Book? That's quite old right
23:21:18skrylar[m]a bit, yeah. although not much has changed with GUIs in 15 years
23:22:02jjidoWhat do you think of Haiku?
23:22:18skrylar[m]i've never used it
23:23:04skrylar[m]i think the be API at least from reading the book that haiku considers "legacy documentation" shows that, while having 'less' than current day delphi VCL or .NET or whatever, it definitely has all of the really core stuff in a relatively straightforward and elegant fashion
23:23:27skrylar[m]classes don't seem too deeply nested
23:26:53skrylar[m]may have to add a couple of things to it, since they didn't have things like progress bars (well, the status bar is a progress bar, which is kind of neat but probably completely foreign to everyone)
23:27:34jjidoWell it can run Be programs so it's mostly same as BeOS, with some additions/modernisation
23:28:20skrylar[m]i heard everyone liked Be
23:28:33*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
23:30:45jjidoIt was way fast compared to others
23:30:54skrylar[m]i can see why
23:31:20skrylar[m]each window gets its own thread, and it makes no qualms about everything that isn't a window is basically just a canvas helper
23:32:10jjidolike modern browsers? lol
23:32:33skrylar[m]lol
23:50:55*Elronnd quit (Ping timeout: 264 seconds)
23:54:28*vlad1777d joined #nim