<< 01-06-2020 >>

00:02:42FromDiscord<dayl1ght> Rika: your example (https://play.nim-lang.org/#ix=2nZd) used & to concatenate the strLitNode
00:02:51FromDiscord<dayl1ght> why does & work and fmt doesn't?
00:02:57Yardanicobecause they're different
00:03:05Yardanicohttps://nim-lang.org/docs/strformat.html#fmt-vsdot-amp
00:05:26*sschwarzer quit (Quit: leaving)
00:05:53FromDiscord<dayl1ght> that link talks about generalized raw string literals and escaping, I still don't understand why fmt doesn't work
00:05:59leorize[m]Yardanico: https://play.nim-lang.org/#ix=2nZr <- use that for the warning one so you don't have to depend on system.nim line info
00:06:11FromDiscord<dayl1ght> I get an error that I'm expanding it with an undeclared identifier when I use `fmt` inside a quotation
00:06:11Yardanicoleorize[m]: oh thanks :P
00:06:17Yardanicoi did it with macros hehe
00:06:26leorize[m]lol
00:06:35Avatarfighterlmao
00:07:11AvatarfighterWelp I fixed my issue, it was all because of uri not parsing my url with a space in front .-.
00:07:45Yardanicostrip exists
00:08:07AvatarfighterI know, I just wasn't aware that some of the urls I was scraping had a space in front of them
00:10:15Yardanicoleorize[m]: backport as in PR title or somewhere else?
00:10:27leorize[m]yea
00:10:44leorize[m]or in the commit message, your choice
00:12:14Yardanicowell it's simpler to do in the PR title
00:12:19FromDiscord<dayl1ght> yardanico: this is what I mean https://play.nim-lang.org/#ix=2nZu
00:12:39FromDiscord<dayl1ght> if I'm reading that link correctly calling it with `.fmt` should not create a generalized raw string literal
00:13:12Yardanicoleorize[m]: done
00:13:18Yardanicoadded a test to template one too
00:14:26Yardanicoi'm doing this also because I use nimlsp myself lol
00:14:41Yardanicowell, with vscode-nim-lsp by bung_
00:16:03bung_am happy someone decide to patch nimsuggest
00:16:20Yardanicobung_: well I did two PRs
00:16:22leorize[m]@dayl1ght what are you trying to do?
00:16:26Yardanicothey'll fix some phantom errors I had
00:16:40FromDiscord<dayl1ght> leorize: just want to understand why fmt doesn't work and & does
00:16:41*aav1o2 joined #nim
00:16:44bung_let me see , I checked one
00:16:59Yardanicobung_: https://github.com/nim-lang/Nim/pull/14526 and https://github.com/nim-lang/Nim/pull/14527
00:17:01disbotFix `compiles` for nimsuggest [backport]
00:17:18Yardanicolemme rebuild nimlsp with these changes
00:17:53leorize[m]@dayl1ght: quote do work on the passed ast
00:18:45Yardanicoyeah, seems to work fine now
00:19:25bung_https://github.com/nim-lang/Nim/pull/14526 this one actually I need
00:19:26disbotChange severity of template instantiation message [backport] ; snippet at 12https://play.nim-lang.org/#ix=2nZ8
00:20:02leorize[m]@dayl1ght the `a` in x1 wasn't part of the ast, so it didn't get substituted
00:20:08bung_when debuging nimlsp it just anoying me
00:20:17Yardanicobung_: :D
00:20:31Yardanicowell I hope I didn't mess up stuff in #14527
00:20:32disbothttps://github.com/nim-lang/Nim/pull/14527 -- 3Fix `compiles` for nimsuggest [backport]
00:20:47Yardanicowe just need more nimsuggest tests I guess
00:20:49Yardanicofor edge cases
00:21:10leorize[m]now I need PMunch to have highlighting working so that I will have Yardanico help me with fixing highlight-related bugs
00:21:16Yardanicolol
00:21:39FromDiscord<dayl1ght> leorize: not sure I understand what you're saying
00:21:40FromDiscord<Technisha Circuit> sent a code paste, see http://ix.io/2nZw
00:22:05FromDiscord<Technisha Circuit> If anyone can't see it here's a screenshot https://media.discordapp.net/attachments/371759389889003532/716808753089085440/Screenshot_20200601_012142_com.discord.jpg
00:22:21Yardanico@Technisha pragmas should after the name
00:22:24Yardaniconot after the type
00:22:30FromDiscord<Technisha Circuit> Oh okay
00:22:40Yardanicolike let discord {.exportc.}: JsObject = require "discord.js"
00:22:54FromDiscord<Technisha Circuit> Oh okay, I don't like that but okay :p
00:22:56FromDiscord<Technisha Circuit> Thanks!
00:23:39FromDiscord<dayl1ght> leorize: so quote receives the AST for "{a}".fmt and doesn't have the identifier for a in the ast?
00:23:56FromDiscord<dayl1ght> and that AST doesn't include the identifier for a*
00:24:27FromDiscord<dayl1ght> whereas the AST for `" " & a` does
00:24:45FromDiscord<Technisha Circuit> Why is it when I'm doing `let` in Nim it comes out as `var` in the generated JS?
00:24:53Yardanicobecause nim uses var for JS
00:25:01Yardanicoand let in Nim and JS are really different things
00:25:09Yardanicolet in JS is about scoping, and it's about immutability in Nim
00:25:39leorize[m]@dayl1ght the ast for ```"{`a`}".fmt``` is: ```DotExpr(StrLit"{`a`}", Ident"fmt")```
00:27:23leorize[m]as you can see, there wasn't any `a` node to substitute the ast in
00:28:10FromDiscord<dayl1ght> that's pretty confusing
00:28:25FromDiscord<dayl1ght> seems like it would only happen for fmt specifically in macros
00:28:36Yardanicobecause fmt and & are macros too
00:28:52FromDiscord<dayl1ght> I'm using the & proc I think
00:29:31Yardanicoah right yes
00:29:40Yardanicothat is a string concat operation in nim
00:29:43Yardanicowell, proc
00:29:53FromDiscord<dayl1ght> yeah, the confusing part is that it looks like
00:30:01FromDiscord<dayl1ght> macros that use strings as their input won't work inside other macros
00:30:26FromDiscord<dayl1ght> I mean macros that use strings the same way `fmt` does
00:33:43Yardanicoah shoot
00:34:46Yardanicoturns out in https://github.com/nim-lang/Nim/pull/14517 I needed to do used for the first await template too
00:34:47disbotDisable unused warnings for await in async macro
00:35:49FromDiscord<Technisha Circuit> > let in JS is about scoping, and it's about immutability in Nim↵Oh okay
00:36:13YardanicoI mean in most cases nim can emit "let" too, but it doesn't really have any real world advantages I think
00:36:31disrupteki wish the bridge didn't pass quotes that way.
00:36:43Yardanicodisruptek: what way would you like?
00:37:05disruptekwell, we make do without quotes on irc. it's expected.
00:37:20FromDiscord<Technisha Circuit> Is there a way to make Nim use let from js?
00:37:29Yardanicomodify js backend
00:37:29disruptek.emit
00:37:44Yardanicowell if you only want let for some variables, yeah, you can do with emit or stuff
00:37:48FromDiscord<Technisha Circuit> Is there no `jsLet` :p
00:37:55Yardanicobut if you want to have let for most JS code you need to modify js backend
00:37:58Yardanicowhy do you want let though?
00:38:05FromDiscord<Technisha Circuit> Awe okay
00:38:18FromDiscord<Technisha Circuit> Just because my logic is annoying me
00:38:26disruptekyou can make a jsLet easily.
00:38:27FromDiscord<Technisha Circuit> (edit) 'Awe' => 'Aww'
00:38:36FromDiscord<Technisha Circuit> Oh? How?
00:38:47bung_before js gen add a block:
00:38:54disruptekwrite a macro.
00:39:34FromDiscord<Technisha Circuit> How would it tell the compiler to use js's let via jsLet?
00:43:57*lritter quit (Ping timeout: 246 seconds)
00:44:06bung_it's in jsgen.nim 1055 line
00:45:00*lritter joined #nim
00:49:48FromDiscord<ThothLoki> any suggestion on how to make this work? what am i doing wrong?↵`btc.onTextChange = proc(event: TextChangeEvent) = parsefloat(usdbtc.text)=parsefloat(btc.text)*parsefloat(btcValue)`
00:50:21Yardanicowhy do you do parsefloat = ?
00:50:30*aav1o2 left #nim ("Leaving")
00:50:32YardanicoparseFloat takes a string and _returns_ a float
00:50:35FromDiscord<ThothLoki> btc and usdbtc are textboxes
00:50:48FromDiscord<ThothLoki> and btcvalue is a jsonnode
00:50:56Yardanicohow does btcValue look like?
00:50:59YardanicoI mean JSON
00:51:14*fredrikhr quit (Ping timeout: 256 seconds)
00:51:26FromDiscord<ThothLoki> {"9394.12"}
00:51:27Yardanicoand what textbox do you want to assign the value to?
00:51:52FromDiscord<Yardanico> ah i see
00:52:02FromDiscord<Yardanico> ```nim↵btc.onTextChange = proc(event: TextChangeEvent) = ↵ usdbtc.text = parseFloat(btc.text) * btcValue.getFloat()↵```
00:52:06FromDiscord<Yardanico> something like that I think
00:52:18FromDiscord<ThothLoki> i am taking a value from `btc`, multiplying it by `btcvalue` and setting that to `usdbtc`
00:52:21FromDiscord<Yardanico> ah wait
00:52:21FromDiscord<ThothLoki> let me try that
00:52:28FromDiscord<Yardanico> ```↵btc.onTextChange = proc(event: TextChangeEvent) = ↵ usdbtc.text = $(parseFloat(btc.text) * btcValue.getFloat())↵```
00:52:36FromDiscord<Yardanico> $ is stringify operator in Nim
00:54:10*dadada__ quit (Ping timeout: 246 seconds)
00:54:36FromDiscord<Yardanico> you need to use getFloat for a JsonNode because JsonNode is not a string 🙂 and JsonNode has it's own proc to get the float value of the node https://nim-lang.org/docs/json.html#getFloat%2CJsonNode%2Cfloat
00:55:03FromDiscord<ThothLoki> that kinda compiled
00:56:29FromDiscord<ThothLoki> dammit. macOS sucks. The file compiled but wont run. let me go rock out on linux where i know i can make an app run
00:56:37FromDiscord<Yardanico> wdym by "won't run"?
00:56:40FromDiscord<Yardanico> what's the error
00:56:50FromDiscord<ThothLoki> Error: execution of an external program failed:
00:56:58FromDiscord<Yardanico> well how did you compile the app?
00:57:01FromDiscord<Yardanico> nim c app.nim ?
00:57:11FromDiscord<ThothLoki> nim c -r app.nim
00:57:19FromDiscord<Yardanico> well then it's probably a code issue, what error did you get?
00:57:51FromDiscord<ThothLoki> now when i double click on the executable, it just opens a terminal and does nothing
00:58:19FromDiscord<Yardanico> well with nim c -r app.nim it should show the error stack trace
00:58:26FromDiscord<ThothLoki> i am sure i need to authorize it in 10 different areas in macos
00:58:40FromDiscord<ThothLoki> it compiled. but wont run
00:58:41*dadada joined #nim
00:58:46FromDiscord<Yardanico> well what's the error? full output
00:59:05*dadada is now known as Guest47452
00:59:49FromDiscord<Yardanico> sent a code paste, see http://ix.io/2nZB
01:00:02FromDiscord<Yardanico> if a user inputs something other than a number in btc.text
01:00:28FromDiscord<ThothLoki> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716818410415194142
01:00:41FromDiscord<Yardanico> oh yeah, nigui on macos needs gtk
01:00:48FromDiscord<Yardanico> nigui doesn't have a native macos backend
01:00:54FromDiscord<ThothLoki> lol.
01:00:58FromDiscord<ThothLoki> is there a better gui?
01:01:11FromDiscord<ThothLoki> i just threw a dart and landed on that one
01:01:20FromDiscord<Yardanico> I don't think there's a lot of choice, arguably the best gui library right now is gintro which is a high-level binding to GTK
01:01:33FromGitter<ynfle> Is there a way to inject a proc or template in to the global scope?
01:01:43FromGitter<sealmove> how to efficiently generate `x` random numbers in range a..b?
01:01:47Yardanicowhat do you mean by that @ynfle?
01:02:14*konvertex quit (Ping timeout: 240 seconds)
01:02:49FromDiscord<Yardanico> @sealmove just call rand in a loop?
01:03:08FromGitter<sealmove> I want them to be disjoint
01:03:14FromDiscord<Yardanico> wdym?
01:03:18FromGitter<sealmove> like result should be a set of cardinality x
01:03:47FromDiscord<Yardanico> well add an if check 😛
01:04:04FromDiscord<Yardanico> but really I don't think there's a optimized proc for that in stdlib
01:04:09FromGitter<sealmove> that's not efficient though
01:04:11FromGitter<ynfle> I want to allow someone to use a `debug` method in there code, and then capture what they want to print.
01:04:24*aeverr quit (Read error: Connection reset by peer)
01:04:27FromGitter<sealmove> then is there a standard way to implement it? :P
01:04:33Yardanico@ynfle well if they call your template in the global scope you can inject in the global scope
01:04:37Yardanico@sealmove I don't think so really
01:04:41FromDiscord<Technisha Circuit> > it's in jsgen.nim 1055 line↵Thanks!
01:04:52FromGitter<ynfle> Without them importing anything
01:05:02Yardanico@ynfle well that's not really possible easily
01:05:09Yardanicothey somehow need to include/import your module
01:05:33FromGitter<ynfle> I am the one importing their code'
01:05:50Yardanicowell you can use "include" to literally include the module contents of their file into your module
01:05:51FromGitter<ynfle> I could use `include` but then the error show my code lines
01:05:57Yardanicowhat error?
01:06:00Yardanicoah well
01:06:05Yardanicothere's no other way really I think
01:06:07bung_sealmove https://numpy.org/devdocs/reference/random/index.html
01:06:20Yardanicobung_: that's not for nim :P
01:06:28bung_check there , maybe you can find implementation in nim...
01:06:44bung_Yardanico I know that, just for inspir..
01:08:59*aeverr joined #nim
01:10:23*Guest47452 quit (Ping timeout: 265 seconds)
01:10:24bung_I guess mratsim should know
01:10:49Yardanicolol
01:13:46*dadada joined #nim
01:14:01FromGitter<sealmove> ok is there a way to randomize an array?
01:14:05Yardanicoyes
01:14:07Yardanicoshuffle should work
01:14:10*dadada is now known as Guest57561
01:14:11FromGitter<sealmove> nice!
01:14:17Yardanicohttps://nim-lang.org/docs/random.html#shuffle%2CopenArray%5BT%5D
01:14:26FromGitter<sealmove> i can just put the unique numbers, shuffle, and then take the `x` first
01:15:17*chemist69 quit (Ping timeout: 272 seconds)
01:17:12*chemist69 joined #nim
01:25:51AvatarfighterWould anyone be able to help me with a rather big issue I'm getting in my program? I wrote a webscraper tuned to a specific site and after a thousand or so requests I keep getting a System error: Device or resource busy and I'm trying to figure out what are common causes of that
01:26:51AvatarfighterI can provide code if needed
01:31:27*aeverr_ joined #nim
01:32:37*aeverr quit (Ping timeout: 264 seconds)
01:37:56*Guest57561 quit (Ping timeout: 265 seconds)
01:39:25*waleee-cl quit (Quit: Connection closed for inactivity)
01:43:44*dadada__ joined #nim
01:58:40*krux02_ quit (Remote host closed the connection)
02:01:54*endragor joined #nim
02:04:23FromDiscord<treeform> hey is there a pragma to disable `{.overflowChecks: off.}` ?
02:05:59FromDiscord<treeform> it looks like `{.push overflowChecks: off.}`/`{.pop.}`
02:06:04FromDiscord<treeform> but it does not do what I want grr
02:06:48FromGitter<sealmove> can I use regex or prg in nimscript?
02:07:05Yardanicohttps://github.com/nitely/nim-regex works at compiletime
02:07:07Yardanicorandom - yes
02:07:15Yardanicobut you need to call randomize with a seed explicitly
02:07:24*dadada__ quit (Ping timeout: 256 seconds)
02:07:41Yardanicorandomize(some_number_which_should_be_different_for_different_runs_of_the_program)
02:08:03FromGitter<sealmove> hmm maybe this is enough https://nim-lang.org/docs/strscans.html
02:13:47*dadada joined #nim
02:13:48FromGitter<matrixbot> `sendell` hey community :) playing around with ARC I'm wondering about sink params : the doc says "If it cannot be proven to be the last usage of the location, a copy is done instead and this copy is then passed to the sink parameter." then why do we even have to specify that it's a sink param or not ?
02:14:01FromGitter<matrixbot> `sendell` I mean in the end the semantic is the same, it's only a matter of optimization
02:14:03disruptekyou don't.
02:14:09*dadada is now known as Guest35592
02:14:10FromGitter<matrixbot> `sendell` (is it? :p)
02:14:26disruptekyes, it's a matter of optimization.
02:14:48disruptekthe optimizer is not infallible.
02:14:54disruptekthat's where you can help...
02:15:42FromGitter<matrixbot> `sendell` when would it be beneficial to avoir a sink parameter passing ?
02:15:44FromGitter<matrixbot> `sendell` avoid*
02:16:02disrupteki don't understand.
02:16:21disruptekif the value sinks, you can annotate it in case it helps the compiler. otherwise, it doesn't matter.
02:16:38disruptekthere's no time that it's beneficial to avoid a sink that is otherwise necessary.
02:16:50disruptekwe're talking about something that makes fast code faster.
02:16:55disruptekit's free if we can optimize it.
02:17:02disruptekelse, it costs what it costs. as ever.
02:18:23FromGitter<matrixbot> `sendell` but why couldnt every formal parameter declared as sink ?
02:18:29FromGitter<matrixbot> `sendell` be declared*
02:18:38disruptekif they all sink, they can.
02:18:42FromGitter<matrixbot> `sendell` formal as "in proc declaration"
02:19:15Yardanicothere's sink inference by default
02:19:29Yardanicowhich already detects where "sink" can be placed in most cases
02:19:45Yardanicoyou can explicitly annotate with "sink" yourself if the compiler doesn't
02:20:04disruptekehh i would say sink inference is a little premature.
02:20:35disruptekif you're not sure it's a sink, don't add the annotation. and i wouldn't use sink inference yet, either.
02:20:42disruptekjust write your code as you would normally.
02:22:16FromGitter<matrixbot> `sendell` any example where it would be "wrong" to sink ? if it's not var, i don't get the difference with a normal argument passing
02:22:30FromGitter<matrixbot> `sendell` and sinking a var parameter doesnt make sense, if I get it correctly
02:23:03disrupteksink is like the auschwitz of memory management.
02:23:14disruptekthe bytes go in but ze don't get out!
02:23:25Yardanico@sendell sink shouldn't be wrong in any place
02:23:31FromGitter<matrixbot> `sendell` exactly
02:23:33Yardanicosince if a variable cannot be sinked the compiler will just make a copy
02:23:35disruptekif the memory goes in and doesn't fucking die there, then it's not a sink opportunity.
02:23:41*stefantalpalaru quit (Ping timeout: 272 seconds)
02:24:19*muffindrake quit (Ping timeout: 272 seconds)
02:25:25FromGitter<matrixbot> `sendell` it doesnt have to die, take "add" procs for data structures
02:25:30FromGitter<matrixbot> `sendell` it just takes ownership
02:25:45disruptekyes, but that's a move.
02:26:17*rockcavera joined #nim
02:26:23disruptekjust don't worry about it if you find it confusing.
02:26:23*muffindrake joined #nim
02:26:48disruptekit's more important that people use arc than it is that they understand it.
02:28:28*bab quit (*.net *.split)
02:29:21FromGitter<matrixbot> `sendell` yeah haha. I just don't get why there's a sink keyword to "help the compiler" (as with inlining) if it's always valid and always beneficial to sink a parameter
02:29:31FromGitter<matrixbot> `sendell` I can use it without understanding, of course :)
02:30:03disruptekbecause the alternative is that sometimes the compiler cannot determine statically went the value will sink.
02:30:23FromGitter<matrixbot> `sendell` it might click after some more experiments, i hope ^^
02:31:52*lqdev[m] quit (Ping timeout: 240 seconds)
02:31:52*unclechu quit (Ping timeout: 240 seconds)
02:31:53*planetis[m] quit (Ping timeout: 260 seconds)
02:31:54disrupteki think some of the stdlib has been manually annotated; that could demonstrate some common patterns.
02:32:07Yardanicoalso @sendell you can use https://github.com/matrix-org/matrix-appservice-irc/wiki/Guide:-How-to-use-Matrix-to-participate-in-IRC-rooms
02:32:08*anti[m] quit (Ping timeout: 260 seconds)
02:32:08*matthias[m]1 quit (Ping timeout: 252 seconds)
02:32:11disruptekit's just about the last thing i'd look into optimizing.
02:32:13Yardanicoto connect directly to IRC without connecting to gitter
02:32:14*salotz[m] quit (Ping timeout: 252 seconds)
02:32:17*skrylar[m] quit (Ping timeout: 240 seconds)
02:32:22*kragil[m] quit (Ping timeout: 244 seconds)
02:32:23*Cadey1 quit (Ping timeout: 244 seconds)
02:32:26*TheManiac[m] quit (Ping timeout: 256 seconds)
02:32:27*dannyfritz[m] quit (Ping timeout: 256 seconds)
02:32:28*dzamo[m] quit (Ping timeout: 256 seconds)
02:32:28*codic quit (Ping timeout: 256 seconds)
02:32:28*j4nvkvc quit (Ping timeout: 256 seconds)
02:32:28*watzon quit (Ping timeout: 256 seconds)
02:32:28*k0mpjut0r quit (Ping timeout: 260 seconds)
02:32:30*oneark quit (Ping timeout: 240 seconds)
02:32:36disruptekarc is already much faster for the performance-sensitive stuff i'm working on.
02:32:49*bab joined #nim
02:34:06FromGitter<matrixbot> `sendell` yeah i'll take a look at the stdlib. do you know if "owner refs" are already into 1.2.0?
02:34:26Yardanicoyeah
02:34:28disruptekyeah, but that's sorta a dead-end compared to arc.
02:34:35disruptekjust ignore it.
02:35:16FromGitter<matrixbot> `sendell` oh ok I thought it was going to be a part of it
02:35:42disruptekit was an experiment that helped found the arc approach.
02:36:04FromGitter<matrixbot> `sendell` i see
02:36:58FromGitter<matrixbot> `sendell` that final approach is a bit like c++'s shared and weak pointers, right ?
02:37:00*BitPuffin quit (Ping timeout: 244 seconds)
02:37:09FromGitter<matrixbot> `sendell` and the owned refs would have been like unique pointers
02:37:26*Guest35592 quit (Ping timeout: 256 seconds)
02:37:59FromGitter<matrixbot> `sendell` > <@gitter_fromirc:matrix.org> *<Yardanico>* to connect directly to IRC without connecting to gitter ⏎ ⏎ I'm actually already connected through Riot.im
02:38:01FromGitter<matrixbot> `sendell` the web version
02:38:07Yardanico@matrixbot no you didn't understand
02:38:22Yardanicoright now you're connected to Gitter from Matrix
02:38:31Yardanicoand we get your messages like Matrix -> Gitter -> IRC
02:38:42Yardanicowith https://github.com/matrix-org/matrix-appservice-irc/wiki/Guide:-How-to-use-Matrix-to-participate-in-IRC-rooms you can get Matrix -> IRC
02:39:10FromGitter<matrixbot> `sendell` oh ok :)
02:39:10FromGitter<matrixbot> `sendell` i'll do it
02:42:19*unclechu joined #nim
02:43:46*dadada__ joined #nim
02:44:49*sendell joined #nim
02:44:51*monok joined #nim
02:45:30sendellis that better ?
02:45:38Yardanicoye :)
02:45:42Yardanicomuch better :P
02:46:05sendellhehe
02:47:24*mono quit (Ping timeout: 256 seconds)
02:47:48*Cadey1 joined #nim
02:48:24sendell<disruptek "arc is already much faster for t"> I thought there would be a small overhead because of the ref count inc and dec, and that the perf gain would be "not having the GC phases"
02:48:50sendellespecially noticeable for big heaps
02:49:02Yardanicowell the default GC is a deferred reference counting based garbage collector with a simple Mark&Sweep backup GC in order to collect cycles. Heaps are thread local."
02:49:09Yardanicohttps://nim-lang.org/docs/gc.html
02:50:18*salotz[m] joined #nim
02:52:47disruptekthere are multiple gains.
02:53:07disruptekthe main one is that there's no stop-the-world. it's very deterministic.
02:53:35sendellyeah that's huge
02:53:39disruptekso you can plan around its behavior. it will handle memory sharing among threads as a side-effect rather than a wart in the design.
02:55:01disruptekwe'll be able to do scope-based allocators, automatic scope-based destruction, and more optimization that we haven't even touched yet.
02:55:27sendellhow is shared heap possible if the ref counting is not atomic ?
02:55:43disruptekthreads own subgraphs in memory.
02:56:21FromDiscord<lex> sorry, hi
02:56:29FromDiscord<lex> is nim-prompt for CLI tools or is it a GUI prompt
02:56:32FromDiscord<lex> I hope it is the latter
02:56:37disruptek!repo nim-prompt
02:56:38disbothttps://github.com/icyphox/nicy -- 9nicy: 11:snowflake: a nice and icy ZSH prompt in Nim 15 132⭐ 7🍴 7& 2 more...
02:56:43Yardaniconot this one
02:56:44disruptek!repo prompt
02:56:46disbothttps://github.com/icyphox/nicy -- 9nicy: 11:snowflake: a nice and icy ZSH prompt in Nim 15 132⭐ 7🍴 7& 5 more...
02:56:48Yardanico@lex which one did you mean?
02:56:53Yardanicoplease give link to the repo
02:57:03FromDiscord<lex> https://github.com/surf1nb1rd/nim-prompt
02:57:05FromDiscord<lex> I meant this but
02:57:07FromDiscord<lex> nicy looks good too
02:57:15Yardaniconicy is for zsh
02:57:21FromDiscord<lex> zsh only?
02:57:21Yardanicoit's not for nim programs
02:57:29Yardanicoand prompt seems to be cli only of course
02:57:32FromDiscord<lex> ah fuck ok
02:57:33Yardanicoit's about terminal prompt stuff
02:57:36FromDiscord<lex> prompt has no example code?
02:57:37FromDiscord<lex> (edit) 'code?' => 'code'
02:57:41disrupteki think nim-prompt is pretty simple stuff iirc.
02:57:44FromDiscord<lex> is there any you could possibly provide?
02:57:46Yardanicowhat do you want? a simple gui dialogue?
02:57:51FromDiscord<lex> nah nah
02:57:51FromDiscord<lex> I want CLI
02:58:00FromDiscord<lex> its just I was wondering cause I saw some Widget stuff in there
02:58:06FromDiscord<lex> and GTK2/3 popped in mind idk why
02:58:19disruptekhave you been doing a lot of pcp?
02:58:24disruptekthat's usually what happens to me.
02:58:57FromDiscord<lex> nah haha
02:59:08disruptekmeth, then.
02:59:12FromDiscord<treeform> wow `distinctBase` is really cool, it allows unwrapping distinct types in generics. I am a wizard now.
02:59:15FromDiscord<lex> wait
02:59:18FromDiscord<lex> you're talking about drugs?
02:59:20FromDiscord<lex> oh shit
02:59:23FromDiscord<lex> didnt even realise ngl
02:59:40disruptektreeform: it really is, but with great power...
02:59:46FromDiscord<lex> wait
02:59:49FromDiscord<lex> nim-prompt is old asf
02:59:54FromDiscord<lex> are there any other better prompt libraries
03:00:00FromDiscord<lex> if not i may as well as just write my own
03:00:09disruptekyou need to do that thing.
03:00:15FromDiscord<lex> wat?
03:00:21disrupteknimph has an open ticket for such an animal.
03:00:32disrupteka meth high can last days, dude.
03:00:34FromDiscord<lex> are u high bro
03:00:37disruptekthis is the perfect opportunity.
03:00:49disruptekmake sure you have plenty of water.
03:01:27FromDiscord<lex> ok buddy
03:02:10*kragil[m] joined #nim
03:02:12*matthias[m]1 joined #nim
03:02:19*anti[m] joined #nim
03:02:35disrupteki wrote a program to attentuate audio in whatever window is focussed but i cannot for the life of me remember what key i bound it to.
03:02:39*lqdev[m] joined #nim
03:02:44*TheManiac[m] joined #nim
03:02:45*dannyfritz[m] joined #nim
03:03:00disrupteki may as well not write software if i'm not going to run it.
03:03:45*oneark joined #nim
03:03:45*skrylar[m] joined #nim
03:03:48*planetis[m] joined #nim
03:06:24*watzon joined #nim
03:06:27*BitPuffin joined #nim
03:06:33disruptekit's on the fucking calculator key.
03:07:28*dadada__ quit (Ping timeout: 256 seconds)
03:07:35sendell<disruptek "threads own subgraphs in memory."> how is that enforced ? don't find any doc or examples
03:07:56disruptekit's not done yet.
03:08:10sendellhaha ok, that's why :D
03:08:26sendellso there's not much to play with at the moment :(
03:08:33Yardanicowhy? arc already works
03:08:33disrupteksure there is.
03:08:35Yardanicodestructors work
03:09:10sendellyeah but I mean the semantics didnt change, except the obligation to break cycles manually
03:09:17Yardanicothere's orc for cycles
03:09:23sendellthe sink and lent stuff is infered
03:09:30Yardanicolent is not inferred
03:09:39disruptekthe semantics definitely changed, but not in a way that matters for naive code.
03:09:53disruptekunless you consider performance to matter, i mean.
03:10:31sendellyeah :)
03:11:05disruptekwe need more people testing it.
03:11:09sendelli'll do some benchmarks
03:11:49*dzamo[m] joined #nim
03:11:49*codic joined #nim
03:11:51sendell<Yardanico "there's orc for cycles"> that reintroduces a stop the world phase right ?
03:11:54disrupteka couple weeks ago i might have said it was alpha-grade, but i'd say it's beta-grade now.
03:12:06disruptekno, there's no stop-the-world.
03:12:13Yardanicosendell: even nim default GC is not really stop the world
03:12:34disruptekrefc is pretty realtime, honestly.
03:12:35sendellit is, but tweakable and incremental
03:12:38sendellright ?
03:13:07sendelli mean you can split the work among several frames or whenever you have "spare time"
03:13:16*endragor quit (Remote host closed the connection)
03:13:19sendellbut it still stops the program execution
03:13:39disruptektrue, but it's not "however long it takes, it takes"
03:13:42*dadada joined #nim
03:13:53sendellyeah that's awesome already :)
03:14:05*dadada is now known as Guest56930
03:14:08disruptekmost gc is like, "well, you shouldn't have freed all that shit if you didn't want me to collect it"
03:14:13disruptekwhich is annoying as fuck.
03:14:15sendellwill it be depreciated at some point ?
03:14:20disrupteki mean, that's the whole fucking reason i'm using a gc.
03:14:25Yardanicosendell: refc? probably yes
03:14:33sendelllike will arc replace refc in 2.0?
03:14:36Yardanicocurrent goal is to make compiler work with arc
03:14:42*j4nvkvc joined #nim
03:14:44Yardanicothere's a couple bugs left
03:15:20Yardanicobut yeah, arc should become the default, not sure how soon though :P
03:15:24Yardanicowell, probably not arc but orc
03:15:25disruptekprobably by 2.0 i'd say yes, but you have to appreciate how much testing refc has gotten. it's going to stay relevant for awhile just because it's the best way to confirm behavior of arc.
03:15:49*k0mpjut0r joined #nim
03:15:49sendell<disruptek "no, there's no stop-the-world."> really curious about how that was implemented then
03:16:25disrupteki don't know the old gc, only arc.
03:16:31leorize[m]orc is actually faster than refc btw :P
03:16:39Yardanicoleorize[m]: depends on the benchmarks
03:16:44Yardanicosometimes it's still slower (even arc) :(
03:16:51Yardanicobut yeah, in a lot of cases it is
03:16:53Yardanicoand it's better anyway
03:16:57leorize[m]4raq based orc on bacon dingle iirc
03:17:03*chemist69 quit (Ping timeout: 260 seconds)
03:17:30disruptekthere's probably some cases that are slower, still, but my fast code is like 3-6x faster under arc these days.
03:17:45*chemist69 joined #nim
03:17:48Yardanicoleorize[m]: yeah
03:17:49disruptekmaybe i'm just more sensitive to how i write stuff. i don't annotate anything, though.
03:18:03Yardanicodisruptek: well your use case is kinda specific
03:18:06sendellthe doc says "trial deletion"
03:18:11sendelli'll have a look at it
03:18:20disruptekmy use case?
03:18:27Yardanicosendell: https://github.com/nim-lang/Nim/blob/devel/lib/system/cyclicrefs_bacon.nim
03:18:36sendellthx
03:19:50Yardanicoalso for experimenting with arc/orc it's much better to use devel for now
03:19:53Yardanicountil 1.2.2 is released
03:20:09Yardanicobut even then arc is a new feature so new fixes might arrive on devel :P
03:21:30sendellyeah good point
03:21:33sendelli will
03:21:48sendellis that the paper ? https://researcher.watson.ibm.com/researcher/files/us-bacon/Dingle07Ownership.pdf
03:22:00Yardanicoyou can check the papers from the file itself
03:22:07Yardanicocheck the comments in the start
03:22:14Yardanicoin cyclicrefs_bacon.nim
03:22:35sendelloh yeah thx
03:23:05sendellsame guys, different paper :p
03:24:56*stefantalpalaru joined #nim
03:25:34Yardanicoalso on devel you get a warning if you compile with arc and compiler detects a cyclic data structure
03:26:13*rockcavera quit (Remote host closed the connection)
03:26:23Yardanicolike "Warning: 'result.a = result' creates an uncollectable ref cycle; annotate 'a' with .cursor"
03:26:40Yardanicoalthough it should be changed a bit
03:26:50*endragor joined #nim
03:37:36*Guest56930 quit (Ping timeout: 256 seconds)
03:43:42*dadada__ joined #nim
03:45:33leorize[m]Windows docgen is broken and no one is noticing :/
03:45:35leorize[m](on devel)
03:45:46Yardanicoleorize[m]: you mean the compiler error?
03:46:10Yardanicoit only happens if you try to build nim with already built nim though, maybe because of configs or something like that
03:46:12leorize[m]yea
03:46:20Yardanicoand https://github.com/nim-lang/Nim/commit/004b0759c5743f4b50766a14b0a47477b72bbac9 fixed ci docs for windows
03:46:24leorize[m]no, I mean the current CI failures
03:46:30*zacharycarter quit (Ping timeout: 265 seconds)
03:46:30Yardanicowhich ones?
03:46:39Yardanicocheck the commit i linked
03:46:44leorize[m]ah it's fixed
03:56:22FromDiscord<ThothLoki> yay! it works https://media.discordapp.net/attachments/371759389889003532/716862678844571719/unknown.png
03:57:14FromDiscord<ThothLoki> now that i can make it work. time to make it pretty
03:57:37*dddddd quit (Ping timeout: 265 seconds)
04:01:35FromGitter<bdadsetan> Hi guys! When I try to compile nim (1.2.0) on macos, I get many error messages such as `use of undeclared identifier '__stdoutp'` I don't remember if choosenim compiled nim 1.0.7 for me but that's what I am forced to run now. ⏎ I have a similar issue when I try to use the nimx example git repo. It has a dependency to nake and that fails because of `use of undeclared identifier 'pid_t'` also while compiling
04:01:35FromGitter... `stdlib_posix.nim.c`. ⏎ I could not find any one else with similar issues while googling for it. Any one else use MacOS and had to do something special to get Apple `clang version 11.0.3` working?
04:02:24*NimBot joined #nim
04:03:41PrestigeHmm I need to get a job where I'm writing Nim on a Linux system
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:39*supakeen joined #nim
04:06:54*dadada__ quit (Ping timeout: 240 seconds)
04:08:30FromGitter<bdadsetan> My guess is I have a similar error to https://gist.github.com/sivers/a9786ddcca4d2f0f9feb497d13f2311a
04:13:47*dadada joined #nim
04:14:10*dadada is now known as Guest82096
04:20:11*zacharycarter joined #nim
04:24:18leorize[m]Prestige: let me know if you find one :P
04:24:31*zacharycarter quit (Ping timeout: 246 seconds)
04:25:13leorize[m]@bdadsetan https://github.com/nim-lang/Nim/blob/c0dbcffca643ac79e0c03c9509e92f5841b38a94/lib/system/ansi_c.nim#L120
04:35:15*zacharycarter joined #nim
04:37:31FromDiscord<Elegant Beef> I think a majority of us want that prestige
04:37:33*Guest82096 quit (Ping timeout: 256 seconds)
04:40:05disrupteki just want to live forever.
04:40:20PrestigeI'd like both disruptek
04:40:21disruptekexcept when i'm suicidal, i mean.
04:40:38PrestigeOkay 2 out of three
04:40:41FromDiscord<Elegant Beef> Just dont do that
04:40:44FromDiscord<Elegant Beef> Problem solved
04:41:58PrestigeMy job would be much nicer if we used Nim instead of node. And Linux instead of mac os (maybe unpopular opinion)
04:42:16PrestigeNeed to get this language into the market more
04:43:45*dadada__ joined #nim
04:47:36disruptekmy opinion is that your job would be nicer if you performed while wearing pants.
04:47:48disrupteki think almost everyone agrees with me on that.
04:48:00disruptekbeef being the obvious exception.
04:48:27FromDiscord<Elegant Beef> Depends on who "You" is, prostitues would have a less favourable opinion
04:49:09disruptekunless he has small hands, prostitutes have never had a problem with my pants.
04:49:30disrupteki think they like the intrigue. it's all part of the chase.
04:49:36bung_when you becoming a boss you can do like that
04:50:24disruptekbosses make the best prostitutes.
04:50:33disruptekthey know how to make you bend over.
04:50:54PrestigeThis conversation derailed quickly
04:51:10FromDiscord<Elegant Beef> You've got me and disruptek here
04:51:13FromDiscord<Elegant Beef> That's a terrible combo
04:51:22disruptekaight peace
04:51:43FromDiscord<Elegant Beef> Man didnt realize i'd get kicked outta the discord for that reason
04:51:46FromDiscord<Elegant Beef> Thought it'd be a bad joke
04:55:49leorize[m]one day I'll write an alacritty replacement just so rust won't murder my pc when I have to update it
04:57:02FromGitter<zacharycarter> just use another terminal?
04:57:09FromDiscord<Elegant Beef> I still have to get back to my cool terminal with intellisense like stuff
04:57:09PrestigeWhy do people like alacritty so much?
04:57:19FromDiscord<Elegant Beef> But that's back burnered
04:57:31PrestigeI just use st, it's so nice
04:57:34FromGitter<zacharycarter> what does a terminal have to do with intellisense?
04:57:39PrestigeAlso that ^
04:57:54Prestigeu can use fish, zsh with plugins, etc. Terminal doesnt matter for that
04:57:58FromDiscord<Elegant Beef> Auto completion through dropdowns instead of tabs
04:58:05FromDiscord<Elegant Beef> And image previewing
04:58:09*FromGitter * zacharycarter is confused
04:58:11leorize[m]alacritty is fast and the configuration is simple
04:58:13leorize[m]also it has native wayland support
04:58:25PrestigeOkay wayland is a good reason
04:58:28leorize[m]`st` on the other hand is a pita with how it handles backspace/delete
04:58:45FromDiscord<Elegant Beef> Is is what i had before i took my break↵https://streamable.com/5pzu7
04:58:48PrestigeHm I've heard of people having issues with that, but haven't witnessed it myself
04:58:49FromDiscord<Elegant Beef> Before realising PTY
04:58:55FromDiscord<Elegant Beef> (edit) 'Before realising PTY ... ' => 'Before realising PTYis needed'
04:59:15FromGitter<zacharycarter> who banned you from discord Beef?
04:59:22leorize[m]also configuring `st` is a pain
04:59:28FromDiscord<Elegant Beef> No one it was a joke
04:59:35FromGitter<zacharycarter> oh okay
05:00:05Prestigeleorize[m]: yeah it's not great having to patch the source code, pretty dumb. but once I got it to a working state, I don't have to touch it anymore
05:00:29leorize[m]well you still have to update it
05:00:47leorize[m]and then some of the patches can't be mixed together
05:01:00PrestigeThey can't?
05:01:51leorize[m]yea, since everything happens in config.h and/or certain other areas, if multiple patches touches them they won't be composable
05:02:27PrestigeOh you mean automatically - yeah, I just resolve the merges by hand
05:02:32leorize[m]I mean they can, if you spend time to fix the conflicts
05:03:12leorize[m]but then backspace just give up on you whenever you ssh elsewhere
05:03:59leorize[m]and unless you use the sacred `st` terminfo file (which many of the machines you ssh into won't have), you're pretty much screwed
05:04:03PrestigeI wonder what that's about, I don't have any issues with backspace
05:04:24PrestigePerhaps that's why
05:04:37leorize[m]https://wiki.archlinux.org/index.php/St#Keyboard
05:04:38PrestigeI tried alacritty and kitty and dislike them
05:04:43leorize[m]you need to switch to keypad mode
05:04:51leorize[m]and many programs/shells can't do this
05:05:01leorize[m]fish can't for example
05:05:05leorize[m](though they probably fixed that by now)
05:05:39PrestigeWould be nice to have a more user-friendly version of st but still be able to hack on it
05:06:00leorize[m]well you mastered X in Nim :P
05:06:16leorize[m]maybe you can invent a sensible terminal emulator?
05:06:18leorize[m]:D
05:06:23PrestigeI edited mine to call a bash script with the contents of the terminal as an argument, so you can do w/e with the contents. That's the main funcitonality I'd like to see in other tems
05:06:25Prestigeterms*
05:07:03PrestigeI suppose but I'm happy with st for now.. dwm kept crashing for me and awesome had a mem leak, that's why I'm writing nimdow
05:07:36*dadada__ quit (Ping timeout: 256 seconds)
05:07:41FromDiscord<Elegant Beef> Well prestige figure out PTYs and how to handle them and then work on a GPU based terminal with me 😄
05:08:56PrestigeHaha maybe way down the road... have a couple commitments after I get nimdow to a decent state
05:09:20PrestigeNeed to contrib to nimlsp and also work on a side project to make money
05:12:07*zacharycarter quit (Ping timeout: 256 seconds)
05:13:17FromDiscord<Elegant Beef> Biggest issue was i naively thought that CLI applications like vim used their stdin stream for inputs from the terminal
05:13:23FromDiscord<Elegant Beef> So i could not control anything like that
05:13:44*dadada joined #nim
05:13:47FromDiscord<Elegant Beef> Which i now know is cause you need a pty and use that how ever it's supposed t obe
05:13:49FromDiscord<Elegant Beef> (edit) 't obe' => 'to be'
05:14:08*dadada is now known as Guest7881
05:18:00leorize[m]well I mean you can implement vim with just the stdin stream
05:18:01leorize[m]switch it to raw mode and you're pretty much set
05:18:50FromDiscord<Elegant Beef> Yea but it's pretty much all applications that dont use the stdin for inputs
05:19:16FromDiscord<Elegant Beef> So me sending the inputs to those does fuckall
05:19:52FromDiscord<Elegant Beef> So the obvious solution is to look at proper implementation
05:19:58FromDiscord<Elegant Beef> Instead of the what i have
05:20:26FromDiscord<Elegant Beef> But im too daft to figure out how to implement the pty stuff in nim, or wrap the C stuff
05:20:46leorize[m]`man 7 pty`
05:21:03leorize[m]it's really descriptive
05:21:48FromDiscord<Elegant Beef> You underestimate my daftness
05:23:00FromDiscord<Elegant Beef> Could it be done in pure nim?
05:23:27FromDiscord<Elegant Beef> Since it is just file opening/getting handles
05:23:59leorize[m]yes
05:24:22leorize[m]you should obviously write a wrapper library for it, though
05:28:17PrestigeI've finished implementing floating windows in nimdow, woo. About time
05:30:49FromDiscord<Elegant Beef> Now why would you go and say a thing like that leo, writting wrappers scares me
05:31:24FromDiscord<Elegant Beef> Mostly cause all of the C/C++ code i've ever read feels like sandpaper across the retina
05:31:32FromDiscord<Elegant Beef> Nice prestige
05:31:38Prestigety ty
05:31:53FromDiscord<Elegant Beef> Also do me a favour and implement scrolling workspaces on a screen
05:32:04PrestigePeople use that?
05:32:08FromDiscord<Elegant Beef> IE mod4+1 = scroll monitor 1's workspaces
05:32:12FromDiscord<Elegant Beef> I did on i3wm
05:32:16FromDiscord<Elegant Beef> It's so nice imo
05:32:36FromDiscord<Elegant Beef> had all evens on monitor 2, and odds on monitor 1
05:32:57FromDiscord<Elegant Beef> then just just scroll through workspaces
05:33:05FromDiscord<Elegant Beef> It's actually quite nice
05:33:26FromDiscord<Elegant Beef> Since i dont really like more than 5 work spaces per monitor anyway
05:34:56Prestigeoh do you mean the scroll wheel would change workspaces? At first I thought you meant like a scrolling viewport, like a browser on a webpage
05:35:14*narimiran joined #nim
05:35:31FromDiscord<Elegant Beef> My setup had me iterating over workspaces when i hit `mod4 + 1` for monitor 1
05:35:42FromDiscord<Elegant Beef> `mod4 + 2` iterated over monitor 2 work spaces
05:36:13FromDiscord<Elegant Beef> mod4 + shift + monNum would iterate in reverse
05:37:04FromDiscord<Elegant Beef> It's slower than the normal number workspace movement but it also requires few keys
05:37:14*Guest7881 quit (Ping timeout: 240 seconds)
05:37:39FromDiscord<Elegant Beef> So you can actually get easier access to all workspaces above 5
05:38:01FromDiscord<Elegant Beef> Make sense?
05:38:43PrestigeYeah, I think I know what you mean... If I can hook into scroll wheel events I think that would be very easy to do with the config file
05:38:58FromDiscord<Elegant Beef> Scroll wheel sucks!
05:39:15PrestigeOkay I guess I don't know what you meant lol
05:39:23PrestigeI thought u were talking about using your scroll wheel
05:39:33FromDiscord<Elegant Beef> Ok so like scroll wheel but using your super + monitor number
05:39:41FromDiscord<Elegant Beef> Each hit will move it to the next on
05:39:42FromDiscord<Elegant Beef> (edit) 'on' => 'one'
05:40:21PrestigeRight, each "click" of the scroll wheel changes your workspace number, right?
05:40:33FromDiscord<Elegant Beef> Well im not talking about mouse
05:40:40FromDiscord<Elegant Beef> But yea
05:40:42FromDiscord<Elegant Beef> Similar logic
05:40:47FromDiscord<Elegant Beef> Just with keybind locked to monitor
05:41:27FromDiscord<Elegant Beef> sent a code paste, see http://ix.io/2nZY
05:41:39PrestigeOh, so like pressing mod4 + 1 multiple times?
05:41:54FromDiscord<Elegant Beef> Yea instead of using mod + (1-0)
05:42:16FromDiscord<Elegant Beef> Turns it into 2 button workspace movement
05:42:16PrestigeYeah I could add that very easily
05:42:29FromDiscord<Elegant Beef> I had to write a script for i3wm when i did that
05:42:41FromDiscord<Elegant Beef> It's very nice imo
05:43:05Prestigeso do you have another binding for going backward, or selecting a specific workspace number?
05:43:44*dadada__ joined #nim
05:43:52FromDiscord<Elegant Beef> yea i typically use shift to reverse
05:44:31PrestigeI'd just have to create a function to cycle through workspaces and you could add the keybinding to the config file, would take like 3 mins to add
05:44:35*zacharycarter joined #nim
05:45:05FromDiscord<Elegant Beef> then mod+ctrl+num to move to
05:45:32FromDiscord<Elegant Beef> It makes it way more compact
05:46:04FromDiscord<Elegant Beef> (edit) 'then mod+ctrl+num to move ... to' => 'then mod+ctrl+num to movewindow'
05:48:54*zacharycarter quit (Ping timeout: 240 seconds)
05:55:06PrestigeI've been contemplating having a nested workspace system
05:55:20Prestigeeach workspace will have 1-9 sub-workspaces
05:55:54leorize[m]nested workspace seems like a mess to maintain imo
05:56:11leorize[m]i3 tabbed thingy works better
05:56:30PrestigeI wasn't a huge fan of that since it took up more screen space
05:57:28leorize[m]well the only space it took was the tab bar
05:57:31leorize[m]you can make it so that you can hide that tab bar?
05:58:06PrestigeThe way I'd want my system to work, you'd by default have the normal 1-9 workspaces and wouldn't even be aware of nested workspaces existing. Pressing some key binding (let's say mod1 + mod4 + {num}) would take you to your next nested workspace system. So on one monitor you'd effectively have 81 workspaces, but it would be easy to manage
05:58:21PrestigeKind of hard to explain
06:03:59PrestigeI suppose if you think of tags 1-9 as a one dimensional array, my system is a 2D array of tags (selecting one row to be visible at a time)
06:05:35bung_how to return a copy of openArray[T] ?
06:07:30*dadada__ quit (Ping timeout: 256 seconds)
06:07:48FromDiscord<Elegant Beef> Isnt openArray only an input parameter?
06:07:58PrestigeI mean you can just assign a var to another array/seq and it copies
06:09:00*solitudesf joined #nim
06:09:21PrestigeLike: https://play.nim-lang.org/#ix=2o02 but if you're trying to copy an input param I think it would work the same. Just assign result to the input?
06:11:11bung_hmm cant assign it dirctly
06:11:18Prestigecode example?
06:11:20bung_`Error: type mismatch: got <openArray[int]> but expected 'seq[int]`
06:12:33bung_well, I add it one by one
06:13:18Prestigetry https://play.nim-lang.org/#ix=2o02 ?
06:13:28leorize[m]use `@` to convert openArray into seq
06:13:38PrestigeIf you can show an example of what you're doing I can prolly help better
06:13:44*dadada joined #nim
06:14:07*dadada is now known as Guest47792
06:20:33bung_oh that's helpful
06:21:21bung_thought it only can be using when initialize seq
06:21:32Prestigewhat do you mean?
06:21:40Prestigeoh I misread
06:22:22bung_found the document, it's a proc ..
06:30:43*arecaceae quit (Remote host closed the connection)
06:31:07*arecaceae joined #nim
06:38:01*Guest47792 quit (Ping timeout: 264 seconds)
06:43:45*dadada__ joined #nim
06:50:14FromDiscord<Zed> PMunch: is nimlsp stable? when installing with nimble im getting a failed build
06:50:53FromDiscord<Yardanico> @Zed yes
06:51:00FromDiscord<Yardanico> It should work, what's the error?
06:51:34FromDiscord<Zed> Build failed for '[email protected]'
06:51:43FromDiscord<Yardanico> nimble install --verbose nimlsp
06:52:09FromDiscord<Zed> same thing
06:52:27FromDiscord<Yardanico> Well I don't really know how to make it output the error
06:53:08FromDiscord<Yardanico> But nimlsp itself works, I know that for sure :P
06:53:24FromDiscord<Yardanico> What about nimble install nimlsp --verbose
06:53:33FromDiscord<Yardanico> There should be an error message itself
06:53:39FromDiscord<Yardanico> Just post full output
06:54:35FromDiscord<Zed> sent a long message, see http://ix.io/2o08
06:54:47FromDiscord<Yardanico> Huh
06:55:19FromDiscord<Yardanico> Well you can try cloning nimlsp and then nim c src/nimlsp.nim to check the error that way
06:59:11Araqnimble install --verbose nimlsp
06:59:15FromDiscord<Zed> so it seems like nimsuggest is not installed
06:59:15Araqor maybe
06:59:26Araqnimble --verbose install nimlsp
07:00:16FromDiscord<Yardanico> @Zed nimsuggest is a part of the compiler
07:00:17FromDiscord<Zed> ill reinstall nim
07:00:26FromDiscord<Yardanico> Nimlsp imports the compiler
07:00:54FromDiscord<Zed> nimlsp was looking for a nimsuggest directory
07:01:01FromDiscord<Zed> which doesn't exist
07:01:24FromDiscord<Yardanico> oh well, it should exist, yes
07:01:25FromDiscord<Rika> What did you use to install nim
07:01:30FromDiscord<Zed> brew
07:01:33FromDiscord<Yardanico> Huh
07:01:41FromDiscord<Zed> nims up to date
07:01:47FromDiscord<Yardanico> well yeah sometimes packaged Nim doesn't work correctly
07:01:51FromDiscord<Yardanico> Try choosenim
07:02:01FromDiscord<Yardanico> And it's not Nim's fault :P
07:03:02FromDiscord<Zed> ill test that out now
07:07:30*endragor quit (Remote host closed the connection)
07:07:45*dadada__ quit (Ping timeout: 256 seconds)
07:07:59FromDiscord<Zed> Alright, choosenim did the trick!!
07:08:13Araqthe idea of "packaging" by cracking a package's file structure and distributing it over /usr is fundamentally broken. It'll never work, we're trying this experiment for 50 years now.
07:08:38Araqsee also "Nimble cannot build docs"
07:08:48FromDiscord<Yardanico> Well there are some ways like macOS structure
07:09:00FromDiscord<Yardanico> Or Gobo Linux which has a custom filesystem hierarchy as well
07:09:12FromDiscord<Yardanico> There each package is just a different directory
07:09:19Araqyeah but brew follows Unix
07:13:23FromDiscord<Zed> it's really annoying how brew hides everything from you
07:13:45*dadada__ joined #nim
07:16:53*endragor joined #nim
07:37:34*dadada__ quit (Ping timeout: 240 seconds)
07:43:33bung_is there another way using seq backward index ? can i use a negtive number?
07:43:41*dadada joined #nim
07:44:04*dadada is now known as Guest99609
07:44:09bung_I cant literally using `^`
07:44:43Yardanicobung_: why?
07:44:48Yardanicowell there's a way
07:45:08Yardanico"yourseq.high" - backwardsIndex
07:45:32Yardanico!eval let a = @[1, 2, 3, 4, 5]; echo a[a.high - 2]
07:45:34NimBot3
07:47:21bung_it's a negtive or positive number
07:47:43bung_I guess I need if else
07:48:37Yardanicobung_: why can't you just use ^ though?
07:48:49bung_index is a param
07:48:53Yardanicosoo?
07:49:25bung_could be positive or negtive number
07:49:31Yardanicowell you need an if/else anyway
07:49:32Yardanicoeven with ^
07:49:42Yardanicoactually it's simpler
07:49:51Yardanicoif num < 0: num = yourseq.high - num
07:49:58Yardanicoor something like that
07:49:58Araqor come up with a ^^ operator :-)
07:50:10bung_what's that
07:50:28bung_idk , but python pass it directly
07:53:55Yardanicobung_: for indexing with negative value you can just make a simple template
07:54:21Yardanicohttps://play.nim-lang.org/#ix=2o0l :D
07:56:22bung_oh , yeah I can implement an operator.
08:10:12narimiran"^ is hard to type"
08:10:59FromDiscord<Rika> Anything is hard to type given a sufficiently odd keyboard layout
08:11:15FromDiscord<Rika> ***eyes the JIS layout***
08:17:37*zacharycarter joined #nim
08:22:30*zacharycarter quit (Ping timeout: 272 seconds)
08:30:41FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> How about one with just two switches, 0 and 1
08:30:53FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> How hardcore of a hacker are you? 🙂
08:43:08*Vladar joined #nim
09:01:10*aeverr joined #nim
09:04:26ZevvI'm always annoyed by the line "they cannot change Nim's syntax. However, this is no real restriction because Nim's syntax is flexible enough anyway.". Can we take that out?
09:04:38FromDiscord<Rika> Why?
09:05:01*aeverr_ quit (Ping timeout: 265 seconds)
09:05:05FromDiscord<Rika> Can you explain why you think it should be taken out
09:05:16Yardanico@Rika because people confuse the terms sometimes
09:05:18Zevvit's subjective; I've found the syntax lacking more then once
09:05:28Zevvwell, not "lacking", but not flexible enough for what I'm trying to express
09:05:50FromDiscord<Rika> Maybe it would be better to reword it then
09:06:02Zevvfair enough
09:08:03dom96make a PR
09:08:23Zevvsure
09:13:46*zacharycarter joined #nim
09:17:01*solitudesf quit (Ping timeout: 264 seconds)
09:18:10*zacharycarter quit (Ping timeout: 246 seconds)
09:19:59*bung_ quit (Ping timeout: 260 seconds)
09:24:13ZevvHm I'd like to call a code block with both an untyped and a typed macro, but without having two explicit macro block calls - is that possible somehow?
09:24:59Zevv s/call with/pass to/
09:37:33*konvertex joined #nim
09:38:01*koltrast_ joined #nim
09:38:23*koltrast quit (Ping timeout: 246 seconds)
09:38:59*Vladar quit (Quit: Leaving)
09:40:55*Guest99609 quit (Ping timeout: 246 seconds)
09:43:48*dadada joined #nim
09:43:59*luis_ joined #nim
09:44:11*dadada is now known as Guest19536
09:45:36FromDiscord<Tuxifan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716950558732189786
09:45:51FromDiscord<Tuxifan> (edit) 'http://ix.io/2o0O' => 'http://ix.io/2o0P'
09:46:12FromDiscord<Tuxifan> (edit) 'http://ix.io/2o0P' => 'http://ix.io/2o0O'
09:46:52FromDiscord<Tuxifan> When I remove the newline argument it works
09:47:31FromDiscord<Tuxifan> (edit) 'http://ix.io/2o0O' => 'https://discordapp.com/channels/371759389889003530/371759389889003532/716950558732189786'
09:48:28FromGitter<bung87> I checked zevv PR, thats funny
09:49:03FromDiscord<Rika> @Tuxifan maybe you are not flushing the file
09:49:09FromDiscord<Rika> Do stdout.flushfile
09:49:15FromDiscord<Rika> Or what's it called
09:49:22FromDiscord<Rika> Dunno but yeah something like that
09:49:25FromDiscord<Tuxifan> I just found out the "world" goes into newline instead of words
09:49:33FromDiscord<Tuxifan> (edit) 'newline' => '`newline`' | 'words' => '`words`'
09:49:45FromDiscord<Rika> Yeah that's the next thing I was gonna point out
09:49:51FromDiscord<Tuxifan> So how do I avoid that?
09:49:56FromDiscord<Rika> I don't think varargs are greedy
09:50:05FromDiscord<Rika> Make newline a character
09:50:11FromDiscord<Tuxifan> Oh right
09:50:23FromDiscord<Tuxifan> But what else insted of vaargs would you recommend?
09:50:32FromDiscord<Rika> '\n' but then that makes it impossible to print \r\n as newline
09:50:38FromDiscord<Rika> Uh
09:50:55FromDiscord<Rika> No clue really
09:51:08FromDiscord<Recruit_main707> use stdout.writeLine
09:51:15FromDiscord<Recruit_main707> idk
09:51:22FromDiscord<Tuxifan> Yeah but that disallows setting newline
09:51:28FromDiscord<Rika> Maybe delegate newline to an enum instead "nlDos" and "nlUnix" and print the characters depending on the enum
09:51:44FromDiscord<Tuxifan> What is an enum?
09:51:50FromDiscord<Tuxifan> Oh right
09:51:53FromDiscord<Tuxifan> nvm
09:51:57FromDiscord<Rika> Read more of the manual :P
09:52:07FromDiscord<Tuxifan> I just remembered 😛
09:58:11FromDiscord<Tuxifan> is↵```nim↵thestring = thestring & anotherstring↵```he right way to append to string?
09:58:42FromDiscord<Rika> Yeah
09:59:27*solitudesf joined #nim
09:59:43FromDiscord<Tuxifan> Isn't there something like `thestring.append(anotherstring)` or `thestring += anotherstring`?
09:59:50FromDiscord<Rika> Oh lord, now I'm kinda compelled to program on my phone
09:59:55narimiran&=
09:59:58FromDiscord<Rika> Technicae, why
10:00:20FromDiscord<Tuxifan> Even C++ implements .append(), it simply looks less ugly
10:00:41*bung joined #nim
10:00:42FromDiscord<Rika> Narimiran just gave you the answer
10:00:47FromDiscord<Tuxifan> Oh
10:00:58FromDiscord<Tuxifan> I did not see it, thx Narimiran!
10:01:31FromDiscord<Tuxifan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716954574707097660
10:02:54*NimBot joined #nim
10:03:10FromDiscord<Recruit_main707> or numbers.add
10:03:13FromDiscord<Tuxifan> how can I evaluate a const string at compile time?
10:04:12FromDiscord<Rika> What do you mean
10:04:37FromDiscord<Recruit_main707> i guess he wants to do that same thing at compile time for instance
10:04:48FromDiscord<Recruit_main707> same thing as an example
10:06:12FromDiscord<Rika> sent a long message, see https://discordapp.com/channels/371759389889003530/371759389889003532/716955748378083379
10:07:14*Guest19536 quit (Ping timeout: 240 seconds)
10:07:22FromDiscord<Tuxifan> Ahhh, thx
10:07:41FromDiscord<Tuxifan> How do I tell nim to transpile to jaavscript?
10:08:00FromDiscord<Recruit_main707> nim js
10:08:01FromDiscord<Rika> nim js
10:08:02FromDiscord<Rika> Fuck
10:08:11FromDiscord<Rika> Guess I'll die
10:08:19alehander92morning
10:08:30alehander92yeah if you need to be for browser nim js
10:08:32FromDiscord<Recruit_main707> hello
10:08:38alehander92if for node env nim -d:nodejs js
10:08:43FromDiscord<Tuxifan> thx
10:08:48alehander92rika whats the problem
10:08:51alehander92you will live
10:09:03FromDiscord<Recruit_main707> i said it before her
10:10:34alehander92zevv
10:10:38FromDiscord<Rika> im not super serious
10:10:39alehander92Araq i had a question
10:10:48Zevvalehander92 zup
10:11:49alehander92hello!
10:11:55alehander92i see a question in your repo
10:11:57alehander92and it reminds
10:12:01Zevvoh I got tons more :)
10:12:02alehander92if we have macros everyuwhere
10:12:07alehander92e.g. async currently etc
10:12:35alehander92can we build hypothetically a native build with some of them natively-applying over PNodes
10:12:45alehander92instead of interpretting
10:13:00alehander92something like a naive version of jitt-ing(but different)
10:13:11Zevvpfff dude, that's going way deeper already
10:13:17alehander92my point is
10:13:41alehander92why would one always interpret all that vm code if it stays the same and its used for so many of the functions
10:13:52*dadada__ joined #nim
10:13:55alehander92yeah its not a suggestion for now
10:14:14alehander92just wondering if people do that somewhere
10:14:23alehander92maybe just jitting is simpler
10:14:27ZevvThe problem I'm currently running into is that at macro level, either pre or post semcheck, I don't have access all the info I need to do this transformation.
10:14:37alehander92yeah yeah its a different problem
10:15:24ZevvI should probably not be even tryingto do this with macros, but I don't see myself hacking in the compiler anytime soon, at this level
10:17:07*luis_ quit (Quit: luis_)
10:20:15alehander92why
10:20:51alehander92its similar!
10:21:40Zevvbut too early, there's things I can't see, like local vars injected by templates.
10:21:50ZevvI only see the template call, but not what it expands to
10:21:55alehander92i mean
10:22:03alehander92the compiler passes are similar
10:22:14alehander92not so hard to work on
10:22:24alehander92with some guidance
10:22:31ZevvOh, its just tedious. Harder to debug, long time from code edit to run
10:22:46Zevvand its new stuff I need to learn. I hate learning new stuff
10:23:07alehander92you can actually attach a debugger to the compiler :D
10:23:24alehander92and our disruptek's IC would make it so fast to edit/run
10:24:31Zevvoh what's that, I missed that I think?
10:24:43ZevvI've been neglecting #nim for a month or two
10:25:35FromDiscord<Tuxifan> Damn these docs are really complex, I simply can't find what I am searching for
10:25:45FromDiscord<Rika> Tell us then
10:25:47FromDiscord<Tuxifan> How do I use importjs?
10:25:51FromDiscord<Rika> We might know what you're looking for
10:25:52FromDiscord<Rika> ?
10:26:00FromDiscord<Tuxifan> See above
10:26:05alehander92zevv what's IC?
10:26:13FromDiscord<Rika> What's importjs
10:26:32FromDiscord<Tuxifan> Whatever it was called, it was to use js functions in nim
10:26:34Zevvalehander92: I don't know, I'm asking you :) *you* said "disruptek's IC"!
10:26:34alehander92its like importcpp
10:26:42alehander92yeah the incremental compilation
10:26:44alehander92thing
10:26:45FromDiscord<Tuxifan> (edit) 'use' => 'import'
10:26:46Zevvoh right
10:26:52alehander92but yeah its some work
10:26:56Zevvhas disruptek been working on that? \o/
10:26:56FromDiscord<Rika> Oh you mean that
10:27:00alehander92yeah?
10:27:04Zevvwow
10:27:06alehander92you really havent been following
10:27:07FromDiscord<Rika> It's a pragma
10:27:09alehander92along :D
10:27:16alehander92there is a PR.
10:27:17FromDiscord<Tuxifan> So how do use it? I found the usage once but now I can't refind it
10:27:20alehander92but not sure what happened
10:27:26Zevvnot at all. My head was kind of full with other stuff
10:27:31Zevvanyway, lunchy time - all about priorities!
10:27:43alehander92yeah, i am also eating!
10:27:47alehander92see ya
10:28:12FromDiscord<Rika> @Tuxifan maybe look at the importc or importcpp pragmas
10:28:13FromDiscord<Rika> Same usage afaik
10:28:17FromDiscord<Tuxifan> okay!
10:28:45FromDiscord<Tuxifan> Where is the importc documentation???
10:29:01FromDiscord<Tuxifan> These docs are horrible to find stuff in, sorry to say that
10:29:34FromDiscord<Tuxifan> I type in importc and get macros
10:29:49FromDiscord<Recruit_main707> use ctrl f
10:29:54FromDiscord<Rika> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
10:30:16FromDiscord<Tuxifan> thx
10:30:22alehander92look at
10:30:24alehander92the importcpp for procs
10:30:34alehander92i think its the most applicable to js as well but i might be wron g
10:30:44alehander92i use it mostly for that
10:31:10FromDiscord<Tuxifan> Hmm, what I have seen about js was much easier
10:31:15FromDiscord<Tuxifan> (edit) 'js' => 'importjs'
10:31:25FromDiscord<Tuxifan> If I only could find it in these docs again…
10:32:12FromDiscord<Rika> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importjs-pragma ?
10:32:12FromDiscord<dom96> Pretty sure if importjs is a thing that it's an alias for importcpp
10:32:24FromDiscord<Rika> It kinda is right now yeah
10:33:26*fredrikhr joined #nim
10:33:31FromDiscord<Tuxifan> > https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importjs-pragma ?↵@Rika ↵yes
10:33:58FromDiscord<Tuxifan> But there was another site where I have seen the simplest method…
10:35:13FromDiscord<Recruit_main707> it was maybe {.emit: readAll("file.js").}↵proc function*(args) {.nodecl.} ?
10:35:33FromDiscord<Tuxifan> I think so
10:35:45FromDiscord<Tuxifan> But it imported the entire object
10:36:05FromDiscord<Tuxifan> So you could use all it's functions
10:36:31FromDiscord<Recruit_main707> could you try to find it again?
10:36:45FromDiscord<Tuxifan> I am
10:37:16*dadada__ quit (Ping timeout: 246 seconds)
10:40:09FromDiscord<Tuxifan> does the documentation probably have a git repo?
10:43:45*dadada joined #nim
10:44:07*dadada is now known as Guest90629
10:45:07FromDiscord<Tuxifan> https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-javascript<
10:45:07*lritter quit (Quit: Leaving)
10:45:08FromDiscord<Tuxifan> (edit) 'https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-javascript<' => 'https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-javascript'
10:45:22FromDiscord<Tuxifan> Not exactly the same
10:45:26FromDiscord<Tuxifan> But at least easy to use
10:45:40FromDiscord<Tuxifan> btw are there any nim capable IDEs?
10:46:30FromDiscord<Tuxifan> Also how would I use as example window.alert if all I can import is a single function?
10:50:30*aexoxea joined #nim
10:51:46*aexoxea left #nim (#nim)
11:01:50dom96take a look at the dom module
11:01:52dom96see how it wraps things
11:01:54dom96it wraps alert iirc
11:04:24*Vladar joined #nim
11:07:50*Guest90629 quit (Ping timeout: 256 seconds)
11:09:49*jwm224 quit (Ping timeout: 246 seconds)
11:11:17*jwm224 joined #nim
11:11:21FromDiscord<Tuxifan> ah, there is a dom module? good to know, thx
11:12:31FromDiscord<Tuxifan> How can I define an array with procedures?
11:12:37FromDiscord<Rika> ?
11:12:43FromDiscord<Rika> what do you mean
11:12:50FromDiscord<Tuxifan> I want to create an array of procedures
11:13:12FromDiscord<Recruit_main707> why though
11:13:35FromDiscord<Rika> you can do that but they must have the same arguments and return type
11:14:05FromDiscord<Tuxifan> I want to run functions in a row, so some module can simply add its function to the array
11:14:12FromDiscord<Tuxifan> Sorry it wasn't called array
11:14:13FromDiscord<Rika> see what i just said 😛
11:14:18FromDiscord<Tuxifan> how was it called?
11:14:21FromDiscord<Rika> sequence
11:14:24FromDiscord<Tuxifan> Ahh, thx
11:14:35FromDiscord<Tuxifan> And how would that look like?
11:14:45FromDiscord<Tuxifan> (The variable definition)
11:14:46*couven92 joined #nim
11:14:56FromDiscord<Rika> var a: seq[proc()] ↵for procs w/o args and return type
11:15:15FromDiscord<Recruit_main707> var a: seq[proc()] = @[]
11:15:16FromDiscord<Rika> proc(a: string): string↵for 1 str arg and str return
11:15:28FromDiscord<Tuxifan> Ahhh, thx a lot
11:15:29FromDiscord<Rika> name of args dont matter here
11:15:45ZevvIs this a bug? http://ix.io/2o1e
11:15:46FromDiscord<Tuxifan> Does nim have something like dicts/maps
11:15:46FromDiscord<Tuxifan> (edit) 'dicts/maps' => 'dicts/maps?'
11:15:51FromDiscord<Recruit_main707> you probably need to specify the default pragmas (for some reason)
11:15:51ZevvAgain struggling with mangling in macros
11:15:57FromDiscord<Rika> @Tuxifan tables
11:16:05FromDiscord<Tuxifan> okay, thx
11:17:23FromDiscord<Tuxifan> > var a: seq[proc()] ↵> for procs w/o args and return type↵@Rika↵How would I initialise tabls like that?
11:17:39FromDiscord<Rika> var a: Table[string, proc()]
11:17:54FromDiscord<Tuxifan> great, thx
11:17:54*fredrikhr quit (Ping timeout: 260 seconds)
11:17:56FromDiscord<Rika> i dont think you can hash closures so dont try making a key out of it
11:18:05FromDiscord<Yardanico> var a = newTable[string, proc()]
11:18:19FromDiscord<Tuxifan> thx
11:18:29FromDiscord<Tuxifan> > i dont think you can hash closures so dont try making a key out of it↵@Rika ↵Lol why would I do that?
11:18:34*dadada joined #nim
11:18:50FromDiscord<Rika> no clue
11:18:57FromDiscord<Rika> i'm scarred by people like technicae
11:18:57FromDiscord<Tuxifan> Okay xD
11:18:57*dadada is now known as Guest43589
11:19:07FromDiscord<Rika> and codic
11:19:27FromDiscord<Tuxifan> How can I load a .nim file by filename?
11:19:43FromDiscord<Yardanico> you mean import?
11:19:48FromDiscord<Tuxifan> I'd like to simply import all .nim files in a specific directory
11:19:57FromDiscord<Yardanico> Well, for that you'll need a macro
11:20:02FromDiscord<Tuxifan> One by one
11:20:14FromDiscord<Tuxifan> Okay, how would I do that?
11:20:25FromDiscord<Tuxifan> I am not really good at maacros
11:20:26FromDiscord<Tuxifan> (edit) 'maacros' => 'macros'
11:20:33FromDiscord<Yardanico> Something like this but you'll need to adapt it to your use case https://gist.github.com/Yardanico/60e3de6af76ee70d6023e1f6256fdf6b
11:20:38FromDiscord<Tuxifan> thx
11:20:39FromDiscord<Yardanico> This one is extracted from my project
11:22:31FromDiscord<Tuxifan> what does that to:↵```nim↵let folder = "src" / "modules"↵```?
11:22:53FromDiscord<Tuxifan> Is that division by string???
11:23:16FromDiscord<Yardanico> no
11:23:25FromDiscord<Yardanico> that's an / operator from os module
11:23:38FromDiscord<Yardanico> It connects path parts
11:23:51FromDiscord<Yardanico> So on Windows it'll make src\modules
11:23:59FromDiscord<Yardanico> on *nix src/modules
11:24:01FromDiscord<Yardanico> etc
11:24:09FromDiscord<Tuxifan> Ahhh, thx
11:24:43FromDiscord<Tuxifan> Why does that procedure return nothing?
11:24:46FromDiscord<Tuxifan> *macro
11:24:56FromDiscord<Yardanico> ?
11:25:01FromDiscord<Yardanico> It returns untyped
11:25:15FromDiscord<Yardanico> macros return Nim AST
11:25:48*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:26:12FromDiscord<Yardanico> macros can return typed or untyped, they're run at compile time
11:26:15*pbb joined #nim
11:26:34FromDiscord<Yardanico> Well I mean they can return normal types too
11:27:17*zacharycarter joined #nim
11:27:28FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#macros
11:31:38*zacharycarter quit (Ping timeout: 256 seconds)
11:32:46FromDiscord<Tuxifan> @Yardanico↵`Error: cannot open file: modules/test`↵seems like it's missing .nim at the end of the file name?
11:33:13FromDiscord<mratsim> you don't need .nim at the end
11:33:29FromDiscord<mratsim> unless it's when compiling?
11:33:40FromDiscord<Tuxifan> then why does it say cannot open file? the file exists
11:34:00FromDiscord<Rika> is the file youre importing from beside a modules directory
11:34:00FromDiscord<Tuxifan> but when I try to add .nim it changes to a /???
11:34:04FromDiscord<Tuxifan> (edit) '/???' => '/nim???'
11:34:11FromDiscord<Tuxifan> ye
11:34:12FromDiscord<Tuxifan> (edit) 'ye' => 'yes'
11:34:19FromDiscord<Rika> can we see the dir structure
11:34:39FromDiscord<Tuxifan> sent a code paste, see http://ix.io/2o1i
11:36:06FromDiscord<Tuxifan> yeahhh I know these filenames are not very meaningfull
11:36:16FromGitter<adnan338> Hi, sorry for the random question, considering the nature of how Nim code becomes assembly, will it be possible to map nim codes to generated assembly? For example, godbolt compiler explorer can map certain lines of a C program to generated assembly.
11:36:43FromDiscord<mratsim> compile with --debugger:native and you will have the mapping when using gdb
11:36:48FromDiscord<mratsim> Nim godbolt does this
11:37:14*Guest43589 quit (Ping timeout: 256 seconds)
11:37:15FromDiscord<mratsim> it's also picked up by perf, VTune, Apple Instruments
11:38:15FromDiscord<Yardanico> yeah, one bad thing is that nim on godbolt is broken
11:38:20FromDiscord<Yardanico> it doesn't run the program
11:38:32FromDiscord<Yardanico> only compile and output assembly
11:38:41FromGitter<adnan338> Thank you. I'm interested in godbolt highlighting personally. I hope it adds support to highlighting soon.
11:38:54FromDiscord<Yardanico> There's support already
11:39:13FromDiscord<Yardanico> add --debugger:native to compiler arguments
11:39:23FromDiscord<Yardanico> It should be like that by default I think
11:40:42FromGitter<adnan338> ^ wow that's great! Thank you. Yes I agree it should be the default
11:42:13*dddddd joined #nim
11:43:44*dadada__ joined #nim
11:45:32FromDiscord<Tuxifan> are there nim dom examples?
11:45:52FromDiscord<Rika> in the docs maybe
11:45:58FromDiscord<mratsim> Karax?
11:47:42FromDiscord<Tuxifan> > in the docs maybe↵@Rika ↵I could not find any
11:48:00FromDiscord<Tuxifan> How does that not work?↵```nim↵dom.Window.alert("hi")↵```
11:48:09*solitudesf quit (Quit: Leaving)
11:48:28FromDiscord<Tuxifan> These error messages looks worse than these from LD lol
11:48:31FromDiscord<Tuxifan> (edit) 'looks' => 'look'
11:48:35FromDiscord<Tuxifan> (edit) 'these' => 'those'
11:49:42FromDiscord<Tuxifan> Ah that does not exist
11:50:20FromDiscord<Rika> oh i see
11:50:22FromDiscord<Rika> i dont actually know
11:50:25FromDiscord<Tuxifan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716981977105825824
11:50:48FromDiscord<Rika> prolly its `window.alert("hi")`
11:51:00FromDiscord<Rika> you're passing in the type itself
11:51:04FromDiscord<Rika> not an instance
11:51:14FromDiscord<Tuxifan> ReferenceError: window is not defined
11:51:40FromDiscord<Yardanico> well where are you running it?
11:51:44FromDiscord<Yardanico> You should run it in the browser
11:51:54FromDiscord<Tuxifan> ohhh
11:51:55FromDiscord<Tuxifan> right
11:51:56FromDiscord<Tuxifan> oops
11:51:57FromDiscord<Tuxifan> thx
11:53:31FromDiscord<Tuxifan> Is the dom library able to work with all javascript functions, even those defined by modules like jquery and such?
11:53:43FromDiscord<Rika> see the jsffi module
11:53:50FromDiscord<Tuxifan> okay…
11:53:56FromDiscord<Rika> https://nim-lang.org/docs/jsffi.html
11:53:57FromDiscord<Rika> for a link 😛
11:56:31FromDiscord<Tuxifan> sent a code paste, see http://ix.io/2o1o
11:56:38FromDiscord<Tuxifan> (edit) 'http://ix.io/2o1o' => 'http://ix.io/2o1p'
11:56:46FromDiscord<Rika> use importjs i think
11:56:48FromDiscord<Rika> dunno really
11:56:52FromDiscord<Rika> i am just inferring really hard
11:56:58FromDiscord<Tuxifan> I simply took it from the docs
11:57:03FromDiscord<Rika> i know
11:57:08FromDiscord<Rika> docs prolly outdated
11:57:26FromDiscord<Tuxifan> So the docs have non-working examples? 🤔 🙄
11:58:22FromDiscord<Tuxifan> importjs causes the same
11:58:51FromDiscord<Rika> huh
11:59:30FromDiscord<Rika> try saying whats in the error
11:59:32FromDiscord<Rika> escaping $
11:59:34FromDiscord<Rika> `\$`
11:59:51FromDiscord<Tuxifan> ```↵Error: invalid character constant↵```
11:59:57FromGitter<bung87> require it is
12:00:30FromDiscord<Rika> we need someone who's experienced in the js platform lol
12:00:36FromDiscord<Tuxifan> 😕
12:00:38FromDiscord<Rika> we're mostly using nim's c backend
12:00:43FromGitter<bung87> only for language gen
12:01:02FromGitter<bung87> you need install throug npm
12:01:12FromDiscord<Rika> huh?
12:01:12FromDiscord<Tuxifan> I thought finally having found a good language to write my in-browser stuff in... 😢
12:01:32FromGitter<bung87> wrap that module like wrap cpp
12:01:41FromDiscord<Tuxifan> what do you mean?
12:02:33FromGitter<bung87> I mean it is only for js language level generating
12:02:52FromDiscord<Tuxifan> ahhh
12:03:04FromDiscord<Tuxifan> Yep, that's a good idea
12:04:47FromGitter<bung87> well ,for browser target It works well
12:04:56FromDiscord<Yardanico> You escape $ with two $$ I think
12:05:00FromDiscord<Yardanico> In importcpp
12:05:34FromDiscord<Yardanico> "In the example the external name of p is set to prefixp. Only $1 is available and a literal dollar sign must be written as $$."
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:49*supakeen joined #nim
12:07:06*rockcavera joined #nim
12:09:26FromDiscord<Rika> @Tuxifan ^
12:10:48FromDiscord<Tuxifan> ahhh, thx
12:11:02FromDiscord<Tuxifan> YES! That worked
12:23:28*couven92 is now known as fredrikhr
12:25:11FromDiscord<Tuxifan> how do I use jsffi to select an element by ID?
12:27:14FromDiscord<Rika> https://nim-lang.org/docs/dom.html#getElementById%2Ccstring
12:27:18FromDiscord<Rika> you use dom for that
12:27:32*Vladar quit (Ping timeout: 265 seconds)
12:39:27*NimBot joined #nim
13:10:21*zacharycarter joined #nim
13:11:51alehander92tuxifan yeah i use the js backend, it works fine
13:13:02dadada__https://forum.nim-lang.org/t/935 "Type forward declaration is currently not possible"
13:13:07dadada__does this still hold true?
13:13:22dadada__it's a pretty annoying limitation IMO
13:13:28dadada__if true
13:13:41alehander92you can use a reordering pragma to workaround it
13:14:11alehander92`{.experimental: "codeReordering".}` ?
13:20:06dadada__yeah, that seems to help, thanks alehander92
13:20:22dadada__then let's hope the experimental aspect will be dropped from it
13:20:26*dadada__ is now known as dadada
13:22:03alehander92afaik the macro / template thing makes it hard
13:22:39alehander92but maybe with a specified behavior it really shouldn't
13:25:18*dcmertens joined #nim
13:26:16dcmertensI'm reading through Nim in Action. I noticed that one of the string parsing examples "returns" four values, and does so by taking for "var" variables as input
13:26:38dcmertensis there any general advice for taking return variables as input, rather than returning and unpacking a tuple?
13:27:33dcmertenswhen doing such a practice, is there any notational way to indicate that you're using variables as returns?
13:27:50FromDiscord<Generic> yes, it's usually when it's faster to do so
13:28:02FromDiscord<Generic> so when you have some fatter object
13:28:06FromDiscord<Generic> like a seq or a string
13:28:22dcmertensAh
13:28:26FromDiscord<Generic> it's faster to pass in the var, to which the proc appens/changes something
13:28:34FromDiscord<Generic> no copy then has to be done
13:28:36alehander92erm, seq-s or strings are pointers
13:28:57dcmertensalehander92, when returning a string, is it copied by reference, then?
13:29:01alehander92but this is probably true for `object` types
13:29:11alehander92it's just a pointer internally
13:29:25FromDiscord<Generic> yes, but they own the pointer
13:29:44FromDiscord<Generic> so if they're assigned you often get a copy
13:30:22dcmertensis this all governed by the definition of the type as an object vs a ref object?
13:30:38alehander92afaik stuff can be copied, but if the compiler can prove its safe, it can directly pass it without copy
13:31:04alehander92Generic hm, so you're saying a proc argument copies the whole string
13:31:07dcmertensOK. So say I have an object on the stack. It'll be more efficient to send that object as an argument to the function than to assign it upon return from the function
13:31:31alehander92thanks for the thought, i should see how it works exactly
13:32:05dcmertensbut then if everything you're dealing with are refs, then they should all be on the heap, and it's all pointer copies
13:32:19FromDiscord<Generic> ref object and object are a bit different, as with ref object you only have a single pointer
13:32:52FromDiscord<Generic> and there may only be one object at the time pointing to the memory backing the seq/string
13:34:42FromDiscord<Generic> https://nim-lang.org/docs/manual.html#types-string-type
13:35:06FromDiscord<Generic> "The assignment operator for strings always copies the string. "
13:35:46alehander92sorry Generic
13:36:04alehander92what i dont get is, e.g. if i pass string `b` to `a` and it calls `a2` with it
13:36:17alehander92it doesn't seem to copy it
13:36:36alehander92ah this is the copy-if-needed thing
13:36:38alehander92probably
13:37:25FromDiscord<Generic> sure if you only pass in a string the copy isn't necessary
13:37:51alehander92hm, but we should get nrvo
13:37:53FromDiscord<Generic> but as soon as you modify the string you will get copies
13:38:00alehander92or we have it, never really checked that
13:38:37alehander92what was the difference between rvo and nrvo ?
13:38:51alehander92was it "named return value" ?
13:39:19FromDiscord<Generic> even with those optimisations, in my opinion it's better to pass the string in as var parameter, as it enforces the fastest usage
13:39:55alehander92i still think it leads to worse api-s though
13:40:15alehander92so if one can guarantee optimizations are possible with the right flags, this might be arguable
13:41:43FromDiscord<Generic> a similar problem, inplace vs outplace was solved with the dup macro
13:41:46FromDiscord<Generic> though you're right
13:42:18FromDiscord<Generic> var parameters are always clunkier to use
13:42:29FromDiscord<Generic> and don't make those beautiful one liners 🙂
13:42:41FromDiscord<Clyybber> And we have NRVO
13:42:51FromDiscord<Clyybber> Simply use return values
13:42:51alehander92i rarely see var params api-s in nim, so that's why i'd warn people before writing one
13:42:54alehander92ah ok
13:43:00FromDiscord<Generic> clybber does it even work with tuples?
13:43:03alehander92so does it matter if we use result or return
13:43:10FromDiscord<Clyybber> @Generic Not yet
13:43:20FromDiscord<mratsim> @Clyybber I thought it was `result` that triggered NRVO?
13:43:24FromDiscord<Clyybber> Yeah
13:43:27alehander92but not return?
13:43:50FromDiscord<Clyybber> Yeah, its NYI
13:43:56alehander92ah ok
13:44:07alehander92and i guess last statement is the same as `return` ?
13:44:12*Vladar joined #nim
13:44:17FromDiscord<Clyybber> Nope, its result
13:44:24alehander92ah interesting
13:44:49alehander92i wonder if nrvo can be applied n many levels
13:44:54alehander92e.g. if one returns a chain of calls
13:44:58FromDiscord<Clyybber> Yeah it can
13:45:01alehander92does this ellide all the way
13:45:09alehander92ok
13:46:21FromDiscord<Tuxifan> ```nim↵let logarea: TextAreaElement = getElementById("logarea")↵```How can TextAreaElement be undefined when I have imported dom?
13:47:54alehander92what does the error message says !
13:47:58alehander92say*
13:48:11alehander92type mismatch, right?
13:48:21*endragor quit (Remote host closed the connection)
13:48:39FromDiscord<Tuxifan> nope
13:48:46FromDiscord<Tuxifan> undeclared identifier
13:48:47alehander92hm, wait, it's an inherited type, sorry
13:49:47alehander92which version of nim do you use
13:50:00alehander92the definition is there since only ~3 months ago
13:50:47FromDiscord<Tuxifan> 1.0.6
13:50:55FromDiscord<Tuxifan> Compiled at 2020-02-27
13:51:37alehander92yeah that's probably older
13:51:43alehander92upgrade to 1.2.0
13:51:46FromDiscord<Tuxifan> Is there some ppa?
13:52:02FromDiscord<Tuxifan> I don't really like using these tarballs…
13:52:17alehander92you can use `choosenim` ? others know better
13:53:17FromDiscord<Tuxifan> I am compiling myself now
13:54:42alehander92just rebuilding the last `devel` is very easy in principle
14:01:16FromDiscord<Tuxifan> how to install the build?
14:01:27FromDiscord<Tuxifan> I ran build_all.* now
14:01:44FromDiscord<Tuxifan> but there is no makefile to do make install
14:04:21alehander92um, i think that should be all
14:04:37alehander92ah i see what you mean
14:05:10FromDiscord<Tuxifan> sent a code paste, see http://ix.io/2o1K
14:06:00FromDiscord<Tuxifan> I am getting a type mismatch now
14:06:02alehander92you just add it manually to path in config
14:06:03alehander92i think
14:06:11alehander92if you're not using a package
14:06:18FromDiscord<Tuxifan> I added to path
14:06:19FromDiscord<Tuxifan> done
14:06:23FromDiscord<Tuxifan> > I am getting a type mismatch now↵@Tuxifan ↵But this
14:06:25alehander92ok what does it say
14:06:33FromDiscord<Tuxifan> Error: type mismatch: got <Element> but expected 'TextAreaElement = ref TextAreaElementObj'
14:06:41FromDiscord<Tuxifan> (edit) 'Error:' => '```↵Error:' | 'TextAreaElementObj'' => 'TextAreaElementObj'↵```'
14:06:44alehander92well yeah
14:06:51alehander92because Element is a base class
14:07:00alehander92so Element isn't really a TextAreaElement
14:07:11FromDiscord<Tuxifan> How to get a TextAreaElement then?
14:07:18alehander92so you probably need to `(TextAreaElement)expr`
14:07:24FromDiscord<Tuxifan> ahh
14:07:36alehander92and then you shouldn't need the let a: <type> thing
14:07:42alehander92it's rarely needed
14:07:49FromDiscord<Tuxifan> ```↵Error: type mismatch: got <TextAreaElement> but expected 'ClassList = ref ClassListObj'↵```
14:07:49alehander92usually let a = expr should be fine
14:08:03FromDiscord<Tuxifan> But I need to access the text field
14:08:20FromDiscord<Tuxifan> Which does not seem to exist on simple element
14:08:21alehander92ok, you need to give more context buddy
14:08:31FromDiscord<Tuxifan> Oh sorry
14:08:43FromDiscord<Tuxifan> I want to edit the text inside a textarea
14:08:52alehander92you need to access `value` ?
14:09:03FromDiscord<Tuxifan> no, `text`
14:09:31alehander92is there such a field
14:09:46FromDiscord<Tuxifan> YesI think so
14:09:58FromDiscord<Tuxifan> (edit) 'YesI' => 'Yes'
14:10:09alehander92https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement
14:10:16alehander92this is in the nim dom docs at least
14:10:19alehander92it's `.value`
14:10:31*waleee-cl joined #nim
14:11:45FromDiscord<Tuxifan> Oh…
14:11:53FromDiscord<Tuxifan> Okay, when I was on another framework it was text
14:11:55FromDiscord<Tuxifan> Sorry
14:12:05FromDiscord<Tuxifan> Also how to append to the value?
14:12:21FromDiscord<Tuxifan> &= results in↵```↵Error: type mismatch: got <cstring, cstring>↵```
14:12:25alehander92well, let me check
14:12:29FromDiscord<Tuxifan> thx
14:12:30alehander92yeah, javascript strings are immutable
14:12:37alehander92so you have to re-assign
14:12:39alehander92the new value
14:12:55alehander92`.value = expr.value & stuff`
14:13:44FromDiscord<Tuxifan> mmh, looks ugly 😕
14:14:52FromDiscord<Tuxifan> wait, (type)expr is a cast?
14:16:03alehander92something like that, but only for stuff like inherited objects
14:16:13alehander92well, sorry, that's how javascript works
14:16:24alehander92you can write your own template which expands to this tho
14:16:50FromDiscord<Tuxifan> oh okay
14:17:12FromDiscord<Tuxifan> How can I convert a int into str?
14:17:16FromDiscord<Tuxifan> (edit) 'a' => 'an'
14:17:17alehander92`$`
14:17:22FromDiscord<Tuxifan> Ahhh, sorry
14:17:24FromDiscord<Tuxifan> Thx
14:17:25alehander92same for most types
14:17:27alehander92np
14:18:52*sacredfrog joined #nim
14:27:18*ftsf quit (Ping timeout: 256 seconds)
14:34:46dcmertensClyybber, what is NRVO?
14:35:07dcmertensI kinda get what it is by context, but it's not enough for Google to point me to docs/code
14:35:24dcmertensoh, wait, got it
14:35:36dcmertens"nim NRVO" is not enough to DUCKDUCKGO to figure it out
14:35:39dcmertensgoogle is all good
14:38:53dcmertensOk, my question still stands. NRVO is an acronym for... what?
14:42:07FromGitter<kaushalmodi> dcmertens: I have no clue on NRVO is, but I see that this was recently added to the manual: https://nim-lang.github.io/Nim/manual#procedures-nrvo
14:42:48dcmertensthanks! "named return value optimization"
14:44:06FromGitter<kaushalmodi> that's the extent of my knowledge of "NRVO".. I tried reading that section but made no sense to me
14:47:30FromDiscord<Tuxifan> Do classes in Nim work the same as in Python?
14:48:02alehander92i wonder if we can use
14:48:13alehander92some kind of macro-like languages for defining most optimizations
14:48:17dcmertensTuxifan, what on Earth does that mean?
14:48:18alehander92something like TR macros maybe
14:48:34dcmertensObject orientation has all kinds of corner cases
14:48:44dcmertensand surely Nim and Python will differ in those
14:49:05alehander92tuxifan i think no multiple inheritance in nim
14:52:30FromDiscord<Tuxifan> a omay
14:52:32FromDiscord<Tuxifan> (edit) 'omay' => 'olay'
14:52:34FromDiscord<Tuxifan> (edit) 'olay' => 'okay'
14:52:36FromDiscord<Tuxifan> (edit) 'a' => 'ah'
14:59:15*ben_ joined #nim
14:59:21FromDiscord<Tuxifan> is there some documenation on how classes work in Nim?
14:59:25*ben_ is now known as BehrangDadsetan
14:59:46*NimBot joined #nim
14:59:47disruptek~manual
14:59:48disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
15:00:07FromDiscord<Tuxifan> I'd really like to rewrite my Brython projects in Nim and I am heavily using Classes there…
15:00:21disruptekgo for it.
15:00:58FromDiscord<Tuxifan> All I can find on your linked site is "type classes"
15:01:12disruptekweird. it's almost like classes aren't a thing in nim.
15:01:26alehander92there is inheritance and all that jazz tuxifan
15:01:37alehander92so you could immitate most of your python class usage easily
15:01:44FromDiscord<Tuxifan> How does that work?
15:01:50alehander92but i'd offer you to also take a look at case objects!
15:01:54alehander92and other features
15:02:03alehander92to have a better toolset
15:02:03FromDiscord<Tuxifan> Okay, sounds interesting…
15:02:06alehander92as a nim developer
15:02:26disruptekwhy bother rewriting if you're just going to attempt to replicate semantics of working code?
15:02:31alehander92as inheritance usage is still quite less popular even if it happens
15:03:05alehander92yeah, i'd agree that learning other paradigms might be also a valid usage of rewriting
15:03:09FromDiscord<Tuxifan> > but i'd offer you to also take a look at case objects!↵@alehander92[IRC]#0000 ↵Can you send me a link? Yet another thing I can't find in teh docs…
15:03:16FromDiscord<Tuxifan> (edit) 'objects!↵@alehander92[IRC]#0000 ↵Can' => 'objects!↵@alehander92[IRC]#0000↵Can' | 'teh' => 'the'
15:03:34alehander92sorry
15:03:36alehander92https://nim-lang.org/docs/manual.html#types-object-variants
15:03:42alehander92i always forget how are they called
15:03:52FromDiscord<Tuxifan> > why bother rewriting if you're just going to attempt to replicate semantics of working code?↵@disruptek[IRC]#0000↵Because Brython is extremely slow and huge
15:03:57FromDiscord<Tuxifan> > https://nim-lang.org/docs/manual.html#types-object-variants↵@alehander92[IRC]#0000 ↵Thx
15:04:00alehander92they're very popular around nim code
15:04:19alehander92so you need to at least know how to use them to understand much of it
15:05:09alehander92they're basically similar to e.g. adt-s in functional languages/rust
15:05:32alehander92and useful in most cases where you actually dont need an "open" hierarchy
15:06:36alehander92something like https://stackoverflow.com/questions/870919/why-are-haskell-algebraic-data-types-closed
15:06:36FromDiscord<Tuxifan> Wait I send an example of what I need
15:07:47FromDiscord<Tuxifan> https://gitlab.com/niansa/Pythonlabs/-/blob/master/ide/ui.py↵What would be the best way to port such classes?
15:08:34dcmertensTuxifan, it's important to note that Nim does not tie methods to class definitions, and that sometimes takes a little head scratching for me
15:09:12FromDiscord<Recruit_main707> how much of a sin would be to use python to create tools like c2nim?
15:09:34FromDiscord<Recruit_main707> python counts with some impressive tools (such as c parsers) out of the box
15:09:47bung!repo webgui
15:09:48disbothttps://github.com/juancarlospaco/webgui -- 9webgui: 11Web Technologies based Crossplatform GUI Framework with Dark theme 15 30⭐ 5🍴 7& 1 more...
15:10:19dcmertensRecruit_main707, do whatever you want
15:10:28dcmertensbut bear in mind that Nim can't depend on having Python handy
15:10:59FromDiscord<Recruit_main707> we already depend on c/c++ compilers
15:11:20FromDiscord<Tuxifan> that repo you sent… Can it also work in a webbrowser?
15:11:20dcmertensTuxifan, do you use inheritance in the class you referred to above?
15:11:30FromDiscord<Tuxifan> no
15:12:17Araqif you want to improve c2nim, start with reading its source code
15:12:26bungam porting a sort algorithm lib , dont know why it test fails when seq contains negtive number
15:12:59dcmertensTuxifan: so then you have two orthogonal tasks in Nim. First create the data structure with all the fields, following https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
15:13:07FromDiscord<Recruit_main707> Araq: its not something i am considering in a close/middle future, this are all just hypothetical ideas i have
15:13:18dcmertensThen create the methods, which perhaps can start life as procs
15:13:39BehrangDadsetanThanks @leorize[m] I see now what is happening. because defined(macos) is true, nim tooling is assuming it's getting compiled by the XCode compiler and using its include files for MacOS. What instead seems to be happening is that I have another clang installed that uses a linuxy version of the include files. If nimble/nim assume that behavior macos-y behavior from the system includes, should we not pass -isysroot /Ap
15:13:39BehrangDadsetanplications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk when defined(macos) is true? So that what we are assuming in defined(macos) is consistent?
15:14:01FromDiscord<Recruit_main707> and even though i love a million times more nim than python, i have to admit it could fit better for things like this
15:14:23Araqthere is no shame in admitting it but it makes no sense
15:14:55dcmertensRecruit_main707, do not confuse library support with language fitness
15:15:02AraqI am not aware of production quality C++ parsers written in Python
15:15:03FromDiscord<Recruit_main707> i dont
15:15:28dcmertensok, then why do you way Python is a better fit?
15:15:35Araqand if you don't need "production quality" then c2nim's way of doing it isn't all that bad
15:15:35dcmertensThe only thing you referenced above was library support
15:16:19AraqBehrangDadsetan: 'defined(macos)' isn't the same as 'defined(macosx)', beware
15:16:19dcmertensRecruit_main707, I hope I am not coming across as a jerk. I am now quite curious why you think Python is a better fit
15:16:25alehander92recruit it really isn't a better tool
15:16:34FromDiscord<Recruit_main707> might have missunderstood that fitness
15:16:38Araqand probably 'defined(macos)' should die
15:16:39alehander92the best tools would be actual c compilers
15:16:45alehander92and they seem usable from nim as well
15:16:48alehander92e.g. libclang
15:16:57alehander92or stuff like treesitter
15:17:26alehander92(otherwise its a brave line of thinking, for some stuff it is still quite good, that's why there is nimpy i guess :D)
15:17:37BehrangDadsetan@Araq, my bad. Actually the code I was misquoting was 'const stdioUsesMacros = (defined(osx)...' in lib/system/ansi_c.nim#L120
15:18:06dcmertensRecruit_main707, language fitness is things like, "To implement algorithm X, Lang Y has feature Z that makes this easy."
15:18:46BehrangDadsetanI am wondering whether we can assume stdioUsesMacros without specifically pointing to the XCode system includes. Otherwise neither nim nor many other packages (such as nake) compile.
15:19:00dcmertensI believe there are many things Python can do that Nim can't, but I don't believe the would effect the language's ability to parse C code
15:19:25AraqBehrangDadsetan: what are you trying to do?
15:19:37Araqsorry I only recently joined #nim
15:19:54FromDiscord<Recruit_main707> xD
15:19:54BehrangDadsetan@Araq, compile nim 1.2 and run the example for nimx... that's all
15:20:29Araqah bummer # pkg2 "nimx", true, "nim c --threads:on test/main.nim"
15:20:40Araqwe disabled it. for some reason
15:20:46FromDiscord<Recruit_main707> dcmertens: ye, i my point was more of, you wouldnt really need to parse it, and just use some parser library alrady done
15:20:52Araqnarimiran: do you remember why?
15:21:21dcmertensRecruit_main707, right, that's library depth.
15:21:28dcmertensthat is a good reason to implement something in Python instead of Nim
15:21:38dcmertensbut it's not due to a language limitation of Nim
15:22:23dcmertensAnd, as a shim, implementing a useful Nim tool in Python is a good idea while you wait for the community to build up the library support
15:23:22BehrangDadsetan@Araq, currently when I run choosenim 1.2.0 it won't compile because it is looking for the __stderr symbol which is not defined in my /usr/local/include because it assumes I am using the XCode compiler and the XCode system includes
15:24:35BehrangDadsetanmy /usr/local/include and clang are from brew and apparently behave differently than the XCode system includes such as stdio.h
15:24:52Araqpatch io.nim and set stdioUsesMacros to false
15:25:04Araqbut how is this related to nimx?
15:25:31BehrangDadsetannimx has a dependency to nake and nake has the system issue with stdio.h differing
15:27:55Araqas I said, patch io.nim
15:28:48BehrangDadsetanwill try now. Need to download the sources of nim again as I don't know where choosenim downloads the sources before refusing to compile 1.2.0.
15:31:09narimiranyeah, nimx doesn't work with 1.2.x (and it is disabled on devel)
15:31:26narimirani don't remember by heart why/when we disabled it
15:36:01narimiranAraq: this is PR which disabled it: https://github.com/nim-lang/Nim/pull/14293
15:36:02disbotdiable nimx (CI failure)
15:36:11BehrangDadsetanOk. I should prefix this is my very first experience with Nim. Do I understand correctly I should stay clear of 1.2.0?
15:37:02disrupteki think it's wise to stick with 1.0.
15:37:07Araqyou can try 1.0.x for nimx for now yes
15:37:30BehrangDadsetanunderstood. thanks!
15:37:31Araqbut 1.2.2 is just around the corner too :-)
15:37:36leorize[m]it was disabled due to nimx itself being broken
15:52:31dcmertensI am reading through Nim in Action and thought I'd compare Perl's parse speed against Nim's parse speed for the wikipedia page count example
15:53:00dcmertensNim is faster, about 3.7s vs Perl's 4.7s
15:53:36dcmertensthough the Perl code is shorter because it uses a regular expression instead of a string of parse statements
15:53:50dcmertensinterestingly, though I *get* *different* *results*
15:54:10dcmertensThe Perl parser tells me that the most popular page is "en.mw en 5493928 146752070214"
15:54:26dcmertenswhereas the Nim parser tells me that the most popular page is ("en", "Main_Page", 271165, 4791147476)
15:54:28disruptekmaybe it's a matter of opinion.
15:54:40dcmertensdisruptek, which part?
15:54:48disruptekwhich page is more popular.
15:55:02dcmertensfor those who have not read the book, we are comparing page hits, which is the third entry
15:55:25dcmertensit appears that en.mw is hit 5,493,928 times, whereas Main_Page is hit 271,165 times
15:55:34disruptekwell, you have to admit...
15:55:39disruptek271,165 is a lot.
15:55:42FromDiscord<Rika> what is en.mw
15:55:49dcmertensRika, I have no idea
15:55:50FromDiscord<Recruit_main707> how can you check if an object has no been initialised yet?
15:55:58disruptekmost people would be happy with that many hits.
15:56:09dcmertensdisruptek, your insight is invaluable here
15:56:14dcmertens:-)
15:56:21FromDiscord<Rika> > how can you check if an object has no been initialised yet?↵@Recruit_main707 this isnt foolproof, but you can check against default(Type)
15:56:26disruptekdecide who is right and who is nim, and then fix the bug.
15:56:50FromDiscord<Rika> issues with that are object variants and when the assignment is using default(Type)
15:57:03dcmertensdisruptek, the problem is that I can't see why the Nim example *doesn't* report en.mw
15:57:17disruptekwhat's the code?
15:57:22*dcmertens digs up a paste
15:57:28dcmertenswhere do we paste?
15:57:37disruptek~paste
15:57:37disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
15:58:00disruptekthe bot will turn ix urls into playground urls and post them to #nim-news
15:58:02disruptek~news
15:58:03disbotnews: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. -- disruptek
15:58:25*Senketsu joined #nim
15:59:16dcmertensdoh
15:59:30dcmertensI see, we are checking that the domain code is "en"
15:59:30disruptekthere's a nim-based ix poster in here:
15:59:32dcmertensthat'd be it
15:59:33disruptek!repo xs
15:59:35disbothttps://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 2⭐ 0🍴
16:00:12*bung quit (Ping timeout: 265 seconds)
16:00:30dcmertensok, fixed the bug in the Perl code, now it runs faster than the Nim. :-P
16:00:54dcmertensHere's the nim code: https://play.nim-lang.org/#ix=2o24
16:00:55disrupteksounds right to me.
16:02:31disruptekwho wrote this?
16:02:31dcmertensPerl: https://nopaste.nl/eRwfzL51bB
16:02:54dcmertensdisruptek, Nim in Action was written by Dominik Picheta
16:02:59dcmertensI more-or-less copied his code
16:03:07disruptekjesus christ.
16:03:07FromDiscord<codic> sorry, was gone for > a day↵> z.open(filename, fmRead);let outStream = newStringStream("");z.extractFile("foo.bar", outStream)↵this looks excatly like what i want bung, but i want to iterate over each file...
16:03:54dcmertenswith my fixed Perl code (pasted to nopaste.nl above), I get timing of 2.5s
16:04:05dcmertensvs Nim's 4.7s
16:04:07disruptekholdon, i'm watching a cop chase.
16:04:20dcmertensdisruptek, from your house?
16:04:23disruptekif i can understand what you're trying to do, from the perl i mean, i'll write something that works.
16:04:36dcmertensdisruptek, how familiar are you with Perl?
16:04:39disruptekpeople ask me why i drink.
16:04:42disruptekcode like this is why.
16:04:53disrupteki wrote perl back when perl was a thing.
16:05:17disruptekit's thermal camera footage.
16:05:28FromDiscord<Rika> dcmertens: with d:release?
16:05:40dcmertensRika, almost certainly. I'll check again, though
16:05:43disrupteki just don't understand why people think they can outrun a fucking cop's radio.
16:05:50dcmertensRika, yes
16:06:14FromDiscord<Rika> Can I see both code :P
16:06:25FromDiscord<Rika> Oh nvm
16:06:29FromDiscord<Rika> Found the links
16:06:44dcmertensyeah, probably should have used a gist for that
16:06:50dcmertenssorry
16:07:18disruptekrika can write a 3-liner that's idiomatic, i'm kinda curious to see what she comes up with.
16:07:30FromDiscord<Rika> No I can't wtf
16:07:32FromDiscord<Rika> LMAO
16:07:38disruptekdude, get on that shit.
16:07:46FromDiscord<Rika> disruptek you literally write compiler code
16:07:52disrupteki'm trying to catch up with LivePD.
16:07:53FromDiscord<Rika> I write peasant libs no one uses lmao
16:08:09disruptekgtfo i've seen your work.
16:08:18disruptekand no one will see my compiler code.
16:09:08FromDiscord<Rika> Nah man you got the big brain codes and I got the simple ass "anyone can do" code lmao
16:09:34disruptekif that were true i wouldn't have a ticket open to use one of your libs.
16:10:08FromDiscord<Rika> what
16:10:11dcmertensSo, I know I'm playing Perl's strengths against Nim's... standard stuff? But I'd still like to know if it's possible for the Nim code to be faster
16:10:31disruptek!search progress bar author:disruptek
16:10:31FromDiscord<Rika> try using nitely/regex
16:10:31disbothttps://github.com/disruptek/nimph/issues/109 -- 3add a progress bar
16:10:45dcmertens(It is also a reminder to me that if I have a simple file parsing problem, I should probably just use Perl)
16:10:58disrupteknitely's regexp will let you compile the re at compile time.
16:11:18dcmertensRika, was that for me?
16:11:19disruptekbut i don't think it's a regexp problem iiuc.
16:11:24FromDiscord<Rika> bruh
16:11:29dcmertensI don't either
16:11:32FromDiscord<Rika> yeah dcmertens
16:11:40dcmertensI use a regex in Perl because that's what Perl gives me
16:11:47dcmertensbut I thought Nim's parse tools would be faster
16:11:47disruptekof course, as you should.
16:11:48FromDiscord<Rika> but as disruptek said it might not improve the performance
16:11:52dcmertensas they're just wrappers around while loops
16:12:02disruptekokay, christ.
16:12:13FromDiscord<Rika> ?
16:12:16disruptekwhat's the link to the perl one?
16:12:22disrupteki can't even read this nim crap.
16:12:23FromDiscord<Rika> https://nopaste.nl/eRwfzL51bB
16:12:23dcmertenshttps://nopaste.nl/eRwfzL51bB
16:12:36dcmertensdisruptek, any style recommendations?
16:12:41dcmertensI'm open to suggestions
16:12:43disruptekokay, you open a file, you read lines.
16:12:50disruptekyou're counting what, most hits?
16:12:53dcmertensyeah
16:12:53FromDiscord<Rika> oh oh oh
16:12:54disruptekand saving the line that has same.
16:12:56FromDiscord<Rika> maybe strscans?
16:13:06disruptekstrscans or split
16:13:11disruptekand parseInt
16:13:37disrupteksplit to an array that you save for reconstitution.
16:13:46FromDiscord<Rika> skip parsing what isnt needed or something? but then its not fair since the perl's version's regex might be parsing it
16:13:54disruptekit could be done at compile-time, in which case the runtime will be very, very fast.
16:14:18disruptekbut we'll write something idiomatic that runs at runtime.
16:14:25disruptekfairness isn't a thing.
16:14:32disruptekit's already unfair.
16:14:32FromDiscord<Rika> that is true
16:14:53dcmertensdisruptek, do you mean compiling the regex at compile time? that's fine
16:14:54disruptekto compare perl to nim is to completely miss the forest for the trees.
16:14:56dcmertensthat's what Perls is doing, for sure
16:15:08disruptekno; you can just compile the answer at compile time.
16:15:20dcmertensdisruptek, until I change the file I want to analyze. :-P
16:15:33disruptekwell fuck, dude, isn't that what perl is doing?
16:15:46dcmertens??
16:16:10disruptekperl is compiled at runtime. nim can be run at compile time. wtf are we talking about here?
16:16:14disruptekabsolutely nothing.
16:16:34disruptekif you want it created at compile-time, you can do that with nim.
16:16:39dcmertenswell, if you want me to throw the compile times into my timing data...
16:16:42disruptekif you want it created at run-time, you can do that with nim.
16:16:51dcmertenstime nim c -r -d:release wikiparse.nim
16:16:52dcmertens...
16:16:56FromDiscord<Rika> dc: how are you timing this in the first
16:16:57FromDiscord<Rika> ah
16:16:59FromDiscord<Rika> you just sent it
16:17:04FromDiscord<Rika> but wait
16:17:08FromDiscord<Rika> that counts the compile time too
16:17:10FromDiscord<Rika> is that intended?
16:17:37FromDiscord<Rika> it should be more like `nim c -d:release wikiparse.nim && time ./wikiparse` no?
16:17:41dcmertensno, Rika, that's not what I did at first
16:17:53dcmertensdisruptek was talking about performingg the parse at compile time
16:17:57dcmertensor that's what I took him to mean
16:18:11FromDiscord<Rika> well, is perl performing tthe parse at compile time?
16:18:19dcmertensno
16:18:29dcmertensit's compiling the regex "at *script* compile time"
16:18:30disruptekgimme the data file; i wanna write the idiomatic solution.
16:18:42disrupteki have an idea on how to prove my point.
16:18:46FromDiscord<Rika> what the heck is script compile time
16:19:06disruptekscripts have to compile their shit, too, you know.
16:19:11dcmertensdisruptek: https://dumps.wikimedia.org/other/pagecounts-all-sites/2016/2016-01/pagecounts-20160101-050000.gz
16:19:30disruptekokay, thanks.
16:19:48dcmertensRika, Perl builds a data structure representing your script. The process of building that data structure is referred to as "compile time" in Perl world
16:20:03dcmertensthen it executes the process defined by that data structure. That's "Run time"
16:20:18dcmertensif you create a module that includes C code, that's all put together at "build time"
16:21:09disruptekit's the third field, right?
16:21:09dcmertensThe reason Perl would win here is because it minimizes data copying and it has really good I/O
16:21:15dcmertensdisruptek, yeah
16:21:49dcmertensI suspect I'm copying data somewhere silly
16:22:12dcmertenslike, when I build up the tuple? Whereas in the Perl I just store the whole line?
16:22:19FromDiscord<Rika> well perl is like a few multipliers older than nim
16:22:25dcmertensRika, very true
16:22:40dcmertensbut we're performing a tight loop, where Perl is supposed to suck
16:23:04dcmertenswe're also using regular expressions, which I would have expected to run slower than straight parsing
16:23:36FromDiscord<Rika> pcre is no joke apparently
16:23:45dcmertensPerl still has to walk a data structure to perform its execution, whereas Nim bakes the while() loops into machine code
16:23:58dcmertensRika, I have no idea, Perl doesn't use PCRE
16:24:53FromDiscord<dom96> wait, is this from my book?
16:25:01FromDiscord<Rika> afaik yes
16:25:06FromDiscord<Rika> hi dom lmao
16:25:13dcmertensdom96, yeah
16:25:17dcmertens:-)
16:25:20FromDiscord<dom96> does that mean my implementation is worse than perl? lol
16:25:34dcmertensdom96
16:25:36FromDiscord<Rika> apparently
16:25:43dcmertensI just realized I haven't gotten to the parallelized part
16:25:51dcmertensso maybe your parallelized version would run faster
16:26:04FromDiscord<Rika> than unparallelized perl??
16:26:11FromDiscord<Rika> that would be a gut punch ngl
16:26:30dcmertensRika, yeah, we're comparing unparallelized versions of both languages
16:26:59disruptekdo i need perl6 for this?
16:27:04dcmertensdisruptek, no
16:27:16dcmertensI've running on Perl 5.22
16:27:55disrupteki have 5.30.1 i guess.
16:28:01dcmertensthat should work
16:28:30disruptekmy first version is 3.5s to perl's 1.5s.
16:29:39dcmertensI apparently have a slow machine
16:29:43disruptek3.2 with arc.
16:29:51disruptekbut what's the right answer?
16:30:12disruptekoh, there's spaces or something?
16:30:36dcmertensthe right output? It should be ("en", "Main_Page", 271165, 4791147476)
16:30:42dcmertensyeah, four field, space separated
16:30:57FromDiscord<dom96> what are the timings for Nim vs. Perl for this?
16:31:00disruptekzu.mw zu 36 279751
16:31:15dcmertensdisruptek, english only (seconod field is en)
16:31:22disruptekoh
16:31:32disruptekindex 1, you mean?
16:31:38dcmertensyea
16:31:59dcmertensdom96, things are running faster on my machine now. I guess my hard drive cache has warmed up after analyzing this file 20 times
16:32:16dcmertensbut for Perl I run `time perl wikiparse.pl` and get 2.54 real seconds
16:32:27disruptekthat gets me to 3.00
16:32:56dcmertenswith nim I run your non-parallelized code with `time ./wikiparse` and get 3.8 user
16:33:43dcmertensnow my HD cache has slowed down and I get about 2.6s for Perl and 4.1s for nim
16:33:46disruptekmy output is now: en.mw en 5493928 146752070214
16:33:57dcmertensdisruptek, that's what I had before
16:34:14dcmertensah, yeah, the *first* field needs to be "en"
16:34:16dcmertenssorry
16:34:27*dcmertens has confused himself
16:34:43disruptekno biggie; it changes nothing.
16:35:43dcmertensyeah, my Perl script was wrong.
16:35:52dcmertensbut fixing it doesn't change the timing really
16:36:41dcmertensOh, fun, a better regex for Perl (using beginning-of-line anchor) speeds it up a tick
16:37:00disruptekyeah, i should optimize perl first.
16:37:34dcmertensdisruptek, the proper regex is /^en\s\S+\s(\S+)\s\S+\s/
16:38:35disruptekthere are some trailing re format specifiers that let you change the pcre options.
16:38:40dcmertensoh, I bet I know the problem
16:38:41disrupteki just don't remember the deets.
16:38:55disrupteklike, /asdfasdf/i is case-insensitive and stuff.
16:39:03dcmertensIf you put the parsing code directly into the for loop, you can exit the parse early when domainCode doesn't match
16:39:22*dcmertens tries that
16:40:10dcmertenshow do I "continue" a for loop in Nim?
16:40:12disruptekswitch to a string is .3s slower.
16:40:16disruptekcontinue
16:40:20dcmertensthanks
16:43:14disruptekthat kinda blows my mind.
16:43:58disruptek1.9s for markAndSweep
16:47:48disrupteki got a little under 1.0s now.
16:54:21dcmertensdisruptek, can you post your solution?
16:54:53dcmertensI tried to update the parse in the for loop and now I'm getting a very strange result
16:55:46*lmariscal quit (Quit: I'm Out!)
16:55:58disruptekhow so?
16:56:13dcmertensnever mind, I'm an idio
16:56:40disrupteki'm trying to wrap criterion around it and it reminds me that i really need to learn more of these switches.
16:57:00disruptek'cause it's, like, running the damned thing 256 times or some shit.
16:57:30dcmertensI had a bug where I was not actually storing the highest count in the highest count variable. :-P
16:57:46disrupteki did that, too.
16:58:29dcmertensIf I continue the for loop as soon as I detect that the line does not start with "en", I'm able to get nim down to 3.4s vs Perl's 2.7s
16:58:50*lmariscal joined #nim
17:02:32dcmertensbah, how do you get the length of a string?
17:02:36dcmertensstring.lenght() is failing me
17:02:54dcmertensok, string.len
17:07:16*couven92 joined #nim
17:08:34FromDiscord<Rika> haha
17:09:37Zevvoh are we parsing and microoptimizing! Can I play?
17:09:43disruptekokay, i got criterion working.
17:09:55disruptekwelcome to the party, zevv
17:10:07Zevv\o/
17:10:16dcmertensI finally have a Nim version that runs about as quickly as the Perl version
17:10:27dcmertens^^ this should make some people sad
17:10:42*fredrikhr quit (Ping timeout: 260 seconds)
17:11:05dcmertenshttps://play.nim-lang.org/#ix=2o2h
17:12:16dcmertensZevv, the Perl version we're competing against is here: https://nopaste.nl/cnOOcSbTi0
17:12:21FromDiscord<Recruit_main707> just do it at compile time
17:12:25FromDiscord<Recruit_main707> https://tenor.com/view/feel-me-think-about-it-gif-7715402
17:12:26disruptek0.82s
17:12:53FromDiscord<dom96> tried using `re`?
17:13:15disruptekno, i wanna believe our assumptions are faster.
17:13:33disruptekonce we're in c-land, it's not a nim victory.
17:13:48dcmertensdom96, any regular expression solution should have a hand-coded version that's faster
17:14:01dcmertensthe reason you'd reach for regex is only if the match is complicated
17:14:08dcmertensin this case, it's not
17:14:25ZevvMy naive npeg version is about as fast as the perl version for me. That means it should be able to run at least 4 times faster :)
17:14:50dcmertensZevv, share
17:14:50dcmertens?
17:15:06dcmertensNow I'm getting Perl at 2.25s and Nim at 2.3s
17:15:06disruptekwell, i'll be honest. it's starting to look a little less idiomatic.
17:15:14FromDiscord<Rika> oh zevv's here
17:15:16FromDiscord<Rika> save me
17:15:30FromDiscord<Rika> is it proven that you can match parentheses with PEGs?
17:15:38FromDiscord<Rika> (and how T_T)
17:15:39disrupteki wish arc was faster here. it's troubling.
17:15:52disruptekwe need to annotate strutils, maybe?
17:20:56Zevvhttp://ix.io/2o2l that runs at 70% of the time for perl
17:21:13disrupteknice!
17:21:48FromDiscord<dom96> > dom96, any regular expression solution should have a hand-coded version that's faster
17:21:55FromDiscord<dom96> yes, but it doesn't hurt to try and get a baseline
17:22:06FromDiscord<dom96> that way you will know exactly how much overhead Nim adds
17:22:56disruptekthe perl version is 20 lines. my idiomatic version was 20 lines. but it was also 3s.
17:23:00disruptekor, 2x perl.
17:23:26disrupteki could write my own lines() iterator, but where are we going, here?
17:23:36FromDiscord<dom96> Let's all just use Perl
17:23:46disruptekdude, that's what /i/ said.
17:24:50dcmertensWhen I try to write a regex version in Nim, it's a little slower
17:25:25dcmertenshttps://play.nim-lang.org/#ix=2o2n
17:25:39*dcmertens checks out Zevv's version
17:26:07Zevvrule #1: if you want speed, parse by hand
17:29:22disruptekwow, golden disagrees with `time`.
17:29:53Zevvdoes golden read wall time or cpu time
17:30:09disruptekgot me.
17:31:44dcmertenswhat is golden?
17:31:56disruptek!repo golden
17:31:56disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 19⭐ 0🍴
17:33:08dcmertensah, thanks
17:33:38*dadada quit (Ping timeout: 260 seconds)
17:33:51livcdis not perl's regex engine pretty optimized?
17:33:54dcmertenslivcd, extremely
17:34:10dcmertenswhich is why I thought this would be fun
17:34:28dcmertensZevv, is $0 the current match?
17:34:28dcmertenswhen I run your version, I get "en", not the page title
17:35:23dcmertenslivcd, dom96 uses a parser as an example. "Let's parse a huge file." I thought, "Hmm, I wonder how much Nim will beat Perl on this."
17:35:49*NimBot joined #nim
17:35:56livcddisruptek disrupted arc
17:35:57disrupteki guess that's not really a feature.
17:36:26dcmertenshahaha
17:37:06disruptekokay, now it just segv.
17:37:14disruptekwhew.
17:38:52disruptekwhen it doesn't run out of memory, it suffers an error in parseInt.
17:39:11FromDiscord<dom96> btw I hope you've tried wrapping the Nim code in a `main` proc
17:39:16*aeverr_ joined #nim
17:39:19FromDiscord<dom96> that's a classic that seems to improve perf
17:39:31disruptekit's because i have to use var params instead of out params.
17:40:02dcmertensdom96, Ah, I didn't
17:41:52dcmertensdom96, do you mean isMainModule?
17:42:00FromDiscord<dom96> no
17:42:04FromDiscord<dom96> proc main() = ...
17:42:08FromDiscord<dom96> main()
17:42:23FromDiscord<zetashift> Really weird that trick
17:42:56dcmertenswell, when I do that, the running time drops to 0.0
17:43:00dcmertensand no output
17:43:01dcmertens:-)
17:43:09*aeverr quit (Ping timeout: 265 seconds)
17:43:12dcmertensI thought Nim automatically detected and called main() fnctions
17:44:28FromDiscord<dom96> no, you need to call the main function
17:45:09dcmertensyeah, that leads to a big speedup
17:45:51FromDiscord<dom96> lol, really?
17:46:44dcmertenswith main() trick, 2.0s; without main() trick, 2.25s
17:46:49dcmertenscompare to Perl at 2.25s
17:48:21dcmertensPerl version: https://nopaste.nl/cnOOcSbTi0 | Nim without main(): https://play.nim-lang.org/#ix=2o2n | Nim with main(): https://play.nim-lang.org/#ix=2o2A
17:49:39FromDiscord<Clyybber> dcmertens: Its because otherwise your variables are globals
17:50:08dcmertensClyybber, thanks that makes a *lot* of sense
17:52:03livcdhttps://github.com/lh3/biofast
17:52:52FromDiscord<Clyybber> disruptek: Is markandsweep a lot faster than arc?
17:52:59disruptekyeah.
17:53:09disruptek2x
17:53:16FromDiscord<Clyybber> I guess rc ops are the bottleneck here then
17:53:37disrupteki wouldn't think so.
17:53:48FromDiscord<Clyybber> Could try making lines return lent string
17:54:05disruptekstrutils has no annotations, for example.
17:54:48FromDiscord<Clyybber> what annotations?
17:54:53FromDiscord<Clyybber> lent annotations?
17:55:16disruptekyeah, or sinks.
17:57:05*stefantalpalaru quit (Changing host)
17:57:05*stefantalpalaru joined #nim
17:57:27dcmertensAlright, I got the Nim version to speed up using skipUntil rather than parseUntil
17:57:30dcmertenswhich makes sense
17:58:13disruptekc'mon, i told you that was shit.
17:58:34dcmertensbut that doesn't mean I knew how to fix it!
17:58:37disruptekthink about how you think about the problem.
17:58:46disruptekyou take the third field.
17:58:51disruptekhow do you know it's the third?
17:58:57disruptekbecause it's the third group of non-whitespace.
17:59:13disruptekso you split on whitespace. take the third such value.
17:59:24dcmertensdisruptek, I'm not splitting on whitespace
17:59:33disruptekif you wanna make it faster, make an iterator.
17:59:45dcmertensI find that doubtful
17:59:56dcmertenssplitting on whitespace will perform a bunch of allocations, won't it?
18:00:03disrupteka simple state machine that barfs out numbers would be pretty damned fast.
18:00:13dcmertenssplitting on whitespace has to read the entire line
18:00:20disruptekif you have a faster version than mine, i'll look.
18:00:30dcmertenssure, I never saw your version
18:00:37dcmertenscould you post it?
18:00:50disrupteki thought i did.
18:00:53disruptekhttp://ix.io/2o2G/nim
18:00:59dcmertensthanks
18:01:24disrupteki put an (unlikely) in there for danny.
18:02:30FromDiscord<Clyybber> you cursed fella
18:02:31FromDiscord<Clyybber> haha
18:02:48disruptekyou like that?
18:03:03disrupteki thought you might.
18:04:48disruptekalso, it's the same length as the perl version; shorter if you leave the main loop global.
18:05:31disruptekwhich is also less than half as long as dom's abomination.
18:06:09FromDiscord<Clyybber> how fast is it compared to doms or zevvs?
18:06:24disruptekzevv will have to tell us.
18:06:49disruptekdom's is like 40 lines long.
18:07:12dcmertensNice: line.startsWith("en ")
18:07:19dcmertensvery readable
18:07:40dcmertensI checked the string by hand with line[0] != 'e' and line[1] != 'n'...
18:07:44dcmertenswhich seemed gross
18:07:57disrupteki vomited a little into my mouth.
18:08:28FromDiscord<Rika> im crying from how disgusting that looks
18:08:32disrupteki was talking to my mother today and she asked how some code could look nicer than other code.
18:08:46disruptekold folks are so funny.
18:08:49dcmertenswell, that's what I would have written in C for super-fast stuff
18:09:01dcmertens:-P
18:09:21disruptekthe point is that idiomatic code is fast code.
18:09:36FromDiscord<Recruit_main707> tell that to assembly
18:09:49disruptekshort code is fast code.
18:09:53disruptekno code is fastest.
18:10:04FromDiscord<dom96> short code is not always fast code
18:10:24disruptekthanks, doctor.
18:11:27leorize[m]disruptek: sink can now be inferred, but not lent :(
18:11:31*Vladar quit (Remote host closed the connection)
18:11:43disruptekyeah but sink inference is too sketchy for my taste.
18:11:50disrupteki don't recommend it for mortals.
18:12:16disruptekspecifying it in stdlib just makes sense.
18:12:17leorize[m]@dom96 can you take a look at this? https://github.com/nim-lang/Nim/issues/14524
18:12:19disbotfuture mismatch with callbacks ; snippet at 12https://play.nim-lang.org/#ix=2o2P
18:12:40disruptekthat's the third time today a UFO has just hovered outside my window.
18:12:55disrupteklike, come in if you're going to come in, already!
18:12:59disruptekchrist.
18:13:07disrupteki don't have time for this shit.
18:13:31FromDiscord<dom96> It's Trump stealing your hamburgers
18:13:32disruptekyou have no idea how much tv i need to catch up on.
18:14:05Zevvdcmertens: wel, 'n' is the page title of the en.wm langpage, right?
18:14:59dcmertensno, en.wm is not a valid page for these purposes
18:15:07dcmertensyou're supposed to identify the main landing page
18:15:13Zevvoh I got my logic wrong, sorry :)
18:15:26dcmertensI think everybody who has tried this problem made that mistake today
18:15:27dcmertens:-)
18:15:38Zevvwell, I got the proper page, I just id return not lal of the line
18:15:59FromDiscord<dom96> leorize: replied
18:16:51dcmertensZevv, how does your npeg compare to the peg in the standard library?
18:17:46disruptekuse zevv's.
18:18:06leorize[m]npeg is peg but better
18:18:08Zevvthis runs at 20% of the perl time: http://ix.io/2o2W
18:18:21leorize[m]except that you can't use peg syntax the last time I checked (not that I care about that)
18:18:23disruptekthat's twice as fast as mine.
18:18:52FromDiscord<Rika> npeg uses peg syntax but prefixed instead of suffixed afaik, am i right
18:19:17Zevvyes, because of limitations in the Nim syntax. But that doesn't matter because Nim's syntax is flexible enough anyway
18:19:33FromDiscord<Rika> LMAO
18:19:50ZevvWell, it got merged :)
18:20:03dcmertensZevv, your last solution looks like what I would have written in C
18:20:06FromDiscord<dom96> lol, is this a meme now
18:20:27Zevvdcmertens: I always write like I write C if it needs to be fast.
18:20:29FromDiscord<dom96> Zevv: you may as well go to asm at that point lol
18:20:46Zevvwell, if I let nim do stuff for me, it starts allocating and slicing away
18:20:53Zevvschlump does the performance
18:21:05Zevvconvenience vs power. That's why I love nim, you can do both
18:21:17ZevvDid you ever look at mratsims projects? He kind of abandons most of nim.
18:22:19disrupteki love how zevv doesn't use single character variables when he can add a digit on the end.
18:22:57dcmertensZevv, *that* is exactly why I'm here. Easy to "drop" into C when needed. That's hard to do in Perl.
18:23:14ZevvI forgot from what language it came, but what I really love is the simple 's' for plural. I have a list of things, I call it 'ts'. Then I can do 'for t in ts'
18:23:34FromDiscord<Recruit_main707> i also do that sometimes
18:23:45disruptekagree.
18:24:24FromDiscord<Rika> i do that too
18:24:51FromDiscord<dom96> That reminds me of Haskell
18:25:11Zevvdcmertens: right, that's part of the fun for me as well. The other part is making Nim understand me well enough and do the dropping for me. Npeg can *parse* this file in excatly the same time as the raw version I just posted
18:25:23Zevvit is just when I want to do stuff with captures that the performance goes boink
18:25:33Zevvbecause it will allocate and create slices of the captures
18:25:45disruptekzevv, stop it.
18:25:47Zevvif/when nim gets proper slices, this will drastically improve NPegs speed
18:25:49disruptekyou're making my pants tight.
18:26:07ZevvI'm safe here, overseas
18:26:23disruptekno one is safe from me.
18:26:32Zevvanyway, thats the cool thing - I tell it a grammar, and the raw state machine it generates does just as good as the raw one I typed.
18:26:41ZevvWhich can also mean I type crawppy raw state machines
18:27:05disruptekyou turned a bad character flaw into a career.
18:27:53Zevvand of course it draws pretty graphs on the fly
18:27:53Zevvhttp://zevv.nl/div/t.png
18:27:58Zevveverybody likes pretty graphs
18:28:09dcmertensyeah, I saw that. It was cute!
18:28:22ZevvI bet perl can not do that!
18:28:49ZevvI should really make a mode in npeg where it does not slice but pass the offsets as captures
18:29:55dcmertensZevv, be careful, you're implicitly competing against Damian Conway
18:30:27dcmertensI don't think the Peg parser system for Perl does that
18:30:30dcmertensbut I never used it
18:30:31Zevvnah. He knows his stuff. I'm just messing about
18:32:20*sagax quit (Remote host closed the connection)
18:35:50*koltrast_ quit (*.net *.split)
18:35:51*lqdev[m] quit (*.net *.split)
18:35:51*matthias[m]1 quit (*.net *.split)
18:38:41FromDiscord<dom96> We're all just messing about, really 🙂
18:41:53*Cadey1 quit (Ping timeout: 240 seconds)
18:41:57*j4nvkvc quit (Ping timeout: 246 seconds)
18:42:00*BitPuffin quit (Ping timeout: 256 seconds)
18:42:02*salotz[m] quit (Ping timeout: 252 seconds)
18:42:02*sendell quit (Ping timeout: 252 seconds)
18:42:08*watzon quit (Ping timeout: 246 seconds)
18:42:08*planetis[m] quit (Ping timeout: 246 seconds)
18:42:08*oneark quit (Ping timeout: 246 seconds)
18:42:08*TheManiac[m] quit (Ping timeout: 246 seconds)
18:42:14*skrylar[m] quit (Ping timeout: 240 seconds)
18:42:19*dzamo[m] quit (Ping timeout: 252 seconds)
18:42:32*k0mpjut0r quit (Ping timeout: 260 seconds)
18:42:32*codic quit (Ping timeout: 260 seconds)
18:42:32*anti[m] quit (Ping timeout: 260 seconds)
18:42:33*kragil[m] quit (Ping timeout: 260 seconds)
18:42:33*unclechu quit (Ping timeout: 260 seconds)
18:42:34*dannyfritz[m] quit (Ping timeout: 256 seconds)
18:44:14*koltrast_ joined #nim
18:44:15*lqdev[m] joined #nim
18:44:53PrestigeAre there any ML libs in Nim yet?
18:45:19Zevvarraymancer
18:45:30Zevvit's not really ML, but offers most of the stuff you'd need
18:45:46FromDiscord<Recruit_main707> nimtorch *should* work
18:46:01FromDiscord<Recruit_main707> its a bit outdated i think, and installation is hard
18:46:09FromDiscord<Recruit_main707> at least i wasnt able to do it :P
18:46:22*lqdev[m] quit (Ping timeout: 244 seconds)
18:55:48dcmertensRegarding the use of channels to send/receive data in parallel processes, are these efficient?
18:55:59dcmertensIf I send an string, does it copy the string?
18:56:14dcmertensAlso, is barrier synchronization available?
18:56:15disruptekit copies it.
18:56:23dcmertensdisruptek, bummer
18:56:35disruptekyou can do a barrier sync manually; i dunno of an automatic method.
18:57:20dcmertenscool
18:57:52disruptekleorize would be a good person to ask.
18:58:16disrupteki have to do some barriers for uring support.
18:58:32dcmertenslooks like I should look into Weave: https://github.com/mratsim/weave
18:59:17disruptekweave is about work-stealing inside one process, n threads.
18:59:40dcmertenswell, it uses message-passing, which I'm familiar with
18:59:43dcmertensI've used MPI before
19:02:34disruptekthere's a shared heap under arc, if that's what you're after.
19:02:51*Senketsu quit (Ping timeout: 252 seconds)
19:02:57dcmertensNo, I'm writing simulations, Euler or Runge-Kutta-4
19:03:24disrupteki think there's at least one channel impl in weave.
19:03:28dcmertensI need to make sure that all four (or 8 or 16 or whatever) threads pause at each time step to share their calculations
19:03:31disruptekit's probably where you should start.
19:13:27Avatarfighteryo yo yo what's is up party people
19:14:23*thelounge4229 joined #nim
19:16:15*thelounge4229 quit (Client Quit)
19:17:47alehander92oi
19:17:51alehander92i am back in Sofia
19:18:23alehander92zevv i think haskell
19:18:30alehander92does the `xs` thing
19:18:33alehander92haskell people*
19:20:59*dzamo[m] joined #nim
19:36:16*NimBot joined #nim
19:36:58FromDiscord<Rika> Zevv: how do i do a nongreedy + in npeg?
19:37:05FromDiscord<Rika> i'm kinda lost
19:43:52*Guest70061 is now known as dadada
19:45:14FromDiscord<Rika> nvm! i am dumb
19:46:05alehander92you're not
19:46:27alehander92hm, time to write an `ls` to dogfood
19:46:39alehander92do you guys *use* ls a lot?
19:46:44alehander92what are the flags you usually use
19:48:12*dcmertens quit (Quit: Leaving)
19:48:51FromDiscord<Rika> ls -lah
19:48:59FromDiscord<Rika> colors on too
19:54:16disrupteki use lsd; does that help?
19:55:22disrupteklsd --long --classify --date relative --timesort --reverse
19:55:48*Cadey1 joined #nim
19:55:48*k0mpjut0r joined #nim
19:55:48*salotz[m] joined #nim
19:55:48*planetis[m] joined #nim
19:55:48*GitterIntegratio joined #nim
19:55:48*khanate[m]0 joined #nim
19:55:48*codic joined #nim
19:55:48*Demos[m] joined #nim
19:55:48*j4nvkvc joined #nim
19:55:48*unclechu joined #nim
19:55:49*nerdrat[m] joined #nim
19:55:49*watzon joined #nim
19:55:49*BitPuffin joined #nim
19:55:49*lqdev[m] joined #nim
19:55:54*kragil[m] joined #nim
19:55:54*oneark joined #nim
19:55:54*anti[m] joined #nim
19:55:54*skrylar[m] joined #nim
19:55:55*matthias[m]3 joined #nim
19:55:55*sendell joined #nim
19:55:55*dannyfritz[m] joined #nim
19:55:55*TheManiac[m] joined #nim
19:57:47shashlickHello world
19:57:55shashlickvoltist codic
20:01:46shashlickSelect all mark read
20:01:58shashlickAnyone needs anything, please ping
20:06:16*Trustable joined #nim
20:06:36disruptekI CAN'T FEEL MY LEGS
20:06:42disruptekshashlick: are you alright, dude?
20:15:50ZevvRika: you found what you need?
20:16:12Zevvalehander92: yeah it was haskell, I just found my repos
20:25:30FromDiscord<Rika> zevv: no T_T
20:26:01Zevvtell me
20:27:08disruptekrunnableExamples: doesn't run in the same env as the compiler. 🤦
20:28:07disrupteki mean, the docgen instance.
20:30:58FromDiscord<Rika> zevv: so i'm trying to match something like this
20:32:24FromDiscord<Rika> `sometitle [arbitrary amounts of bracketed parts] [here too] [this one's special tho]`↵`^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~title ^~~~~~~~~~~~~~~not title` (both need to be captured)
20:32:57FromDiscord<Rika> it can also be simply `title [not title]`
20:33:30Zevvdo you have a concrete example, preferable a snippet dump? This stuff does make it throug hIRC well
20:33:30FromDiscord<Rika> just, the last [] is not part, and that title can be comprised of either non-bracketed or bracketed segments
20:35:27FromDiscord<Rika> sent a code paste, see http://ix.io/2o3Z
20:35:34FromDiscord<Rika> ~~yardanico now knows what i'm doing maybe~~
20:35:47disruptekNO ONE KNOWS WHAT YOU'RE DOING
20:36:02Zevvok, in your example, what are the things you want to match?
20:37:01ZevvThe stuff in the last brackets, right?
20:37:05FromDiscord<Rika> sent a long message, see http://ix.io/2o41
20:37:11FromDiscord<Rika> both the title and the last brackets
20:37:25FromDiscord<Rika> i'm not sure how i would handle this
20:37:32Zevvright
20:38:01FromDiscord<Rika> hey i'm sorry if this is a small brain problem xddd
20:38:43Zevvnah, it's nasty because it needs backtracking
20:42:12FromDiscord<Rika> maybe i should just not capture this
20:43:13FromDiscord<Rika> it might cost a bit more time because i'll have to download the map associated with the name but the format is at least not weird like this or something, maybe.
20:46:18*narimiran quit (Ping timeout: 260 seconds)
20:47:54alehander92rika thank you
20:48:07alehander92disruptek hm, i don't think i know `lsd`, have to check it out
20:50:28Zevvrika: http://ix.io/2o47
20:50:52Zevvyou have to be explicit with PEGS
20:51:14Zevvyour language is ambigious, so you need a non-blind repetition
20:51:31Zevvbasically, what makes the last [] block special is that it is followed by a newline
20:52:00Zevvso the rule for the title is: match a repetition of any char, as long at is not followed by a [] block and a new line
20:53:03*PMunch joined #nim
20:53:05FromDiscord<Rika> oh, actually, not a newline, but an extra ]
20:53:46FromDiscord<Rika> the full thing i'm parsing is `is playing [https://osu.ppy.sh/b/846620 Memme - Acid Burst [Spec's Acidic Rain]] <CatchTheBeat>`
20:53:55FromDiscord<Rika> thanks though
20:54:03Zevvwell, you should have given me the full thing then :)
20:54:19disruptekrookie move.
20:54:23Zevvrookie move!
20:54:48disruptek!last zevv
20:54:48disbotZevv spoke in 12#nim 24 seconds ago 12https://irclogs.nim-lang.org/01-06-2020.html#20:54:23
20:55:29Zevvand you have a terrible taste for music, also
20:55:41disruptekjesus, zevv.
20:55:43FromDiscord<Rika> who?
20:55:44FromDiscord<Rika> me?
20:55:46Zevvhaha
20:55:52FromDiscord<Rika> i dont listen to that
20:55:54disruptekthe rook.
20:55:55FromDiscord<Rika> its not my music lol
20:55:55disruptekwho else.
20:56:04disruptekc'mon, buddy.
20:56:11disruptekcome on, buddy!
20:56:14alehander92get some https://www.youtube.com/watch?v=TvoVuOC_KKE man
20:56:20FromDiscord<Rika> lmao
20:56:31FromDiscord<Recruit_main707> dorime
20:56:32alehander92it's amazing
20:56:50disruptekwhat's what they used to call me in school.
20:57:00disruptekhector martinez, the angel-voiced one.
20:57:49disruptekthat picture even looks like me.
20:57:56disruptekhey, where'd you get this album?
20:58:26alehander92"I initially had links to purchase, but apparently this album is no longer available on any platform."
20:58:45alehander92you can't get that stuff in this world, buddy
20:59:01disrupteknot since i started smoking, no.
20:59:08FromDiscord<Rika> you can always just leave this world cant you?
20:59:08*hpyc9 quit (Quit: FREENODE IS FUCKING GAY)
20:59:08*blackbeard420 quit (Remote host closed the connection)
20:59:25disrupteki'm tryin'.
20:59:30disrupteklord knows, i'm tryin'.
20:59:45alehander92let's not hurry
21:00:46alehander92wow, june 2nd.
21:00:56alehander92it already arrived for me, guys
21:01:00alehander92good to live in the future
21:01:14disrupteki know, man. i told myself i'd shower in june.
21:01:31disruptekdepending on how it goes, i mean.
21:01:41alehander92finally, people started to riot..
21:01:47alehander92just get one bath, man
21:02:36alehander92i love what first impression would this chat leave to nim newcomers
21:03:06disruptekall i can say is,
21:03:17disruptekit's a good thing you have me sitting on irc.
21:03:24disruptekkeeping the chat clean and on point.
21:03:36Zevvyeah thanks alehander92 I was about to go to bed
21:03:47Zevvbut now I'm stuck here for 1:06:47
21:04:28disrupteki can keep my eye on him if you need some zzzzz.
21:05:03alehander92zevv i feel ya!
21:05:23disruptektrack three is a banger.
21:06:25alehander92the transition to the 4th one is beautiful
21:06:46alehander92i am literally looping the first 4-5 ones since maybe a week
21:07:19alehander92i hope you can keep both of your eyes tho
21:08:00FromGitter<sealmove> ```var ⏎ seq1 = @[1, 2, 3] ⏎ seq2 = seq1``` ⏎ ⏎ is deep copy right? [https://gitter.im/nim-lang/Nim?at=5ed56e30d137513704338a44]
21:08:10disruptekit's amazing how topical the lyrics manage to feel after so many years.
21:08:54alehander92truely timeless
21:10:19alehander92you're kidding but some psalms are older than the Beatles
21:10:28disruptekgtfo
21:10:30Zevvsure
21:10:42alehander92sealmove do you mean if the seq had objects?
21:10:50disruptekwhen he gets like this i just humor him, usually.
21:11:12disruptekbut you don't dis george, man.
21:11:46PMunchWhat on earth are you guys talking about? :P
21:12:17disruptekalehander got into grandpa's cough syrup again.
21:12:18alehander92george is no david, man
21:12:26shashlickdisruptek: all good, was on a meditation retreat
21:12:39disruptekshit.
21:12:53disruptekdo you need us to call someone?
21:13:13PMunch(fixed the links on my NimScript articles by the way)
21:13:15shashlickthat someone is me
21:13:19*bung joined #nim
21:13:21alehander92PMunch awesome
21:13:54shashlickwhat I miss last 3 days
21:14:12alehander92that's what happens when one turns windows updates off
21:14:28FromDiscord<Rika> pmunch: so what was the issue lmao
21:14:31alehander92probably thats how they started the eternal september
21:14:42PMunch@Rika: https://www.couchcms.com/forum/viewtopic.php?f=4&t=12680
21:15:08PMunchApparently the sanetizer that CouchCMS uses doesn't like the word "script" in URLs..
21:16:25FromDiscord<Rika> makes sense kinda lol
21:17:26PMunchYeah I thought it was something like that :P
21:17:36PMunchBut it's still super dumb mistake
21:17:43alehander92very strange
21:19:37alehander92better safe than sorry!
21:20:33PMunchI guess..
21:20:45PMunchI should rewrite this page as git hooks and Nim
21:23:10*drewr quit (Ping timeout: 256 seconds)
21:26:12FromGitter<kaushalmodi> alehander92: See https://github.com/c-blake/lc
21:26:37FromGitter<kaushalmodi> (just saw you mention about writing an *ls* project)
21:28:17alehander92amazing stuff
21:28:38alehander92this guy is good with cli!!
21:29:00alehander92well, i just want to dogfood another tool with that so i would just implement super small part
21:29:40Zevv"i hope you can keep both of your eyes tho"
21:29:50ZevvI think something got lost in translation there
21:32:29alehander92sorry!
21:32:33Zevv:)
21:34:01alehander92disruptek, what about a `ls` disbot command
21:34:12alehander92i have no idea what it would be listing
21:34:25Zevv /who #nim
21:35:10alehander92yeah! but it would be too long
21:35:30Zevvomit the lurkers, disbot knows who's vocal and who's not
21:35:39PMunchPaste it as an ix.io link?
21:35:47PMunchSort by last spoken
21:36:06ZevvI made this script yeeears ago that draws dot graphs from irc conversations; the more people speak the thicker the lines between them. Let me see if I cna find hat somewhere
21:36:10alehander92oh man, we can have a `convo_graph`
21:36:20alehander92yeah, something like that
21:36:42Zevvit's hard to guess the right nicks with all those bridges tho
21:36:45alehander92i thought only about a daily time-based graph of frequency
21:36:47PMunchSo how often they ping each other? Or jut talking at the same time?
21:36:54Zevvtalk at the same time
21:37:08PMunchIt would be neat to see how timezones cluster the community
21:37:18alehander92yeah, that's true
21:37:24ZevvI ggraphed that some time ago I think
21:53:45*Trustable quit (Remote host closed the connection)
22:02:12Zevvhttp://zevv.nl/div/a.png
22:02:40ZevvC- for aesthetics tho
22:03:02Prestigefancy
22:03:20disruptekwtf am i looking at?
22:03:38disruptekall i know is, i'm the center of the fucking universe.
22:03:58PMunchIs this the current one?
22:04:10Zevvjun 01, .nl time
22:04:32disruptekpmunch, you're dead to me.
22:04:35disruptekyou hear me?
22:04:37disruptekDEAD.
22:04:38PMunchHaha :P
22:04:51PMunchI'm dead to a lot of people it seems
22:05:11PMunchBut if it's only June 1st it's not that strange since I've been AFK almost all day
22:05:22disruptekcfg says avatarfighter is in charge.
22:05:25FromDiscord<exelotl> no fair, bung is on there 3 times and I'm on there zero times
22:05:27alehander92my browser
22:05:33alehander92says the image says errors!!
22:05:41alehander92i want image without errors
22:05:52Zevvyeah making a new one, all of may
22:05:54alehander92oh man i have to sleep
22:05:55Zevvdot is crunching
22:05:56Zevvready
22:06:22Prestigeare the lines drawn from direct pings Zevv ?
22:06:38Zevvnah it's two successive nick pairs
22:06:38FromDiscord<exelotl> though I'd feel a little bit uncomfortable being on a graph with someone called "cut a weeb and a pedo bleeds"
22:06:52Zevvyeah I was a bit distracted by that one as well
22:06:57PrestigeLol
22:07:16disruptekone leg of a love triangle between yardanico and rika.
22:07:22alehander92ok i wget-ed it
22:07:25alehander92my firefox just couldnt
22:07:54Zevvlet's keep it to 1 day
22:07:54Zevvbusy enough here
22:07:56PMunchHaha, the all of may one was a bit too busy?
22:07:58alehander92guys how can you see anything
22:08:04PrestigeI just feh <url>
22:08:07alehander92i just see a mess and my pc hangs a bit
22:08:26*NimBot joined #nim
22:08:40Zevvhttp://ix.io/2o4r
22:08:41PMunchOh it's the same link :P
22:09:06alehander92ok many thick links
22:09:09alehander92thanks
22:09:16Zevvyeah, I have only one link, all I can pay for
22:09:37disruptekix.io has really raise their rates.
22:10:06alehander92not really sure what to make out of it
22:10:08Prestigerates>
22:10:10Prestigewhat
22:12:08Prestigedo those get deleted automatically?
22:13:14Avatarfighterwait what am I in charge of
22:15:22*couven92 quit (Ping timeout: 256 seconds)
22:15:58ZevvZzzZZ
22:16:55*PMunch quit (Quit: leaving)
22:19:27*sagax joined #nim
22:35:56FromDiscord<dom96> Nim has really made me uncomfortable with languages that do not have mutable strings
22:36:11FromDiscord<willyboar> @PMunch why don't you pick another blogging platform?
22:36:13FromDiscord<dom96> It's fine to create an array, append chars to it and then call `join` right? 😛
22:39:56AvatarfighterWhat language are you appending chars to an array lol dom96 ?
22:43:18FromDiscord<dom96> javascript
22:46:19FromDiscord<Rika> Javascript has immutable strings?
22:48:54FromDiscord<dom96> sure
22:53:28FromDiscord<Zachary Carter> Immutable strings are like the last thing in JS that makes me uncomfortable with that language
22:54:16FromDiscord<Zachary Carter> and that also means you're uncomfortable with pretty much all functional languages 😛
22:54:39FromDiscord<Zachary Carter> but JS is terrible
23:02:12alehander92typescript is ok
23:02:18alehander92guys i wondered
23:02:29alehander92electron can be replaced by electron-wasm
23:02:53alehander92which can be mapped to native code on other platforms and be like a much faster normal electron
23:03:34alehander92is this what flutter/etc tries to do? people probably realized that in 2018
23:03:47disruptekwhy don't you just open the vein right now.
23:03:50disruptekjust do it to me.
23:03:57disruptekdo me up like a mountain fucking warrior.
23:10:23alehander92ok, no more web tech talk for now
23:18:37FromDiscord<willyboar> hehe dis really hates web dev
23:21:25FromDiscord<willyboar> (edit) 'dis' => 'disruptek'
23:23:15FromDiscord<Zachary Carter> it's the worst
23:23:32FromDiscord<willyboar> 😛 I see it coming
23:26:50FromDiscord<willyboar> but i am waiting for your blazor nim clone
23:27:29FromDiscord<Zachary Carter> every time I start on something web related
23:27:37FromDiscord<Zachary Carter> I remember 15 minutes later how much I hate web dev
23:28:17FromDiscord<Zachary Carter> I already have to do it for work - I can't bring myself to do it in my spare time
23:36:16bunganyone can help me with? https://github.com/bung87/tim_sort/blob/master/src/tim_sort.nim
23:36:43*blackbeard420 joined #nim
23:37:07bungI port from python version compare line by line 3 times, but it will fails on test2.nim
23:44:14*adnan338 joined #nim
23:44:47adnan338Hi. is `new(result)` only necessary when a function returns a ref object type?
23:45:52FromDiscord<exelotl> yep
23:46:02FromDiscord<exelotl> (well, any ref type)
23:47:07adnan338ok. Thank you.
23:47:09*adnan338 quit (Remote host closed the connection)
23:47:49*adnan338 joined #nim
23:48:30adnan338What about Option[Tree[T]] where Tree[T] = ref object of RootObj? Option is not a ref type, is it?
23:50:06FromDiscord<exelotl> you don't need to new() the Option itself
23:50:19leorize[m]Option is not a ref type
23:59:40*dadada quit (Ping timeout: 265 seconds)