00:02:42 | FromDiscord | <dayl1ght> Rika: your example (https://play.nim-lang.org/#ix=2nZd) used & to concatenate the strLitNode |
00:02:51 | FromDiscord | <dayl1ght> why does & work and fmt doesn't? |
00:02:57 | Yardanico | because they're different |
00:03:05 | Yardanico | https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp |
00:05:26 | * | sschwarzer quit (Quit: leaving) |
00:05:53 | FromDiscord | <dayl1ght> that link talks about generalized raw string literals and escaping, I still don't understand why fmt doesn't work |
00:05:59 | leorize[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:11 | FromDiscord | <dayl1ght> I get an error that I'm expanding it with an undeclared identifier when I use `fmt` inside a quotation |
00:06:11 | Yardanico | leorize[m]: oh thanks :P |
00:06:17 | Yardanico | i did it with macros hehe |
00:06:26 | leorize[m] | lol |
00:06:35 | Avatarfighter | lmao |
00:07:11 | Avatarfighter | Welp I fixed my issue, it was all because of uri not parsing my url with a space in front .-. |
00:07:45 | Yardanico | strip exists |
00:08:07 | Avatarfighter | I know, I just wasn't aware that some of the urls I was scraping had a space in front of them |
00:10:15 | Yardanico | leorize[m]: backport as in PR title or somewhere else? |
00:10:27 | leorize[m] | yea |
00:10:44 | leorize[m] | or in the commit message, your choice |
00:12:14 | Yardanico | well it's simpler to do in the PR title |
00:12:19 | FromDiscord | <dayl1ght> yardanico: this is what I mean https://play.nim-lang.org/#ix=2nZu |
00:12:39 | FromDiscord | <dayl1ght> if I'm reading that link correctly calling it with `.fmt` should not create a generalized raw string literal |
00:13:12 | Yardanico | leorize[m]: done |
00:13:18 | Yardanico | added a test to template one too |
00:14:26 | Yardanico | i'm doing this also because I use nimlsp myself lol |
00:14:41 | Yardanico | well, with vscode-nim-lsp by bung_ |
00:16:03 | bung_ | am happy someone decide to patch nimsuggest |
00:16:20 | Yardanico | bung_: well I did two PRs |
00:16:22 | leorize[m] | @dayl1ght what are you trying to do? |
00:16:26 | Yardanico | they'll fix some phantom errors I had |
00:16:40 | FromDiscord | <dayl1ght> leorize: just want to understand why fmt doesn't work and & does |
00:16:41 | * | aav1o2 joined #nim |
00:16:44 | bung_ | let me see , I checked one |
00:16:59 | Yardanico | bung_: https://github.com/nim-lang/Nim/pull/14526 and https://github.com/nim-lang/Nim/pull/14527 |
00:17:01 | disbot | ➥ Fix `compiles` for nimsuggest [backport] |
00:17:18 | Yardanico | lemme rebuild nimlsp with these changes |
00:17:53 | leorize[m] | @dayl1ght: quote do work on the passed ast |
00:18:45 | Yardanico | yeah, seems to work fine now |
00:19:25 | bung_ | https://github.com/nim-lang/Nim/pull/14526 this one actually I need |
00:19:26 | disbot | ➥ Change severity of template instantiation message [backport] ; snippet at 12https://play.nim-lang.org/#ix=2nZ8 |
00:20:02 | leorize[m] | @dayl1ght the `a` in x1 wasn't part of the ast, so it didn't get substituted |
00:20:08 | bung_ | when debuging nimlsp it just anoying me |
00:20:17 | Yardanico | bung_: :D |
00:20:31 | Yardanico | well I hope I didn't mess up stuff in #14527 |
00:20:32 | disbot | https://github.com/nim-lang/Nim/pull/14527 -- 3Fix `compiles` for nimsuggest [backport] |
00:20:47 | Yardanico | we just need more nimsuggest tests I guess |
00:20:49 | Yardanico | for edge cases |
00:21:10 | leorize[m] | now I need PMunch to have highlighting working so that I will have Yardanico help me with fixing highlight-related bugs |
00:21:16 | Yardanico | lol |
00:21:39 | FromDiscord | <dayl1ght> leorize: not sure I understand what you're saying |
00:21:40 | FromDiscord | <Technisha Circuit> sent a code paste, see http://ix.io/2nZw |
00:22:05 | FromDiscord | <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:21 | Yardanico | @Technisha pragmas should after the name |
00:22:24 | Yardanico | not after the type |
00:22:30 | FromDiscord | <Technisha Circuit> Oh okay |
00:22:40 | Yardanico | like let discord {.exportc.}: JsObject = require "discord.js" |
00:22:54 | FromDiscord | <Technisha Circuit> Oh okay, I don't like that but okay :p |
00:22:56 | FromDiscord | <Technisha Circuit> Thanks! |
00:23:39 | FromDiscord | <dayl1ght> leorize: so quote receives the AST for "{a}".fmt and doesn't have the identifier for a in the ast? |
00:23:56 | FromDiscord | <dayl1ght> and that AST doesn't include the identifier for a* |
00:24:27 | FromDiscord | <dayl1ght> whereas the AST for `" " & a` does |
00:24:45 | FromDiscord | <Technisha Circuit> Why is it when I'm doing `let` in Nim it comes out as `var` in the generated JS? |
00:24:53 | Yardanico | because nim uses var for JS |
00:25:01 | Yardanico | and let in Nim and JS are really different things |
00:25:09 | Yardanico | let in JS is about scoping, and it's about immutability in Nim |
00:25:39 | leorize[m] | @dayl1ght the ast for ```"{`a`}".fmt``` is: ```DotExpr(StrLit"{`a`}", Ident"fmt")``` |
00:27:23 | leorize[m] | as you can see, there wasn't any `a` node to substitute the ast in |
00:28:10 | FromDiscord | <dayl1ght> that's pretty confusing |
00:28:25 | FromDiscord | <dayl1ght> seems like it would only happen for fmt specifically in macros |
00:28:36 | Yardanico | because fmt and & are macros too |
00:28:52 | FromDiscord | <dayl1ght> I'm using the & proc I think |
00:29:31 | Yardanico | ah right yes |
00:29:40 | Yardanico | that is a string concat operation in nim |
00:29:43 | Yardanico | well, proc |
00:29:53 | FromDiscord | <dayl1ght> yeah, the confusing part is that it looks like |
00:30:01 | FromDiscord | <dayl1ght> macros that use strings as their input won't work inside other macros |
00:30:26 | FromDiscord | <dayl1ght> I mean macros that use strings the same way `fmt` does |
00:33:43 | Yardanico | ah shoot |
00:34:46 | Yardanico | turns out in https://github.com/nim-lang/Nim/pull/14517 I needed to do used for the first await template too |
00:34:47 | disbot | ➥ Disable unused warnings for await in async macro |
00:35:49 | FromDiscord | <Technisha Circuit> > let in JS is about scoping, and it's about immutability in Nim↵Oh okay |
00:36:13 | Yardanico | I mean in most cases nim can emit "let" too, but it doesn't really have any real world advantages I think |
00:36:31 | disruptek | i wish the bridge didn't pass quotes that way. |
00:36:43 | Yardanico | disruptek: what way would you like? |
00:37:05 | disruptek | well, we make do without quotes on irc. it's expected. |
00:37:20 | FromDiscord | <Technisha Circuit> Is there a way to make Nim use let from js? |
00:37:29 | Yardanico | modify js backend |
00:37:29 | disruptek | .emit |
00:37:44 | Yardanico | well if you only want let for some variables, yeah, you can do with emit or stuff |
00:37:48 | FromDiscord | <Technisha Circuit> Is there no `jsLet` :p |
00:37:55 | Yardanico | but if you want to have let for most JS code you need to modify js backend |
00:37:58 | Yardanico | why do you want let though? |
00:38:05 | FromDiscord | <Technisha Circuit> Awe okay |
00:38:18 | FromDiscord | <Technisha Circuit> Just because my logic is annoying me |
00:38:26 | disruptek | you can make a jsLet easily. |
00:38:27 | FromDiscord | <Technisha Circuit> (edit) 'Awe' => 'Aww' |
00:38:36 | FromDiscord | <Technisha Circuit> Oh? How? |
00:38:47 | bung_ | before js gen add a block: |
00:38:54 | disruptek | write a macro. |
00:39:34 | FromDiscord | <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:06 | bung_ | it's in jsgen.nim 1055 line |
00:45:00 | * | lritter joined #nim |
00:49:48 | FromDiscord | <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:21 | Yardanico | why do you do parsefloat = ? |
00:50:30 | * | aav1o2 left #nim ("Leaving") |
00:50:32 | Yardanico | parseFloat takes a string and _returns_ a float |
00:50:35 | FromDiscord | <ThothLoki> btc and usdbtc are textboxes |
00:50:48 | FromDiscord | <ThothLoki> and btcvalue is a jsonnode |
00:50:56 | Yardanico | how does btcValue look like? |
00:50:59 | Yardanico | I mean JSON |
00:51:14 | * | fredrikhr quit (Ping timeout: 256 seconds) |
00:51:26 | FromDiscord | <ThothLoki> {"9394.12"} |
00:51:27 | Yardanico | and what textbox do you want to assign the value to? |
00:51:52 | FromDiscord | <Yardanico> ah i see |
00:52:02 | FromDiscord | <Yardanico> ```nim↵btc.onTextChange = proc(event: TextChangeEvent) = ↵ usdbtc.text = parseFloat(btc.text) * btcValue.getFloat()↵``` |
00:52:06 | FromDiscord | <Yardanico> something like that I think |
00:52:18 | FromDiscord | <ThothLoki> i am taking a value from `btc`, multiplying it by `btcvalue` and setting that to `usdbtc` |
00:52:21 | FromDiscord | <Yardanico> ah wait |
00:52:21 | FromDiscord | <ThothLoki> let me try that |
00:52:28 | FromDiscord | <Yardanico> ```↵btc.onTextChange = proc(event: TextChangeEvent) = ↵ usdbtc.text = $(parseFloat(btc.text) * btcValue.getFloat())↵``` |
00:52:36 | FromDiscord | <Yardanico> $ is stringify operator in Nim |
00:54:10 | * | dadada__ quit (Ping timeout: 246 seconds) |
00:54:36 | FromDiscord | <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:03 | FromDiscord | <ThothLoki> that kinda compiled |
00:56:29 | FromDiscord | <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:37 | FromDiscord | <Yardanico> wdym by "won't run"? |
00:56:40 | FromDiscord | <Yardanico> what's the error |
00:56:50 | FromDiscord | <ThothLoki> Error: execution of an external program failed: |
00:56:58 | FromDiscord | <Yardanico> well how did you compile the app? |
00:57:01 | FromDiscord | <Yardanico> nim c app.nim ? |
00:57:11 | FromDiscord | <ThothLoki> nim c -r app.nim |
00:57:19 | FromDiscord | <Yardanico> well then it's probably a code issue, what error did you get? |
00:57:51 | FromDiscord | <ThothLoki> now when i double click on the executable, it just opens a terminal and does nothing |
00:58:19 | FromDiscord | <Yardanico> well with nim c -r app.nim it should show the error stack trace |
00:58:26 | FromDiscord | <ThothLoki> i am sure i need to authorize it in 10 different areas in macos |
00:58:40 | FromDiscord | <ThothLoki> it compiled. but wont run |
00:58:41 | * | dadada joined #nim |
00:58:46 | FromDiscord | <Yardanico> well what's the error? full output |
00:59:05 | * | dadada is now known as Guest47452 |
00:59:49 | FromDiscord | <Yardanico> sent a code paste, see http://ix.io/2nZB |
01:00:02 | FromDiscord | <Yardanico> if a user inputs something other than a number in btc.text |
01:00:28 | FromDiscord | <ThothLoki> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716818410415194142 |
01:00:41 | FromDiscord | <Yardanico> oh yeah, nigui on macos needs gtk |
01:00:48 | FromDiscord | <Yardanico> nigui doesn't have a native macos backend |
01:00:54 | FromDiscord | <ThothLoki> lol. |
01:00:58 | FromDiscord | <ThothLoki> is there a better gui? |
01:01:11 | FromDiscord | <ThothLoki> i just threw a dart and landed on that one |
01:01:20 | FromDiscord | <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:33 | FromGitter | <ynfle> Is there a way to inject a proc or template in to the global scope? |
01:01:43 | FromGitter | <sealmove> how to efficiently generate `x` random numbers in range a..b? |
01:01:47 | Yardanico | what do you mean by that @ynfle? |
01:02:14 | * | konvertex quit (Ping timeout: 240 seconds) |
01:02:49 | FromDiscord | <Yardanico> @sealmove just call rand in a loop? |
01:03:08 | FromGitter | <sealmove> I want them to be disjoint |
01:03:14 | FromDiscord | <Yardanico> wdym? |
01:03:18 | FromGitter | <sealmove> like result should be a set of cardinality x |
01:03:47 | FromDiscord | <Yardanico> well add an if check 😛 |
01:04:04 | FromDiscord | <Yardanico> but really I don't think there's a optimized proc for that in stdlib |
01:04:09 | FromGitter | <sealmove> that's not efficient though |
01:04:11 | FromGitter | <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:27 | FromGitter | <sealmove> then is there a standard way to implement it? :P |
01:04:33 | Yardanico | @ynfle well if they call your template in the global scope you can inject in the global scope |
01:04:37 | Yardanico | @sealmove I don't think so really |
01:04:41 | FromDiscord | <Technisha Circuit> > it's in jsgen.nim 1055 line↵Thanks! |
01:04:52 | FromGitter | <ynfle> Without them importing anything |
01:05:02 | Yardanico | @ynfle well that's not really possible easily |
01:05:09 | Yardanico | they somehow need to include/import your module |
01:05:33 | FromGitter | <ynfle> I am the one importing their code' |
01:05:50 | Yardanico | well you can use "include" to literally include the module contents of their file into your module |
01:05:51 | FromGitter | <ynfle> I could use `include` but then the error show my code lines |
01:05:57 | Yardanico | what error? |
01:06:00 | Yardanico | ah well |
01:06:05 | Yardanico | there's no other way really I think |
01:06:07 | bung_ | sealmove https://numpy.org/devdocs/reference/random/index.html |
01:06:20 | Yardanico | bung_: that's not for nim :P |
01:06:28 | bung_ | check there , maybe you can find implementation in nim... |
01:06:44 | bung_ | Yardanico I know that, just for inspir.. |
01:08:59 | * | aeverr joined #nim |
01:10:23 | * | Guest47452 quit (Ping timeout: 265 seconds) |
01:10:24 | bung_ | I guess mratsim should know |
01:10:49 | Yardanico | lol |
01:13:46 | * | dadada joined #nim |
01:14:01 | FromGitter | <sealmove> ok is there a way to randomize an array? |
01:14:05 | Yardanico | yes |
01:14:07 | Yardanico | shuffle should work |
01:14:10 | * | dadada is now known as Guest57561 |
01:14:11 | FromGitter | <sealmove> nice! |
01:14:17 | Yardanico | https://nim-lang.org/docs/random.html#shuffle%2CopenArray%5BT%5D |
01:14:26 | FromGitter | <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:51 | Avatarfighter | Would 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:51 | Avatarfighter | I 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:23 | FromDiscord | <treeform> hey is there a pragma to disable `{.overflowChecks: off.}` ? |
02:05:59 | FromDiscord | <treeform> it looks like `{.push overflowChecks: off.}`/`{.pop.}` |
02:06:04 | FromDiscord | <treeform> but it does not do what I want grr |
02:06:48 | FromGitter | <sealmove> can I use regex or prg in nimscript? |
02:07:05 | Yardanico | https://github.com/nitely/nim-regex works at compiletime |
02:07:07 | Yardanico | random - yes |
02:07:15 | Yardanico | but you need to call randomize with a seed explicitly |
02:07:24 | * | dadada__ quit (Ping timeout: 256 seconds) |
02:07:41 | Yardanico | randomize(some_number_which_should_be_different_for_different_runs_of_the_program) |
02:08:03 | FromGitter | <sealmove> hmm maybe this is enough https://nim-lang.org/docs/strscans.html |
02:13:47 | * | dadada joined #nim |
02:13:48 | FromGitter | <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:01 | FromGitter | <matrixbot> `sendell` I mean in the end the semantic is the same, it's only a matter of optimization |
02:14:03 | disruptek | you don't. |
02:14:09 | * | dadada is now known as Guest35592 |
02:14:10 | FromGitter | <matrixbot> `sendell` (is it? :p) |
02:14:26 | disruptek | yes, it's a matter of optimization. |
02:14:48 | disruptek | the optimizer is not infallible. |
02:14:54 | disruptek | that's where you can help... |
02:15:42 | FromGitter | <matrixbot> `sendell` when would it be beneficial to avoir a sink parameter passing ? |
02:15:44 | FromGitter | <matrixbot> `sendell` avoid* |
02:16:02 | disruptek | i don't understand. |
02:16:21 | disruptek | if the value sinks, you can annotate it in case it helps the compiler. otherwise, it doesn't matter. |
02:16:38 | disruptek | there's no time that it's beneficial to avoid a sink that is otherwise necessary. |
02:16:50 | disruptek | we're talking about something that makes fast code faster. |
02:16:55 | disruptek | it's free if we can optimize it. |
02:17:02 | disruptek | else, it costs what it costs. as ever. |
02:18:23 | FromGitter | <matrixbot> `sendell` but why couldnt every formal parameter declared as sink ? |
02:18:29 | FromGitter | <matrixbot> `sendell` be declared* |
02:18:38 | disruptek | if they all sink, they can. |
02:18:42 | FromGitter | <matrixbot> `sendell` formal as "in proc declaration" |
02:19:15 | Yardanico | there's sink inference by default |
02:19:29 | Yardanico | which already detects where "sink" can be placed in most cases |
02:19:45 | Yardanico | you can explicitly annotate with "sink" yourself if the compiler doesn't |
02:20:04 | disruptek | ehh i would say sink inference is a little premature. |
02:20:35 | disruptek | if you're not sure it's a sink, don't add the annotation. and i wouldn't use sink inference yet, either. |
02:20:42 | disruptek | just write your code as you would normally. |
02:22:16 | FromGitter | <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:30 | FromGitter | <matrixbot> `sendell` and sinking a var parameter doesnt make sense, if I get it correctly |
02:23:03 | disruptek | sink is like the auschwitz of memory management. |
02:23:14 | disruptek | the bytes go in but ze don't get out! |
02:23:25 | Yardanico | @sendell sink shouldn't be wrong in any place |
02:23:31 | FromGitter | <matrixbot> `sendell` exactly |
02:23:33 | Yardanico | since if a variable cannot be sinked the compiler will just make a copy |
02:23:35 | disruptek | if 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:25 | FromGitter | <matrixbot> `sendell` it doesnt have to die, take "add" procs for data structures |
02:25:30 | FromGitter | <matrixbot> `sendell` it just takes ownership |
02:25:45 | disruptek | yes, but that's a move. |
02:26:17 | * | rockcavera joined #nim |
02:26:23 | disruptek | just don't worry about it if you find it confusing. |
02:26:23 | * | muffindrake joined #nim |
02:26:48 | disruptek | it's more important that people use arc than it is that they understand it. |
02:28:28 | * | bab quit (*.net *.split) |
02:29:21 | FromGitter | <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:31 | FromGitter | <matrixbot> `sendell` I can use it without understanding, of course :) |
02:30:03 | disruptek | because the alternative is that sometimes the compiler cannot determine statically went the value will sink. |
02:30:23 | FromGitter | <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:54 | disruptek | i think some of the stdlib has been manually annotated; that could demonstrate some common patterns. |
02:32:07 | Yardanico | also @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:11 | disruptek | it's just about the last thing i'd look into optimizing. |
02:32:13 | Yardanico | to 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:36 | disruptek | arc is already much faster for the performance-sensitive stuff i'm working on. |
02:32:49 | * | bab joined #nim |
02:34:06 | FromGitter | <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:26 | Yardanico | yeah |
02:34:28 | disruptek | yeah, but that's sorta a dead-end compared to arc. |
02:34:35 | disruptek | just ignore it. |
02:35:16 | FromGitter | <matrixbot> `sendell` oh ok I thought it was going to be a part of it |
02:35:42 | disruptek | it was an experiment that helped found the arc approach. |
02:36:04 | FromGitter | <matrixbot> `sendell` i see |
02:36:58 | FromGitter | <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:09 | FromGitter | <matrixbot> `sendell` and the owned refs would have been like unique pointers |
02:37:26 | * | Guest35592 quit (Ping timeout: 256 seconds) |
02:37:59 | FromGitter | <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:01 | FromGitter | <matrixbot> `sendell` the web version |
02:38:07 | Yardanico | @matrixbot no you didn't understand |
02:38:22 | Yardanico | right now you're connected to Gitter from Matrix |
02:38:31 | Yardanico | and we get your messages like Matrix -> Gitter -> IRC |
02:38:42 | Yardanico | with 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:10 | FromGitter | <matrixbot> `sendell` oh ok :) |
02:39:10 | FromGitter | <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:30 | sendell | is that better ? |
02:45:38 | Yardanico | ye :) |
02:45:42 | Yardanico | much better :P |
02:46:05 | sendell | hehe |
02:47:24 | * | mono quit (Ping timeout: 256 seconds) |
02:47:48 | * | Cadey1 joined #nim |
02:48:24 | sendell | <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:50 | sendell | especially noticeable for big heaps |
02:49:02 | Yardanico | well 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:09 | Yardanico | https://nim-lang.org/docs/gc.html |
02:50:18 | * | salotz[m] joined #nim |
02:52:47 | disruptek | there are multiple gains. |
02:53:07 | disruptek | the main one is that there's no stop-the-world. it's very deterministic. |
02:53:35 | sendell | yeah that's huge |
02:53:39 | disruptek | so 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:01 | disruptek | we'll be able to do scope-based allocators, automatic scope-based destruction, and more optimization that we haven't even touched yet. |
02:55:27 | sendell | how is shared heap possible if the ref counting is not atomic ? |
02:55:43 | disruptek | threads own subgraphs in memory. |
02:56:21 | FromDiscord | <lex> sorry, hi |
02:56:29 | FromDiscord | <lex> is nim-prompt for CLI tools or is it a GUI prompt |
02:56:32 | FromDiscord | <lex> I hope it is the latter |
02:56:37 | disruptek | !repo nim-prompt |
02:56:38 | disbot | https://github.com/icyphox/nicy -- 9nicy: 11:snowflake: a nice and icy ZSH prompt in Nim 15 132⭐ 7🍴 7& 2 more... |
02:56:43 | Yardanico | not this one |
02:56:44 | disruptek | !repo prompt |
02:56:46 | disbot | https://github.com/icyphox/nicy -- 9nicy: 11:snowflake: a nice and icy ZSH prompt in Nim 15 132⭐ 7🍴 7& 5 more... |
02:56:48 | Yardanico | @lex which one did you mean? |
02:56:53 | Yardanico | please give link to the repo |
02:57:03 | FromDiscord | <lex> https://github.com/surf1nb1rd/nim-prompt |
02:57:05 | FromDiscord | <lex> I meant this but |
02:57:07 | FromDiscord | <lex> nicy looks good too |
02:57:15 | Yardanico | nicy is for zsh |
02:57:21 | FromDiscord | <lex> zsh only? |
02:57:21 | Yardanico | it's not for nim programs |
02:57:29 | Yardanico | and prompt seems to be cli only of course |
02:57:32 | FromDiscord | <lex> ah fuck ok |
02:57:33 | Yardanico | it's about terminal prompt stuff |
02:57:36 | FromDiscord | <lex> prompt has no example code? |
02:57:37 | FromDiscord | <lex> (edit) 'code?' => 'code' |
02:57:41 | disruptek | i think nim-prompt is pretty simple stuff iirc. |
02:57:44 | FromDiscord | <lex> is there any you could possibly provide? |
02:57:46 | Yardanico | what do you want? a simple gui dialogue? |
02:57:51 | FromDiscord | <lex> nah nah |
02:57:51 | FromDiscord | <lex> I want CLI |
02:58:00 | FromDiscord | <lex> its just I was wondering cause I saw some Widget stuff in there |
02:58:06 | FromDiscord | <lex> and GTK2/3 popped in mind idk why |
02:58:19 | disruptek | have you been doing a lot of pcp? |
02:58:24 | disruptek | that's usually what happens to me. |
02:58:57 | FromDiscord | <lex> nah haha |
02:59:08 | disruptek | meth, then. |
02:59:12 | FromDiscord | <treeform> wow `distinctBase` is really cool, it allows unwrapping distinct types in generics. I am a wizard now. |
02:59:15 | FromDiscord | <lex> wait |
02:59:18 | FromDiscord | <lex> you're talking about drugs? |
02:59:20 | FromDiscord | <lex> oh shit |
02:59:23 | FromDiscord | <lex> didnt even realise ngl |
02:59:40 | disruptek | treeform: it really is, but with great power... |
02:59:46 | FromDiscord | <lex> wait |
02:59:49 | FromDiscord | <lex> nim-prompt is old asf |
02:59:54 | FromDiscord | <lex> are there any other better prompt libraries |
03:00:00 | FromDiscord | <lex> if not i may as well as just write my own |
03:00:09 | disruptek | you need to do that thing. |
03:00:15 | FromDiscord | <lex> wat? |
03:00:21 | disruptek | nimph has an open ticket for such an animal. |
03:00:32 | disruptek | a meth high can last days, dude. |
03:00:34 | FromDiscord | <lex> are u high bro |
03:00:37 | disruptek | this is the perfect opportunity. |
03:00:49 | disruptek | make sure you have plenty of water. |
03:01:27 | FromDiscord | <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:35 | disruptek | i 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:00 | disruptek | i 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:33 | disruptek | it's on the fucking calculator key. |
03:07:28 | * | dadada__ quit (Ping timeout: 256 seconds) |
03:07:35 | sendell | <disruptek "threads own subgraphs in memory."> how is that enforced ? don't find any doc or examples |
03:07:56 | disruptek | it's not done yet. |
03:08:10 | sendell | haha ok, that's why :D |
03:08:26 | sendell | so there's not much to play with at the moment :( |
03:08:33 | Yardanico | why? arc already works |
03:08:33 | disruptek | sure there is. |
03:08:35 | Yardanico | destructors work |
03:09:10 | sendell | yeah but I mean the semantics didnt change, except the obligation to break cycles manually |
03:09:17 | Yardanico | there's orc for cycles |
03:09:23 | sendell | the sink and lent stuff is infered |
03:09:30 | Yardanico | lent is not inferred |
03:09:39 | disruptek | the semantics definitely changed, but not in a way that matters for naive code. |
03:09:53 | disruptek | unless you consider performance to matter, i mean. |
03:10:31 | sendell | yeah :) |
03:11:05 | disruptek | we need more people testing it. |
03:11:09 | sendell | i'll do some benchmarks |
03:11:49 | * | dzamo[m] joined #nim |
03:11:49 | * | codic joined #nim |
03:11:51 | sendell | <Yardanico "there's orc for cycles"> that reintroduces a stop the world phase right ? |
03:11:54 | disruptek | a couple weeks ago i might have said it was alpha-grade, but i'd say it's beta-grade now. |
03:12:06 | disruptek | no, there's no stop-the-world. |
03:12:13 | Yardanico | sendell: even nim default GC is not really stop the world |
03:12:34 | disruptek | refc is pretty realtime, honestly. |
03:12:35 | sendell | it is, but tweakable and incremental |
03:12:38 | sendell | right ? |
03:13:07 | sendell | i 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:19 | sendell | but it still stops the program execution |
03:13:39 | disruptek | true, but it's not "however long it takes, it takes" |
03:13:42 | * | dadada joined #nim |
03:13:53 | sendell | yeah that's awesome already :) |
03:14:05 | * | dadada is now known as Guest56930 |
03:14:08 | disruptek | most gc is like, "well, you shouldn't have freed all that shit if you didn't want me to collect it" |
03:14:13 | disruptek | which is annoying as fuck. |
03:14:15 | sendell | will it be depreciated at some point ? |
03:14:20 | disruptek | i mean, that's the whole fucking reason i'm using a gc. |
03:14:25 | Yardanico | sendell: refc? probably yes |
03:14:33 | sendell | like will arc replace refc in 2.0? |
03:14:36 | Yardanico | current goal is to make compiler work with arc |
03:14:42 | * | j4nvkvc joined #nim |
03:14:44 | Yardanico | there's a couple bugs left |
03:15:20 | Yardanico | but yeah, arc should become the default, not sure how soon though :P |
03:15:24 | Yardanico | well, probably not arc but orc |
03:15:25 | disruptek | probably 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:49 | sendell | <disruptek "no, there's no stop-the-world."> really curious about how that was implemented then |
03:16:25 | disruptek | i don't know the old gc, only arc. |
03:16:31 | leorize[m] | orc is actually faster than refc btw :P |
03:16:39 | Yardanico | leorize[m]: depends on the benchmarks |
03:16:44 | Yardanico | sometimes it's still slower (even arc) :( |
03:16:51 | Yardanico | but yeah, in a lot of cases it is |
03:16:53 | Yardanico | and it's better anyway |
03:16:57 | leorize[m] | 4raq based orc on bacon dingle iirc |
03:17:03 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:17:30 | disruptek | there'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:48 | Yardanico | leorize[m]: yeah |
03:17:49 | disruptek | maybe i'm just more sensitive to how i write stuff. i don't annotate anything, though. |
03:18:03 | Yardanico | disruptek: well your use case is kinda specific |
03:18:06 | sendell | the doc says "trial deletion" |
03:18:11 | sendell | i'll have a look at it |
03:18:20 | disruptek | my use case? |
03:18:27 | Yardanico | sendell: https://github.com/nim-lang/Nim/blob/devel/lib/system/cyclicrefs_bacon.nim |
03:18:36 | sendell | thx |
03:19:50 | Yardanico | also for experimenting with arc/orc it's much better to use devel for now |
03:19:53 | Yardanico | until 1.2.2 is released |
03:20:09 | Yardanico | but even then arc is a new feature so new fixes might arrive on devel :P |
03:21:30 | sendell | yeah good point |
03:21:33 | sendell | i will |
03:21:48 | sendell | is that the paper ? https://researcher.watson.ibm.com/researcher/files/us-bacon/Dingle07Ownership.pdf |
03:22:00 | Yardanico | you can check the papers from the file itself |
03:22:07 | Yardanico | check the comments in the start |
03:22:14 | Yardanico | in cyclicrefs_bacon.nim |
03:22:35 | sendell | oh yeah thx |
03:23:05 | sendell | same guys, different paper :p |
03:24:56 | * | stefantalpalaru joined #nim |
03:25:34 | Yardanico | also 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:23 | Yardanico | like "Warning: 'result.a = result' creates an uncollectable ref cycle; annotate 'a' with .cursor" |
03:26:40 | Yardanico | although 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:33 | leorize[m] | Windows docgen is broken and no one is noticing :/ |
03:45:35 | leorize[m] | (on devel) |
03:45:46 | Yardanico | leorize[m]: you mean the compiler error? |
03:46:10 | Yardanico | it only happens if you try to build nim with already built nim though, maybe because of configs or something like that |
03:46:12 | leorize[m] | yea |
03:46:20 | Yardanico | and https://github.com/nim-lang/Nim/commit/004b0759c5743f4b50766a14b0a47477b72bbac9 fixed ci docs for windows |
03:46:24 | leorize[m] | no, I mean the current CI failures |
03:46:30 | * | zacharycarter quit (Ping timeout: 265 seconds) |
03:46:30 | Yardanico | which ones? |
03:46:39 | Yardanico | check the commit i linked |
03:46:44 | leorize[m] | ah it's fixed |
03:56:22 | FromDiscord | <ThothLoki> yay! it works https://media.discordapp.net/attachments/371759389889003532/716862678844571719/unknown.png |
03:57:14 | FromDiscord | <ThothLoki> now that i can make it work. time to make it pretty |
03:57:37 | * | dddddd quit (Ping timeout: 265 seconds) |
04:01:35 | FromGitter | <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:35 | FromGitter | ... `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:41 | Prestige | Hmm 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:30 | FromGitter | <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:18 | leorize[m] | Prestige: let me know if you find one :P |
04:24:31 | * | zacharycarter quit (Ping timeout: 246 seconds) |
04:25:13 | leorize[m] | @bdadsetan https://github.com/nim-lang/Nim/blob/c0dbcffca643ac79e0c03c9509e92f5841b38a94/lib/system/ansi_c.nim#L120 |
04:35:15 | * | zacharycarter joined #nim |
04:37:31 | FromDiscord | <Elegant Beef> I think a majority of us want that prestige |
04:37:33 | * | Guest82096 quit (Ping timeout: 256 seconds) |
04:40:05 | disruptek | i just want to live forever. |
04:40:20 | Prestige | I'd like both disruptek |
04:40:21 | disruptek | except when i'm suicidal, i mean. |
04:40:38 | Prestige | Okay 2 out of three |
04:40:41 | FromDiscord | <Elegant Beef> Just dont do that |
04:40:44 | FromDiscord | <Elegant Beef> Problem solved |
04:41:58 | Prestige | My job would be much nicer if we used Nim instead of node. And Linux instead of mac os (maybe unpopular opinion) |
04:42:16 | Prestige | Need to get this language into the market more |
04:43:45 | * | dadada__ joined #nim |
04:47:36 | disruptek | my opinion is that your job would be nicer if you performed while wearing pants. |
04:47:48 | disruptek | i think almost everyone agrees with me on that. |
04:48:00 | disruptek | beef being the obvious exception. |
04:48:27 | FromDiscord | <Elegant Beef> Depends on who "You" is, prostitues would have a less favourable opinion |
04:49:09 | disruptek | unless he has small hands, prostitutes have never had a problem with my pants. |
04:49:30 | disruptek | i think they like the intrigue. it's all part of the chase. |
04:49:36 | bung_ | when you becoming a boss you can do like that |
04:50:24 | disruptek | bosses make the best prostitutes. |
04:50:33 | disruptek | they know how to make you bend over. |
04:50:54 | Prestige | This conversation derailed quickly |
04:51:10 | FromDiscord | <Elegant Beef> You've got me and disruptek here |
04:51:13 | FromDiscord | <Elegant Beef> That's a terrible combo |
04:51:22 | disruptek | aight peace |
04:51:43 | FromDiscord | <Elegant Beef> Man didnt realize i'd get kicked outta the discord for that reason |
04:51:46 | FromDiscord | <Elegant Beef> Thought it'd be a bad joke |
04:55:49 | leorize[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:02 | FromGitter | <zacharycarter> just use another terminal? |
04:57:09 | FromDiscord | <Elegant Beef> I still have to get back to my cool terminal with intellisense like stuff |
04:57:09 | Prestige | Why do people like alacritty so much? |
04:57:19 | FromDiscord | <Elegant Beef> But that's back burnered |
04:57:31 | Prestige | I just use st, it's so nice |
04:57:34 | FromGitter | <zacharycarter> what does a terminal have to do with intellisense? |
04:57:39 | Prestige | Also that ^ |
04:57:54 | Prestige | u can use fish, zsh with plugins, etc. Terminal doesnt matter for that |
04:57:58 | FromDiscord | <Elegant Beef> Auto completion through dropdowns instead of tabs |
04:58:05 | FromDiscord | <Elegant Beef> And image previewing |
04:58:09 | * | FromGitter * zacharycarter is confused |
04:58:11 | leorize[m] | alacritty is fast and the configuration is simple |
04:58:13 | leorize[m] | also it has native wayland support |
04:58:25 | Prestige | Okay wayland is a good reason |
04:58:28 | leorize[m] | `st` on the other hand is a pita with how it handles backspace/delete |
04:58:45 | FromDiscord | <Elegant Beef> Is is what i had before i took my break↵https://streamable.com/5pzu7 |
04:58:48 | Prestige | Hm I've heard of people having issues with that, but haven't witnessed it myself |
04:58:49 | FromDiscord | <Elegant Beef> Before realising PTY |
04:58:55 | FromDiscord | <Elegant Beef> (edit) 'Before realising PTY ... ' => 'Before realising PTYis needed' |
04:59:15 | FromGitter | <zacharycarter> who banned you from discord Beef? |
04:59:22 | leorize[m] | also configuring `st` is a pain |
04:59:28 | FromDiscord | <Elegant Beef> No one it was a joke |
04:59:35 | FromGitter | <zacharycarter> oh okay |
05:00:05 | Prestige | leorize[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:29 | leorize[m] | well you still have to update it |
05:00:47 | leorize[m] | and then some of the patches can't be mixed together |
05:01:00 | Prestige | They can't? |
05:01:51 | leorize[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:27 | Prestige | Oh you mean automatically - yeah, I just resolve the merges by hand |
05:02:32 | leorize[m] | I mean they can, if you spend time to fix the conflicts |
05:03:12 | leorize[m] | but then backspace just give up on you whenever you ssh elsewhere |
05:03:59 | leorize[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:03 | Prestige | I wonder what that's about, I don't have any issues with backspace |
05:04:24 | Prestige | Perhaps that's why |
05:04:37 | leorize[m] | https://wiki.archlinux.org/index.php/St#Keyboard |
05:04:38 | Prestige | I tried alacritty and kitty and dislike them |
05:04:43 | leorize[m] | you need to switch to keypad mode |
05:04:51 | leorize[m] | and many programs/shells can't do this |
05:05:01 | leorize[m] | fish can't for example |
05:05:05 | leorize[m] | (though they probably fixed that by now) |
05:05:39 | Prestige | Would be nice to have a more user-friendly version of st but still be able to hack on it |
05:06:00 | leorize[m] | well you mastered X in Nim :P |
05:06:16 | leorize[m] | maybe you can invent a sensible terminal emulator? |
05:06:18 | leorize[m] | :D |
05:06:23 | Prestige | I 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:25 | Prestige | terms* |
05:07:03 | Prestige | I 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:41 | FromDiscord | <Elegant Beef> Well prestige figure out PTYs and how to handle them and then work on a GPU based terminal with me 😄 |
05:08:56 | Prestige | Haha maybe way down the road... have a couple commitments after I get nimdow to a decent state |
05:09:20 | Prestige | Need 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:17 | FromDiscord | <Elegant Beef> Biggest issue was i naively thought that CLI applications like vim used their stdin stream for inputs from the terminal |
05:13:23 | FromDiscord | <Elegant Beef> So i could not control anything like that |
05:13:44 | * | dadada joined #nim |
05:13:47 | FromDiscord | <Elegant Beef> Which i now know is cause you need a pty and use that how ever it's supposed t obe |
05:13:49 | FromDiscord | <Elegant Beef> (edit) 't obe' => 'to be' |
05:14:08 | * | dadada is now known as Guest7881 |
05:18:00 | leorize[m] | well I mean you can implement vim with just the stdin stream |
05:18:01 | leorize[m] | switch it to raw mode and you're pretty much set |
05:18:50 | FromDiscord | <Elegant Beef> Yea but it's pretty much all applications that dont use the stdin for inputs |
05:19:16 | FromDiscord | <Elegant Beef> So me sending the inputs to those does fuckall |
05:19:52 | FromDiscord | <Elegant Beef> So the obvious solution is to look at proper implementation |
05:19:58 | FromDiscord | <Elegant Beef> Instead of the what i have |
05:20:26 | FromDiscord | <Elegant Beef> But im too daft to figure out how to implement the pty stuff in nim, or wrap the C stuff |
05:20:46 | leorize[m] | `man 7 pty` |
05:21:03 | leorize[m] | it's really descriptive |
05:21:48 | FromDiscord | <Elegant Beef> You underestimate my daftness |
05:23:00 | FromDiscord | <Elegant Beef> Could it be done in pure nim? |
05:23:27 | FromDiscord | <Elegant Beef> Since it is just file opening/getting handles |
05:23:59 | leorize[m] | yes |
05:24:22 | leorize[m] | you should obviously write a wrapper library for it, though |
05:28:17 | Prestige | I've finished implementing floating windows in nimdow, woo. About time |
05:30:49 | FromDiscord | <Elegant Beef> Now why would you go and say a thing like that leo, writting wrappers scares me |
05:31:24 | FromDiscord | <Elegant Beef> Mostly cause all of the C/C++ code i've ever read feels like sandpaper across the retina |
05:31:32 | FromDiscord | <Elegant Beef> Nice prestige |
05:31:38 | Prestige | ty ty |
05:31:53 | FromDiscord | <Elegant Beef> Also do me a favour and implement scrolling workspaces on a screen |
05:32:04 | Prestige | People use that? |
05:32:08 | FromDiscord | <Elegant Beef> IE mod4+1 = scroll monitor 1's workspaces |
05:32:12 | FromDiscord | <Elegant Beef> I did on i3wm |
05:32:16 | FromDiscord | <Elegant Beef> It's so nice imo |
05:32:36 | FromDiscord | <Elegant Beef> had all evens on monitor 2, and odds on monitor 1 |
05:32:57 | FromDiscord | <Elegant Beef> then just just scroll through workspaces |
05:33:05 | FromDiscord | <Elegant Beef> It's actually quite nice |
05:33:26 | FromDiscord | <Elegant Beef> Since i dont really like more than 5 work spaces per monitor anyway |
05:34:56 | Prestige | oh 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:31 | FromDiscord | <Elegant Beef> My setup had me iterating over workspaces when i hit `mod4 + 1` for monitor 1 |
05:35:42 | FromDiscord | <Elegant Beef> `mod4 + 2` iterated over monitor 2 work spaces |
05:36:13 | FromDiscord | <Elegant Beef> mod4 + shift + monNum would iterate in reverse |
05:37:04 | FromDiscord | <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:39 | FromDiscord | <Elegant Beef> So you can actually get easier access to all workspaces above 5 |
05:38:01 | FromDiscord | <Elegant Beef> Make sense? |
05:38:43 | Prestige | Yeah, 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:58 | FromDiscord | <Elegant Beef> Scroll wheel sucks! |
05:39:15 | Prestige | Okay I guess I don't know what you meant lol |
05:39:23 | Prestige | I thought u were talking about using your scroll wheel |
05:39:33 | FromDiscord | <Elegant Beef> Ok so like scroll wheel but using your super + monitor number |
05:39:41 | FromDiscord | <Elegant Beef> Each hit will move it to the next on |
05:39:42 | FromDiscord | <Elegant Beef> (edit) 'on' => 'one' |
05:40:21 | Prestige | Right, each "click" of the scroll wheel changes your workspace number, right? |
05:40:33 | FromDiscord | <Elegant Beef> Well im not talking about mouse |
05:40:40 | FromDiscord | <Elegant Beef> But yea |
05:40:42 | FromDiscord | <Elegant Beef> Similar logic |
05:40:47 | FromDiscord | <Elegant Beef> Just with keybind locked to monitor |
05:41:27 | FromDiscord | <Elegant Beef> sent a code paste, see http://ix.io/2nZY |
05:41:39 | Prestige | Oh, so like pressing mod4 + 1 multiple times? |
05:41:54 | FromDiscord | <Elegant Beef> Yea instead of using mod + (1-0) |
05:42:16 | FromDiscord | <Elegant Beef> Turns it into 2 button workspace movement |
05:42:16 | Prestige | Yeah I could add that very easily |
05:42:29 | FromDiscord | <Elegant Beef> I had to write a script for i3wm when i did that |
05:42:41 | FromDiscord | <Elegant Beef> It's very nice imo |
05:43:05 | Prestige | so do you have another binding for going backward, or selecting a specific workspace number? |
05:43:44 | * | dadada__ joined #nim |
05:43:52 | FromDiscord | <Elegant Beef> yea i typically use shift to reverse |
05:44:31 | Prestige | I'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:05 | FromDiscord | <Elegant Beef> then mod+ctrl+num to move to |
05:45:32 | FromDiscord | <Elegant Beef> It makes it way more compact |
05:46:04 | FromDiscord | <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:06 | Prestige | I've been contemplating having a nested workspace system |
05:55:20 | Prestige | each workspace will have 1-9 sub-workspaces |
05:55:54 | leorize[m] | nested workspace seems like a mess to maintain imo |
05:56:11 | leorize[m] | i3 tabbed thingy works better |
05:56:30 | Prestige | I wasn't a huge fan of that since it took up more screen space |
05:57:28 | leorize[m] | well the only space it took was the tab bar |
05:57:31 | leorize[m] | you can make it so that you can hide that tab bar? |
05:58:06 | Prestige | The 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:21 | Prestige | Kind of hard to explain |
06:03:59 | Prestige | I 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:35 | bung_ | how to return a copy of openArray[T] ? |
06:07:30 | * | dadada__ quit (Ping timeout: 256 seconds) |
06:07:48 | FromDiscord | <Elegant Beef> Isnt openArray only an input parameter? |
06:07:58 | Prestige | I mean you can just assign a var to another array/seq and it copies |
06:09:00 | * | solitudesf joined #nim |
06:09:21 | Prestige | Like: 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:11 | bung_ | hmm cant assign it dirctly |
06:11:18 | Prestige | code example? |
06:11:20 | bung_ | `Error: type mismatch: got <openArray[int]> but expected 'seq[int]` |
06:12:33 | bung_ | well, I add it one by one |
06:13:18 | Prestige | try https://play.nim-lang.org/#ix=2o02 ? |
06:13:28 | leorize[m] | use `@` to convert openArray into seq |
06:13:38 | Prestige | If 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:33 | bung_ | oh that's helpful |
06:21:21 | bung_ | thought it only can be using when initialize seq |
06:21:32 | Prestige | what do you mean? |
06:21:40 | Prestige | oh I misread |
06:22:22 | bung_ | 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:14 | FromDiscord | <Zed> PMunch: is nimlsp stable? when installing with nimble im getting a failed build |
06:50:53 | FromDiscord | <Yardanico> @Zed yes |
06:51:00 | FromDiscord | <Yardanico> It should work, what's the error? |
06:51:34 | FromDiscord | <Zed> Build failed for '[email protected]' |
06:51:43 | FromDiscord | <Yardanico> nimble install --verbose nimlsp |
06:52:09 | FromDiscord | <Zed> same thing |
06:52:27 | FromDiscord | <Yardanico> Well I don't really know how to make it output the error |
06:53:08 | FromDiscord | <Yardanico> But nimlsp itself works, I know that for sure :P |
06:53:24 | FromDiscord | <Yardanico> What about nimble install nimlsp --verbose |
06:53:33 | FromDiscord | <Yardanico> There should be an error message itself |
06:53:39 | FromDiscord | <Yardanico> Just post full output |
06:54:35 | FromDiscord | <Zed> sent a long message, see http://ix.io/2o08 |
06:54:47 | FromDiscord | <Yardanico> Huh |
06:55:19 | FromDiscord | <Yardanico> Well you can try cloning nimlsp and then nim c src/nimlsp.nim to check the error that way |
06:59:11 | Araq | nimble install --verbose nimlsp |
06:59:15 | FromDiscord | <Zed> so it seems like nimsuggest is not installed |
06:59:15 | Araq | or maybe |
06:59:26 | Araq | nimble --verbose install nimlsp |
07:00:16 | FromDiscord | <Yardanico> @Zed nimsuggest is a part of the compiler |
07:00:17 | FromDiscord | <Zed> ill reinstall nim |
07:00:26 | FromDiscord | <Yardanico> Nimlsp imports the compiler |
07:00:54 | FromDiscord | <Zed> nimlsp was looking for a nimsuggest directory |
07:01:01 | FromDiscord | <Zed> which doesn't exist |
07:01:24 | FromDiscord | <Yardanico> oh well, it should exist, yes |
07:01:25 | FromDiscord | <Rika> What did you use to install nim |
07:01:30 | FromDiscord | <Zed> brew |
07:01:33 | FromDiscord | <Yardanico> Huh |
07:01:41 | FromDiscord | <Zed> nims up to date |
07:01:47 | FromDiscord | <Yardanico> well yeah sometimes packaged Nim doesn't work correctly |
07:01:51 | FromDiscord | <Yardanico> Try choosenim |
07:02:01 | FromDiscord | <Yardanico> And it's not Nim's fault :P |
07:03:02 | FromDiscord | <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:59 | FromDiscord | <Zed> Alright, choosenim did the trick!! |
07:08:13 | Araq | the 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:38 | Araq | see also "Nimble cannot build docs" |
07:08:48 | FromDiscord | <Yardanico> Well there are some ways like macOS structure |
07:09:00 | FromDiscord | <Yardanico> Or Gobo Linux which has a custom filesystem hierarchy as well |
07:09:12 | FromDiscord | <Yardanico> There each package is just a different directory |
07:09:19 | Araq | yeah but brew follows Unix |
07:13:23 | FromDiscord | <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:33 | bung_ | 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:09 | bung_ | I cant literally using `^` |
07:44:43 | Yardanico | bung_: why? |
07:44:48 | Yardanico | well there's a way |
07:45:08 | Yardanico | "yourseq.high" - backwardsIndex |
07:45:32 | Yardanico | !eval let a = @[1, 2, 3, 4, 5]; echo a[a.high - 2] |
07:45:34 | NimBot | 3 |
07:47:21 | bung_ | it's a negtive or positive number |
07:47:43 | bung_ | I guess I need if else |
07:48:37 | Yardanico | bung_: why can't you just use ^ though? |
07:48:49 | bung_ | index is a param |
07:48:53 | Yardanico | soo? |
07:49:25 | bung_ | could be positive or negtive number |
07:49:31 | Yardanico | well you need an if/else anyway |
07:49:32 | Yardanico | even with ^ |
07:49:42 | Yardanico | actually it's simpler |
07:49:51 | Yardanico | if num < 0: num = yourseq.high - num |
07:49:58 | Yardanico | or something like that |
07:49:58 | Araq | or come up with a ^^ operator :-) |
07:50:10 | bung_ | what's that |
07:50:28 | bung_ | idk , but python pass it directly |
07:53:55 | Yardanico | bung_: for indexing with negative value you can just make a simple template |
07:54:21 | Yardanico | https://play.nim-lang.org/#ix=2o0l :D |
07:56:22 | bung_ | oh , yeah I can implement an operator. |
08:10:12 | narimiran | "^ is hard to type" |
08:10:59 | FromDiscord | <Rika> Anything is hard to type given a sufficiently odd keyboard layout |
08:11:15 | FromDiscord | <Rika> ***eyes the JIS layout*** |
08:17:37 | * | zacharycarter joined #nim |
08:22:30 | * | zacharycarter quit (Ping timeout: 272 seconds) |
08:30:41 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> How about one with just two switches, 0 and 1 |
08:30:53 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> How hardcore of a hacker are you? 🙂 |
08:43:08 | * | Vladar joined #nim |
09:01:10 | * | aeverr joined #nim |
09:04:26 | Zevv | I'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:38 | FromDiscord | <Rika> Why? |
09:05:01 | * | aeverr_ quit (Ping timeout: 265 seconds) |
09:05:05 | FromDiscord | <Rika> Can you explain why you think it should be taken out |
09:05:16 | Yardanico | @Rika because people confuse the terms sometimes |
09:05:18 | Zevv | it's subjective; I've found the syntax lacking more then once |
09:05:28 | Zevv | well, not "lacking", but not flexible enough for what I'm trying to express |
09:05:50 | FromDiscord | <Rika> Maybe it would be better to reword it then |
09:06:02 | Zevv | fair enough |
09:08:03 | dom96 | make a PR |
09:08:23 | Zevv | sure |
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:13 | Zevv | Hm 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:59 | Zevv | 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:36 | FromDiscord | <Tuxifan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716950558732189786 |
09:45:51 | FromDiscord | <Tuxifan> (edit) 'http://ix.io/2o0O' => 'http://ix.io/2o0P' |
09:46:12 | FromDiscord | <Tuxifan> (edit) 'http://ix.io/2o0P' => 'http://ix.io/2o0O' |
09:46:52 | FromDiscord | <Tuxifan> When I remove the newline argument it works |
09:47:31 | FromDiscord | <Tuxifan> (edit) 'http://ix.io/2o0O' => 'https://discordapp.com/channels/371759389889003530/371759389889003532/716950558732189786' |
09:48:28 | FromGitter | <bung87> I checked zevv PR, thats funny |
09:49:03 | FromDiscord | <Rika> @Tuxifan maybe you are not flushing the file |
09:49:09 | FromDiscord | <Rika> Do stdout.flushfile |
09:49:15 | FromDiscord | <Rika> Or what's it called |
09:49:22 | FromDiscord | <Rika> Dunno but yeah something like that |
09:49:25 | FromDiscord | <Tuxifan> I just found out the "world" goes into newline instead of words |
09:49:33 | FromDiscord | <Tuxifan> (edit) 'newline' => '`newline`' | 'words' => '`words`' |
09:49:45 | FromDiscord | <Rika> Yeah that's the next thing I was gonna point out |
09:49:51 | FromDiscord | <Tuxifan> So how do I avoid that? |
09:49:56 | FromDiscord | <Rika> I don't think varargs are greedy |
09:50:05 | FromDiscord | <Rika> Make newline a character |
09:50:11 | FromDiscord | <Tuxifan> Oh right |
09:50:23 | FromDiscord | <Tuxifan> But what else insted of vaargs would you recommend? |
09:50:32 | FromDiscord | <Rika> '\n' but then that makes it impossible to print \r\n as newline |
09:50:38 | FromDiscord | <Rika> Uh |
09:50:55 | FromDiscord | <Rika> No clue really |
09:51:08 | FromDiscord | <Recruit_main707> use stdout.writeLine |
09:51:15 | FromDiscord | <Recruit_main707> idk |
09:51:22 | FromDiscord | <Tuxifan> Yeah but that disallows setting newline |
09:51:28 | FromDiscord | <Rika> Maybe delegate newline to an enum instead "nlDos" and "nlUnix" and print the characters depending on the enum |
09:51:44 | FromDiscord | <Tuxifan> What is an enum? |
09:51:50 | FromDiscord | <Tuxifan> Oh right |
09:51:53 | FromDiscord | <Tuxifan> nvm |
09:51:57 | FromDiscord | <Rika> Read more of the manual :P |
09:52:07 | FromDiscord | <Tuxifan> I just remembered 😛 |
09:58:11 | FromDiscord | <Tuxifan> is↵```nim↵thestring = thestring & anotherstring↵```he right way to append to string? |
09:58:42 | FromDiscord | <Rika> Yeah |
09:59:27 | * | solitudesf joined #nim |
09:59:43 | FromDiscord | <Tuxifan> Isn't there something like `thestring.append(anotherstring)` or `thestring += anotherstring`? |
09:59:50 | FromDiscord | <Rika> Oh lord, now I'm kinda compelled to program on my phone |
09:59:55 | narimiran | &= |
09:59:58 | FromDiscord | <Rika> Technicae, why |
10:00:20 | FromDiscord | <Tuxifan> Even C++ implements .append(), it simply looks less ugly |
10:00:41 | * | bung joined #nim |
10:00:42 | FromDiscord | <Rika> Narimiran just gave you the answer |
10:00:47 | FromDiscord | <Tuxifan> Oh |
10:00:58 | FromDiscord | <Tuxifan> I did not see it, thx Narimiran! |
10:01:31 | FromDiscord | <Tuxifan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716954574707097660 |
10:02:54 | * | NimBot joined #nim |
10:03:10 | FromDiscord | <Recruit_main707> or numbers.add |
10:03:13 | FromDiscord | <Tuxifan> how can I evaluate a const string at compile time? |
10:04:12 | FromDiscord | <Rika> What do you mean |
10:04:37 | FromDiscord | <Recruit_main707> i guess he wants to do that same thing at compile time for instance |
10:04:48 | FromDiscord | <Recruit_main707> same thing as an example |
10:06:12 | FromDiscord | <Rika> sent a long message, see https://discordapp.com/channels/371759389889003530/371759389889003532/716955748378083379 |
10:07:14 | * | Guest19536 quit (Ping timeout: 240 seconds) |
10:07:22 | FromDiscord | <Tuxifan> Ahhh, thx |
10:07:41 | FromDiscord | <Tuxifan> How do I tell nim to transpile to jaavscript? |
10:08:00 | FromDiscord | <Recruit_main707> nim js |
10:08:01 | FromDiscord | <Rika> nim js |
10:08:02 | FromDiscord | <Rika> Fuck |
10:08:11 | FromDiscord | <Rika> Guess I'll die |
10:08:19 | alehander92 | morning |
10:08:30 | alehander92 | yeah if you need to be for browser nim js |
10:08:32 | FromDiscord | <Recruit_main707> hello |
10:08:38 | alehander92 | if for node env nim -d:nodejs js |
10:08:43 | FromDiscord | <Tuxifan> thx |
10:08:48 | alehander92 | rika whats the problem |
10:08:51 | alehander92 | you will live |
10:09:03 | FromDiscord | <Recruit_main707> i said it before her |
10:10:34 | alehander92 | zevv |
10:10:38 | FromDiscord | <Rika> im not super serious |
10:10:39 | alehander92 | Araq i had a question |
10:10:48 | Zevv | alehander92 zup |
10:11:49 | alehander92 | hello! |
10:11:55 | alehander92 | i see a question in your repo |
10:11:57 | alehander92 | and it reminds |
10:12:01 | Zevv | oh I got tons more :) |
10:12:02 | alehander92 | if we have macros everyuwhere |
10:12:07 | alehander92 | e.g. async currently etc |
10:12:35 | alehander92 | can we build hypothetically a native build with some of them natively-applying over PNodes |
10:12:45 | alehander92 | instead of interpretting |
10:13:00 | alehander92 | something like a naive version of jitt-ing(but different) |
10:13:11 | Zevv | pfff dude, that's going way deeper already |
10:13:17 | alehander92 | my point is |
10:13:41 | alehander92 | why 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:55 | alehander92 | yeah its not a suggestion for now |
10:14:14 | alehander92 | just wondering if people do that somewhere |
10:14:23 | alehander92 | maybe just jitting is simpler |
10:14:27 | Zevv | The 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:37 | alehander92 | yeah yeah its a different problem |
10:15:24 | Zevv | I 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:15 | alehander92 | why |
10:20:51 | alehander92 | its similar! |
10:21:40 | Zevv | but too early, there's things I can't see, like local vars injected by templates. |
10:21:50 | Zevv | I only see the template call, but not what it expands to |
10:21:55 | alehander92 | i mean |
10:22:03 | alehander92 | the compiler passes are similar |
10:22:14 | alehander92 | not so hard to work on |
10:22:24 | alehander92 | with some guidance |
10:22:31 | Zevv | Oh, its just tedious. Harder to debug, long time from code edit to run |
10:22:46 | Zevv | and its new stuff I need to learn. I hate learning new stuff |
10:23:07 | alehander92 | you can actually attach a debugger to the compiler :D |
10:23:24 | alehander92 | and our disruptek's IC would make it so fast to edit/run |
10:24:31 | Zevv | oh what's that, I missed that I think? |
10:24:43 | Zevv | I've been neglecting #nim for a month or two |
10:25:35 | FromDiscord | <Tuxifan> Damn these docs are really complex, I simply can't find what I am searching for |
10:25:45 | FromDiscord | <Rika> Tell us then |
10:25:47 | FromDiscord | <Tuxifan> How do I use importjs? |
10:25:51 | FromDiscord | <Rika> We might know what you're looking for |
10:25:52 | FromDiscord | <Rika> ? |
10:26:00 | FromDiscord | <Tuxifan> See above |
10:26:05 | alehander92 | zevv what's IC? |
10:26:13 | FromDiscord | <Rika> What's importjs |
10:26:32 | FromDiscord | <Tuxifan> Whatever it was called, it was to use js functions in nim |
10:26:34 | Zevv | alehander92: I don't know, I'm asking you :) *you* said "disruptek's IC"! |
10:26:34 | alehander92 | its like importcpp |
10:26:42 | alehander92 | yeah the incremental compilation |
10:26:44 | alehander92 | thing |
10:26:45 | FromDiscord | <Tuxifan> (edit) 'use' => 'import' |
10:26:46 | Zevv | oh right |
10:26:52 | alehander92 | but yeah its some work |
10:26:56 | Zevv | has disruptek been working on that? \o/ |
10:26:56 | FromDiscord | <Rika> Oh you mean that |
10:27:00 | alehander92 | yeah? |
10:27:04 | Zevv | wow |
10:27:06 | alehander92 | you really havent been following |
10:27:07 | FromDiscord | <Rika> It's a pragma |
10:27:09 | alehander92 | along :D |
10:27:16 | alehander92 | there is a PR. |
10:27:17 | FromDiscord | <Tuxifan> So how do use it? I found the usage once but now I can't refind it |
10:27:20 | alehander92 | but not sure what happened |
10:27:26 | Zevv | not at all. My head was kind of full with other stuff |
10:27:31 | Zevv | anyway, lunchy time - all about priorities! |
10:27:43 | alehander92 | yeah, i am also eating! |
10:27:47 | alehander92 | see ya |
10:28:12 | FromDiscord | <Rika> @Tuxifan maybe look at the importc or importcpp pragmas |
10:28:13 | FromDiscord | <Rika> Same usage afaik |
10:28:17 | FromDiscord | <Tuxifan> okay! |
10:28:45 | FromDiscord | <Tuxifan> Where is the importc documentation??? |
10:29:01 | FromDiscord | <Tuxifan> These docs are horrible to find stuff in, sorry to say that |
10:29:34 | FromDiscord | <Tuxifan> I type in importc and get macros |
10:29:49 | FromDiscord | <Recruit_main707> use ctrl f |
10:29:54 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
10:30:16 | FromDiscord | <Tuxifan> thx |
10:30:22 | alehander92 | look at |
10:30:24 | alehander92 | the importcpp for procs |
10:30:34 | alehander92 | i think its the most applicable to js as well but i might be wron g |
10:30:44 | alehander92 | i use it mostly for that |
10:31:10 | FromDiscord | <Tuxifan> Hmm, what I have seen about js was much easier |
10:31:15 | FromDiscord | <Tuxifan> (edit) 'js' => 'importjs' |
10:31:25 | FromDiscord | <Tuxifan> If I only could find it in these docs again… |
10:32:12 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importjs-pragma ? |
10:32:12 | FromDiscord | <dom96> Pretty sure if importjs is a thing that it's an alias for importcpp |
10:32:24 | FromDiscord | <Rika> It kinda is right now yeah |
10:33:26 | * | fredrikhr joined #nim |
10:33:31 | FromDiscord | <Tuxifan> > https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importjs-pragma ?↵@Rika ↵yes |
10:33:58 | FromDiscord | <Tuxifan> But there was another site where I have seen the simplest method… |
10:35:13 | FromDiscord | <Recruit_main707> it was maybe {.emit: readAll("file.js").}↵proc function*(args) {.nodecl.} ? |
10:35:33 | FromDiscord | <Tuxifan> I think so |
10:35:45 | FromDiscord | <Tuxifan> But it imported the entire object |
10:36:05 | FromDiscord | <Tuxifan> So you could use all it's functions |
10:36:31 | FromDiscord | <Recruit_main707> could you try to find it again? |
10:36:45 | FromDiscord | <Tuxifan> I am |
10:37:16 | * | dadada__ quit (Ping timeout: 246 seconds) |
10:40:09 | FromDiscord | <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:07 | FromDiscord | <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:08 | FromDiscord | <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:22 | FromDiscord | <Tuxifan> Not exactly the same |
10:45:26 | FromDiscord | <Tuxifan> But at least easy to use |
10:45:40 | FromDiscord | <Tuxifan> btw are there any nim capable IDEs? |
10:46:30 | FromDiscord | <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:50 | dom96 | take a look at the dom module |
11:01:52 | dom96 | see how it wraps things |
11:01:54 | dom96 | it 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:21 | FromDiscord | <Tuxifan> ah, there is a dom module? good to know, thx |
11:12:31 | FromDiscord | <Tuxifan> How can I define an array with procedures? |
11:12:37 | FromDiscord | <Rika> ? |
11:12:43 | FromDiscord | <Rika> what do you mean |
11:12:50 | FromDiscord | <Tuxifan> I want to create an array of procedures |
11:13:12 | FromDiscord | <Recruit_main707> why though |
11:13:35 | FromDiscord | <Rika> you can do that but they must have the same arguments and return type |
11:14:05 | FromDiscord | <Tuxifan> I want to run functions in a row, so some module can simply add its function to the array |
11:14:12 | FromDiscord | <Tuxifan> Sorry it wasn't called array |
11:14:13 | FromDiscord | <Rika> see what i just said 😛 |
11:14:18 | FromDiscord | <Tuxifan> how was it called? |
11:14:21 | FromDiscord | <Rika> sequence |
11:14:24 | FromDiscord | <Tuxifan> Ahh, thx |
11:14:35 | FromDiscord | <Tuxifan> And how would that look like? |
11:14:45 | FromDiscord | <Tuxifan> (The variable definition) |
11:14:46 | * | couven92 joined #nim |
11:14:56 | FromDiscord | <Rika> var a: seq[proc()] ↵for procs w/o args and return type |
11:15:15 | FromDiscord | <Recruit_main707> var a: seq[proc()] = @[] |
11:15:16 | FromDiscord | <Rika> proc(a: string): string↵for 1 str arg and str return |
11:15:28 | FromDiscord | <Tuxifan> Ahhh, thx a lot |
11:15:29 | FromDiscord | <Rika> name of args dont matter here |
11:15:45 | Zevv | Is this a bug? http://ix.io/2o1e |
11:15:46 | FromDiscord | <Tuxifan> Does nim have something like dicts/maps |
11:15:46 | FromDiscord | <Tuxifan> (edit) 'dicts/maps' => 'dicts/maps?' |
11:15:51 | FromDiscord | <Recruit_main707> you probably need to specify the default pragmas (for some reason) |
11:15:51 | Zevv | Again struggling with mangling in macros |
11:15:57 | FromDiscord | <Rika> @Tuxifan tables |
11:16:05 | FromDiscord | <Tuxifan> okay, thx |
11:17:23 | FromDiscord | <Tuxifan> > var a: seq[proc()] ↵> for procs w/o args and return type↵@Rika↵How would I initialise tabls like that? |
11:17:39 | FromDiscord | <Rika> var a: Table[string, proc()] |
11:17:54 | FromDiscord | <Tuxifan> great, thx |
11:17:54 | * | fredrikhr quit (Ping timeout: 260 seconds) |
11:17:56 | FromDiscord | <Rika> i dont think you can hash closures so dont try making a key out of it |
11:18:05 | FromDiscord | <Yardanico> var a = newTable[string, proc()] |
11:18:19 | FromDiscord | <Tuxifan> thx |
11:18:29 | FromDiscord | <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:50 | FromDiscord | <Rika> no clue |
11:18:57 | FromDiscord | <Rika> i'm scarred by people like technicae |
11:18:57 | FromDiscord | <Tuxifan> Okay xD |
11:18:57 | * | dadada is now known as Guest43589 |
11:19:07 | FromDiscord | <Rika> and codic |
11:19:27 | FromDiscord | <Tuxifan> How can I load a .nim file by filename? |
11:19:43 | FromDiscord | <Yardanico> you mean import? |
11:19:48 | FromDiscord | <Tuxifan> I'd like to simply import all .nim files in a specific directory |
11:19:57 | FromDiscord | <Yardanico> Well, for that you'll need a macro |
11:20:02 | FromDiscord | <Tuxifan> One by one |
11:20:14 | FromDiscord | <Tuxifan> Okay, how would I do that? |
11:20:25 | FromDiscord | <Tuxifan> I am not really good at maacros |
11:20:26 | FromDiscord | <Tuxifan> (edit) 'maacros' => 'macros' |
11:20:33 | FromDiscord | <Yardanico> Something like this but you'll need to adapt it to your use case https://gist.github.com/Yardanico/60e3de6af76ee70d6023e1f6256fdf6b |
11:20:38 | FromDiscord | <Tuxifan> thx |
11:20:39 | FromDiscord | <Yardanico> This one is extracted from my project |
11:22:31 | FromDiscord | <Tuxifan> what does that to:↵```nim↵let folder = "src" / "modules"↵```? |
11:22:53 | FromDiscord | <Tuxifan> Is that division by string??? |
11:23:16 | FromDiscord | <Yardanico> no |
11:23:25 | FromDiscord | <Yardanico> that's an / operator from os module |
11:23:38 | FromDiscord | <Yardanico> It connects path parts |
11:23:51 | FromDiscord | <Yardanico> So on Windows it'll make src\modules |
11:23:59 | FromDiscord | <Yardanico> on *nix src/modules |
11:24:01 | FromDiscord | <Yardanico> etc |
11:24:09 | FromDiscord | <Tuxifan> Ahhh, thx |
11:24:43 | FromDiscord | <Tuxifan> Why does that procedure return nothing? |
11:24:46 | FromDiscord | <Tuxifan> *macro |
11:24:56 | FromDiscord | <Yardanico> ? |
11:25:01 | FromDiscord | <Yardanico> It returns untyped |
11:25:15 | FromDiscord | <Yardanico> macros return Nim AST |
11:25:48 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:26:12 | FromDiscord | <Yardanico> macros can return typed or untyped, they're run at compile time |
11:26:15 | * | pbb joined #nim |
11:26:34 | FromDiscord | <Yardanico> Well I mean they can return normal types too |
11:27:17 | * | zacharycarter joined #nim |
11:27:28 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#macros |
11:31:38 | * | zacharycarter quit (Ping timeout: 256 seconds) |
11:32:46 | FromDiscord | <Tuxifan> @Yardanico↵`Error: cannot open file: modules/test`↵seems like it's missing .nim at the end of the file name? |
11:33:13 | FromDiscord | <mratsim> you don't need .nim at the end |
11:33:29 | FromDiscord | <mratsim> unless it's when compiling? |
11:33:40 | FromDiscord | <Tuxifan> then why does it say cannot open file? the file exists |
11:34:00 | FromDiscord | <Rika> is the file youre importing from beside a modules directory |
11:34:00 | FromDiscord | <Tuxifan> but when I try to add .nim it changes to a /??? |
11:34:04 | FromDiscord | <Tuxifan> (edit) '/???' => '/nim???' |
11:34:11 | FromDiscord | <Tuxifan> ye |
11:34:12 | FromDiscord | <Tuxifan> (edit) 'ye' => 'yes' |
11:34:19 | FromDiscord | <Rika> can we see the dir structure |
11:34:39 | FromDiscord | <Tuxifan> sent a code paste, see http://ix.io/2o1i |
11:36:06 | FromDiscord | <Tuxifan> yeahhh I know these filenames are not very meaningfull |
11:36:16 | FromGitter | <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:43 | FromDiscord | <mratsim> compile with --debugger:native and you will have the mapping when using gdb |
11:36:48 | FromDiscord | <mratsim> Nim godbolt does this |
11:37:14 | * | Guest43589 quit (Ping timeout: 256 seconds) |
11:37:15 | FromDiscord | <mratsim> it's also picked up by perf, VTune, Apple Instruments |
11:38:15 | FromDiscord | <Yardanico> yeah, one bad thing is that nim on godbolt is broken |
11:38:20 | FromDiscord | <Yardanico> it doesn't run the program |
11:38:32 | FromDiscord | <Yardanico> only compile and output assembly |
11:38:41 | FromGitter | <adnan338> Thank you. I'm interested in godbolt highlighting personally. I hope it adds support to highlighting soon. |
11:38:54 | FromDiscord | <Yardanico> There's support already |
11:39:13 | FromDiscord | <Yardanico> add --debugger:native to compiler arguments |
11:39:23 | FromDiscord | <Yardanico> It should be like that by default I think |
11:40:42 | FromGitter | <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:32 | FromDiscord | <Tuxifan> are there nim dom examples? |
11:45:52 | FromDiscord | <Rika> in the docs maybe |
11:45:58 | FromDiscord | <mratsim> Karax? |
11:47:42 | FromDiscord | <Tuxifan> > in the docs maybe↵@Rika ↵I could not find any |
11:48:00 | FromDiscord | <Tuxifan> How does that not work?↵```nim↵dom.Window.alert("hi")↵``` |
11:48:09 | * | solitudesf quit (Quit: Leaving) |
11:48:28 | FromDiscord | <Tuxifan> These error messages looks worse than these from LD lol |
11:48:31 | FromDiscord | <Tuxifan> (edit) 'looks' => 'look' |
11:48:35 | FromDiscord | <Tuxifan> (edit) 'these' => 'those' |
11:49:42 | FromDiscord | <Tuxifan> Ah that does not exist |
11:50:20 | FromDiscord | <Rika> oh i see |
11:50:22 | FromDiscord | <Rika> i dont actually know |
11:50:25 | FromDiscord | <Tuxifan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/716981977105825824 |
11:50:48 | FromDiscord | <Rika> prolly its `window.alert("hi")` |
11:51:00 | FromDiscord | <Rika> you're passing in the type itself |
11:51:04 | FromDiscord | <Rika> not an instance |
11:51:14 | FromDiscord | <Tuxifan> ReferenceError: window is not defined |
11:51:40 | FromDiscord | <Yardanico> well where are you running it? |
11:51:44 | FromDiscord | <Yardanico> You should run it in the browser |
11:51:54 | FromDiscord | <Tuxifan> ohhh |
11:51:55 | FromDiscord | <Tuxifan> right |
11:51:56 | FromDiscord | <Tuxifan> oops |
11:51:57 | FromDiscord | <Tuxifan> thx |
11:53:31 | FromDiscord | <Tuxifan> Is the dom library able to work with all javascript functions, even those defined by modules like jquery and such? |
11:53:43 | FromDiscord | <Rika> see the jsffi module |
11:53:50 | FromDiscord | <Tuxifan> okay… |
11:53:56 | FromDiscord | <Rika> https://nim-lang.org/docs/jsffi.html |
11:53:57 | FromDiscord | <Rika> for a link 😛 |
11:56:31 | FromDiscord | <Tuxifan> sent a code paste, see http://ix.io/2o1o |
11:56:38 | FromDiscord | <Tuxifan> (edit) 'http://ix.io/2o1o' => 'http://ix.io/2o1p' |
11:56:46 | FromDiscord | <Rika> use importjs i think |
11:56:48 | FromDiscord | <Rika> dunno really |
11:56:52 | FromDiscord | <Rika> i am just inferring really hard |
11:56:58 | FromDiscord | <Tuxifan> I simply took it from the docs |
11:57:03 | FromDiscord | <Rika> i know |
11:57:08 | FromDiscord | <Rika> docs prolly outdated |
11:57:26 | FromDiscord | <Tuxifan> So the docs have non-working examples? 🤔 🙄 |
11:58:22 | FromDiscord | <Tuxifan> importjs causes the same |
11:58:51 | FromDiscord | <Rika> huh |
11:59:30 | FromDiscord | <Rika> try saying whats in the error |
11:59:32 | FromDiscord | <Rika> escaping $ |
11:59:34 | FromDiscord | <Rika> `\$` |
11:59:51 | FromDiscord | <Tuxifan> ```↵Error: invalid character constant↵``` |
11:59:57 | FromGitter | <bung87> require it is |
12:00:30 | FromDiscord | <Rika> we need someone who's experienced in the js platform lol |
12:00:36 | FromDiscord | <Tuxifan> 😕 |
12:00:38 | FromDiscord | <Rika> we're mostly using nim's c backend |
12:00:43 | FromGitter | <bung87> only for language gen |
12:01:02 | FromGitter | <bung87> you need install throug npm |
12:01:12 | FromDiscord | <Rika> huh? |
12:01:12 | FromDiscord | <Tuxifan> I thought finally having found a good language to write my in-browser stuff in... 😢 |
12:01:32 | FromGitter | <bung87> wrap that module like wrap cpp |
12:01:41 | FromDiscord | <Tuxifan> what do you mean? |
12:02:33 | FromGitter | <bung87> I mean it is only for js language level generating |
12:02:52 | FromDiscord | <Tuxifan> ahhh |
12:03:04 | FromDiscord | <Tuxifan> Yep, that's a good idea |
12:04:47 | FromGitter | <bung87> well ,for browser target It works well |
12:04:56 | FromDiscord | <Yardanico> You escape $ with two $$ I think |
12:05:00 | FromDiscord | <Yardanico> In importcpp |
12:05:34 | FromDiscord | <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:26 | FromDiscord | <Rika> @Tuxifan ^ |
12:10:48 | FromDiscord | <Tuxifan> ahhh, thx |
12:11:02 | FromDiscord | <Tuxifan> YES! That worked |
12:23:28 | * | couven92 is now known as fredrikhr |
12:25:11 | FromDiscord | <Tuxifan> how do I use jsffi to select an element by ID? |
12:27:14 | FromDiscord | <Rika> https://nim-lang.org/docs/dom.html#getElementById%2Ccstring |
12:27:18 | FromDiscord | <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:51 | alehander92 | tuxifan yeah i use the js backend, it works fine |
13:13:02 | dadada__ | https://forum.nim-lang.org/t/935 "Type forward declaration is currently not possible" |
13:13:07 | dadada__ | does this still hold true? |
13:13:22 | dadada__ | it's a pretty annoying limitation IMO |
13:13:28 | dadada__ | if true |
13:13:41 | alehander92 | you can use a reordering pragma to workaround it |
13:14:11 | alehander92 | `{.experimental: "codeReordering".}` ? |
13:20:06 | dadada__ | yeah, that seems to help, thanks alehander92 |
13:20:22 | dadada__ | then let's hope the experimental aspect will be dropped from it |
13:20:26 | * | dadada__ is now known as dadada |
13:22:03 | alehander92 | afaik the macro / template thing makes it hard |
13:22:39 | alehander92 | but maybe with a specified behavior it really shouldn't |
13:25:18 | * | dcmertens joined #nim |
13:26:16 | dcmertens | I'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:38 | dcmertens | is there any general advice for taking return variables as input, rather than returning and unpacking a tuple? |
13:27:33 | dcmertens | when doing such a practice, is there any notational way to indicate that you're using variables as returns? |
13:27:50 | FromDiscord | <Generic> yes, it's usually when it's faster to do so |
13:28:02 | FromDiscord | <Generic> so when you have some fatter object |
13:28:06 | FromDiscord | <Generic> like a seq or a string |
13:28:22 | dcmertens | Ah |
13:28:26 | FromDiscord | <Generic> it's faster to pass in the var, to which the proc appens/changes something |
13:28:34 | FromDiscord | <Generic> no copy then has to be done |
13:28:36 | alehander92 | erm, seq-s or strings are pointers |
13:28:57 | dcmertens | alehander92, when returning a string, is it copied by reference, then? |
13:29:01 | alehander92 | but this is probably true for `object` types |
13:29:11 | alehander92 | it's just a pointer internally |
13:29:25 | FromDiscord | <Generic> yes, but they own the pointer |
13:29:44 | FromDiscord | <Generic> so if they're assigned you often get a copy |
13:30:22 | dcmertens | is this all governed by the definition of the type as an object vs a ref object? |
13:30:38 | alehander92 | afaik stuff can be copied, but if the compiler can prove its safe, it can directly pass it without copy |
13:31:04 | alehander92 | Generic hm, so you're saying a proc argument copies the whole string |
13:31:07 | dcmertens | OK. 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:31 | alehander92 | thanks for the thought, i should see how it works exactly |
13:32:05 | dcmertens | but 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:19 | FromDiscord | <Generic> ref object and object are a bit different, as with ref object you only have a single pointer |
13:32:52 | FromDiscord | <Generic> and there may only be one object at the time pointing to the memory backing the seq/string |
13:34:42 | FromDiscord | <Generic> https://nim-lang.org/docs/manual.html#types-string-type |
13:35:06 | FromDiscord | <Generic> "The assignment operator for strings always copies the string. " |
13:35:46 | alehander92 | sorry Generic |
13:36:04 | alehander92 | what i dont get is, e.g. if i pass string `b` to `a` and it calls `a2` with it |
13:36:17 | alehander92 | it doesn't seem to copy it |
13:36:36 | alehander92 | ah this is the copy-if-needed thing |
13:36:38 | alehander92 | probably |
13:37:25 | FromDiscord | <Generic> sure if you only pass in a string the copy isn't necessary |
13:37:51 | alehander92 | hm, but we should get nrvo |
13:37:53 | FromDiscord | <Generic> but as soon as you modify the string you will get copies |
13:38:00 | alehander92 | or we have it, never really checked that |
13:38:37 | alehander92 | what was the difference between rvo and nrvo ? |
13:38:51 | alehander92 | was it "named return value" ? |
13:39:19 | FromDiscord | <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:55 | alehander92 | i still think it leads to worse api-s though |
13:40:15 | alehander92 | so if one can guarantee optimizations are possible with the right flags, this might be arguable |
13:41:43 | FromDiscord | <Generic> a similar problem, inplace vs outplace was solved with the dup macro |
13:41:46 | FromDiscord | <Generic> though you're right |
13:42:18 | FromDiscord | <Generic> var parameters are always clunkier to use |
13:42:29 | FromDiscord | <Generic> and don't make those beautiful one liners 🙂 |
13:42:41 | FromDiscord | <Clyybber> And we have NRVO |
13:42:51 | FromDiscord | <Clyybber> Simply use return values |
13:42:51 | alehander92 | i rarely see var params api-s in nim, so that's why i'd warn people before writing one |
13:42:54 | alehander92 | ah ok |
13:43:00 | FromDiscord | <Generic> clybber does it even work with tuples? |
13:43:03 | alehander92 | so does it matter if we use result or return |
13:43:10 | FromDiscord | <Clyybber> @Generic Not yet |
13:43:20 | FromDiscord | <mratsim> @Clyybber I thought it was `result` that triggered NRVO? |
13:43:24 | FromDiscord | <Clyybber> Yeah |
13:43:27 | alehander92 | but not return? |
13:43:50 | FromDiscord | <Clyybber> Yeah, its NYI |
13:43:56 | alehander92 | ah ok |
13:44:07 | alehander92 | and i guess last statement is the same as `return` ? |
13:44:12 | * | Vladar joined #nim |
13:44:17 | FromDiscord | <Clyybber> Nope, its result |
13:44:24 | alehander92 | ah interesting |
13:44:49 | alehander92 | i wonder if nrvo can be applied n many levels |
13:44:54 | alehander92 | e.g. if one returns a chain of calls |
13:44:58 | FromDiscord | <Clyybber> Yeah it can |
13:45:01 | alehander92 | does this ellide all the way |
13:45:09 | alehander92 | ok |
13:46:21 | FromDiscord | <Tuxifan> ```nim↵let logarea: TextAreaElement = getElementById("logarea")↵```How can TextAreaElement be undefined when I have imported dom? |
13:47:54 | alehander92 | what does the error message says ! |
13:47:58 | alehander92 | say* |
13:48:11 | alehander92 | type mismatch, right? |
13:48:21 | * | endragor quit (Remote host closed the connection) |
13:48:39 | FromDiscord | <Tuxifan> nope |
13:48:46 | FromDiscord | <Tuxifan> undeclared identifier |
13:48:47 | alehander92 | hm, wait, it's an inherited type, sorry |
13:49:47 | alehander92 | which version of nim do you use |
13:50:00 | alehander92 | the definition is there since only ~3 months ago |
13:50:47 | FromDiscord | <Tuxifan> 1.0.6 |
13:50:55 | FromDiscord | <Tuxifan> Compiled at 2020-02-27 |
13:51:37 | alehander92 | yeah that's probably older |
13:51:43 | alehander92 | upgrade to 1.2.0 |
13:51:46 | FromDiscord | <Tuxifan> Is there some ppa? |
13:52:02 | FromDiscord | <Tuxifan> I don't really like using these tarballs… |
13:52:17 | alehander92 | you can use `choosenim` ? others know better |
13:53:17 | FromDiscord | <Tuxifan> I am compiling myself now |
13:54:42 | alehander92 | just rebuilding the last `devel` is very easy in principle |
14:01:16 | FromDiscord | <Tuxifan> how to install the build? |
14:01:27 | FromDiscord | <Tuxifan> I ran build_all.* now |
14:01:44 | FromDiscord | <Tuxifan> but there is no makefile to do make install |
14:04:21 | alehander92 | um, i think that should be all |
14:04:37 | alehander92 | ah i see what you mean |
14:05:10 | FromDiscord | <Tuxifan> sent a code paste, see http://ix.io/2o1K |
14:06:00 | FromDiscord | <Tuxifan> I am getting a type mismatch now |
14:06:02 | alehander92 | you just add it manually to path in config |
14:06:03 | alehander92 | i think |
14:06:11 | alehander92 | if you're not using a package |
14:06:18 | FromDiscord | <Tuxifan> I added to path |
14:06:19 | FromDiscord | <Tuxifan> done |
14:06:23 | FromDiscord | <Tuxifan> > I am getting a type mismatch now↵@Tuxifan ↵But this |
14:06:25 | alehander92 | ok what does it say |
14:06:33 | FromDiscord | <Tuxifan> Error: type mismatch: got <Element> but expected 'TextAreaElement = ref TextAreaElementObj' |
14:06:41 | FromDiscord | <Tuxifan> (edit) 'Error:' => '```↵Error:' | 'TextAreaElementObj'' => 'TextAreaElementObj'↵```' |
14:06:44 | alehander92 | well yeah |
14:06:51 | alehander92 | because Element is a base class |
14:07:00 | alehander92 | so Element isn't really a TextAreaElement |
14:07:11 | FromDiscord | <Tuxifan> How to get a TextAreaElement then? |
14:07:18 | alehander92 | so you probably need to `(TextAreaElement)expr` |
14:07:24 | FromDiscord | <Tuxifan> ahh |
14:07:36 | alehander92 | and then you shouldn't need the let a: <type> thing |
14:07:42 | alehander92 | it's rarely needed |
14:07:49 | FromDiscord | <Tuxifan> ```↵Error: type mismatch: got <TextAreaElement> but expected 'ClassList = ref ClassListObj'↵``` |
14:07:49 | alehander92 | usually let a = expr should be fine |
14:08:03 | FromDiscord | <Tuxifan> But I need to access the text field |
14:08:20 | FromDiscord | <Tuxifan> Which does not seem to exist on simple element |
14:08:21 | alehander92 | ok, you need to give more context buddy |
14:08:31 | FromDiscord | <Tuxifan> Oh sorry |
14:08:43 | FromDiscord | <Tuxifan> I want to edit the text inside a textarea |
14:08:52 | alehander92 | you need to access `value` ? |
14:09:03 | FromDiscord | <Tuxifan> no, `text` |
14:09:31 | alehander92 | is there such a field |
14:09:46 | FromDiscord | <Tuxifan> YesI think so |
14:09:58 | FromDiscord | <Tuxifan> (edit) 'YesI' => 'Yes' |
14:10:09 | alehander92 | https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement |
14:10:16 | alehander92 | this is in the nim dom docs at least |
14:10:19 | alehander92 | it's `.value` |
14:10:31 | * | waleee-cl joined #nim |
14:11:45 | FromDiscord | <Tuxifan> Oh… |
14:11:53 | FromDiscord | <Tuxifan> Okay, when I was on another framework it was text |
14:11:55 | FromDiscord | <Tuxifan> Sorry |
14:12:05 | FromDiscord | <Tuxifan> Also how to append to the value? |
14:12:21 | FromDiscord | <Tuxifan> &= results in↵```↵Error: type mismatch: got <cstring, cstring>↵``` |
14:12:25 | alehander92 | well, let me check |
14:12:29 | FromDiscord | <Tuxifan> thx |
14:12:30 | alehander92 | yeah, javascript strings are immutable |
14:12:37 | alehander92 | so you have to re-assign |
14:12:39 | alehander92 | the new value |
14:12:55 | alehander92 | `.value = expr.value & stuff` |
14:13:44 | FromDiscord | <Tuxifan> mmh, looks ugly 😕 |
14:14:52 | FromDiscord | <Tuxifan> wait, (type)expr is a cast? |
14:16:03 | alehander92 | something like that, but only for stuff like inherited objects |
14:16:13 | alehander92 | well, sorry, that's how javascript works |
14:16:24 | alehander92 | you can write your own template which expands to this tho |
14:16:50 | FromDiscord | <Tuxifan> oh okay |
14:17:12 | FromDiscord | <Tuxifan> How can I convert a int into str? |
14:17:16 | FromDiscord | <Tuxifan> (edit) 'a' => 'an' |
14:17:17 | alehander92 | `$` |
14:17:22 | FromDiscord | <Tuxifan> Ahhh, sorry |
14:17:24 | FromDiscord | <Tuxifan> Thx |
14:17:25 | alehander92 | same for most types |
14:17:27 | alehander92 | np |
14:18:52 | * | sacredfrog joined #nim |
14:27:18 | * | ftsf quit (Ping timeout: 256 seconds) |
14:34:46 | dcmertens | Clyybber, what is NRVO? |
14:35:07 | dcmertens | I kinda get what it is by context, but it's not enough for Google to point me to docs/code |
14:35:24 | dcmertens | oh, wait, got it |
14:35:36 | dcmertens | "nim NRVO" is not enough to DUCKDUCKGO to figure it out |
14:35:39 | dcmertens | google is all good |
14:38:53 | dcmertens | Ok, my question still stands. NRVO is an acronym for... what? |
14:42:07 | FromGitter | <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:48 | dcmertens | thanks! "named return value optimization" |
14:44:06 | FromGitter | <kaushalmodi> that's the extent of my knowledge of "NRVO".. I tried reading that section but made no sense to me |
14:47:30 | FromDiscord | <Tuxifan> Do classes in Nim work the same as in Python? |
14:48:02 | alehander92 | i wonder if we can use |
14:48:13 | alehander92 | some kind of macro-like languages for defining most optimizations |
14:48:17 | dcmertens | Tuxifan, what on Earth does that mean? |
14:48:18 | alehander92 | something like TR macros maybe |
14:48:34 | dcmertens | Object orientation has all kinds of corner cases |
14:48:44 | dcmertens | and surely Nim and Python will differ in those |
14:49:05 | alehander92 | tuxifan i think no multiple inheritance in nim |
14:52:30 | FromDiscord | <Tuxifan> a omay |
14:52:32 | FromDiscord | <Tuxifan> (edit) 'omay' => 'olay' |
14:52:34 | FromDiscord | <Tuxifan> (edit) 'olay' => 'okay' |
14:52:36 | FromDiscord | <Tuxifan> (edit) 'a' => 'ah' |
14:59:15 | * | ben_ joined #nim |
14:59:21 | FromDiscord | <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:47 | disruptek | ~manual |
14:59:48 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
15:00:07 | FromDiscord | <Tuxifan> I'd really like to rewrite my Brython projects in Nim and I am heavily using Classes there… |
15:00:21 | disruptek | go for it. |
15:00:58 | FromDiscord | <Tuxifan> All I can find on your linked site is "type classes" |
15:01:12 | disruptek | weird. it's almost like classes aren't a thing in nim. |
15:01:26 | alehander92 | there is inheritance and all that jazz tuxifan |
15:01:37 | alehander92 | so you could immitate most of your python class usage easily |
15:01:44 | FromDiscord | <Tuxifan> How does that work? |
15:01:50 | alehander92 | but i'd offer you to also take a look at case objects! |
15:01:54 | alehander92 | and other features |
15:02:03 | alehander92 | to have a better toolset |
15:02:03 | FromDiscord | <Tuxifan> Okay, sounds interesting… |
15:02:06 | alehander92 | as a nim developer |
15:02:26 | disruptek | why bother rewriting if you're just going to attempt to replicate semantics of working code? |
15:02:31 | alehander92 | as inheritance usage is still quite less popular even if it happens |
15:03:05 | alehander92 | yeah, i'd agree that learning other paradigms might be also a valid usage of rewriting |
15:03:09 | FromDiscord | <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:16 | FromDiscord | <Tuxifan> (edit) 'objects!↵@alehander92[IRC]#0000 ↵Can' => 'objects!↵@alehander92[IRC]#0000↵Can' | 'teh' => 'the' |
15:03:34 | alehander92 | sorry |
15:03:36 | alehander92 | https://nim-lang.org/docs/manual.html#types-object-variants |
15:03:42 | alehander92 | i always forget how are they called |
15:03:52 | FromDiscord | <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:57 | FromDiscord | <Tuxifan> > https://nim-lang.org/docs/manual.html#types-object-variants↵@alehander92[IRC]#0000 ↵Thx |
15:04:00 | alehander92 | they're very popular around nim code |
15:04:19 | alehander92 | so you need to at least know how to use them to understand much of it |
15:05:09 | alehander92 | they're basically similar to e.g. adt-s in functional languages/rust |
15:05:32 | alehander92 | and useful in most cases where you actually dont need an "open" hierarchy |
15:06:36 | alehander92 | something like https://stackoverflow.com/questions/870919/why-are-haskell-algebraic-data-types-closed |
15:06:36 | FromDiscord | <Tuxifan> Wait I send an example of what I need |
15:07:47 | FromDiscord | <Tuxifan> https://gitlab.com/niansa/Pythonlabs/-/blob/master/ide/ui.py↵What would be the best way to port such classes? |
15:08:34 | dcmertens | Tuxifan, 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:12 | FromDiscord | <Recruit_main707> how much of a sin would be to use python to create tools like c2nim? |
15:09:34 | FromDiscord | <Recruit_main707> python counts with some impressive tools (such as c parsers) out of the box |
15:09:47 | bung | !repo webgui |
15:09:48 | disbot | https://github.com/juancarlospaco/webgui -- 9webgui: 11Web Technologies based Crossplatform GUI Framework with Dark theme 15 30⭐ 5🍴 7& 1 more... |
15:10:19 | dcmertens | Recruit_main707, do whatever you want |
15:10:28 | dcmertens | but bear in mind that Nim can't depend on having Python handy |
15:10:59 | FromDiscord | <Recruit_main707> we already depend on c/c++ compilers |
15:11:20 | FromDiscord | <Tuxifan> that repo you sent… Can it also work in a webbrowser? |
15:11:20 | dcmertens | Tuxifan, do you use inheritance in the class you referred to above? |
15:11:30 | FromDiscord | <Tuxifan> no |
15:12:17 | Araq | if you want to improve c2nim, start with reading its source code |
15:12:26 | bung | am porting a sort algorithm lib , dont know why it test fails when seq contains negtive number |
15:12:59 | dcmertens | Tuxifan: 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:07 | FromDiscord | <Recruit_main707> Araq: its not something i am considering in a close/middle future, this are all just hypothetical ideas i have |
15:13:18 | dcmertens | Then create the methods, which perhaps can start life as procs |
15:13:39 | BehrangDadsetan | Thanks @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:39 | BehrangDadsetan | plications/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:01 | FromDiscord | <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:23 | Araq | there is no shame in admitting it but it makes no sense |
15:14:55 | dcmertens | Recruit_main707, do not confuse library support with language fitness |
15:15:02 | Araq | I am not aware of production quality C++ parsers written in Python |
15:15:03 | FromDiscord | <Recruit_main707> i dont |
15:15:28 | dcmertens | ok, then why do you way Python is a better fit? |
15:15:35 | Araq | and if you don't need "production quality" then c2nim's way of doing it isn't all that bad |
15:15:35 | dcmertens | The only thing you referenced above was library support |
15:16:19 | Araq | BehrangDadsetan: 'defined(macos)' isn't the same as 'defined(macosx)', beware |
15:16:19 | dcmertens | Recruit_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:25 | alehander92 | recruit it really isn't a better tool |
15:16:34 | FromDiscord | <Recruit_main707> might have missunderstood that fitness |
15:16:38 | Araq | and probably 'defined(macos)' should die |
15:16:39 | alehander92 | the best tools would be actual c compilers |
15:16:45 | alehander92 | and they seem usable from nim as well |
15:16:48 | alehander92 | e.g. libclang |
15:16:57 | alehander92 | or stuff like treesitter |
15:17:26 | alehander92 | (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:37 | BehrangDadsetan | @Araq, my bad. Actually the code I was misquoting was 'const stdioUsesMacros = (defined(osx)...' in lib/system/ansi_c.nim#L120 |
15:18:06 | dcmertens | Recruit_main707, language fitness is things like, "To implement algorithm X, Lang Y has feature Z that makes this easy." |
15:18:46 | BehrangDadsetan | I 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:00 | dcmertens | I 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:25 | Araq | BehrangDadsetan: what are you trying to do? |
15:19:37 | Araq | sorry I only recently joined #nim |
15:19:54 | FromDiscord | <Recruit_main707> xD |
15:19:54 | BehrangDadsetan | @Araq, compile nim 1.2 and run the example for nimx... that's all |
15:20:29 | Araq | ah bummer # pkg2 "nimx", true, "nim c --threads:on test/main.nim" |
15:20:40 | Araq | we disabled it. for some reason |
15:20:46 | FromDiscord | <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:52 | Araq | narimiran: do you remember why? |
15:21:21 | dcmertens | Recruit_main707, right, that's library depth. |
15:21:28 | dcmertens | that is a good reason to implement something in Python instead of Nim |
15:21:38 | dcmertens | but it's not due to a language limitation of Nim |
15:22:23 | dcmertens | And, 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:22 | BehrangDadsetan | @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:35 | BehrangDadsetan | my /usr/local/include and clang are from brew and apparently behave differently than the XCode system includes such as stdio.h |
15:24:52 | Araq | patch io.nim and set stdioUsesMacros to false |
15:25:04 | Araq | but how is this related to nimx? |
15:25:31 | BehrangDadsetan | nimx has a dependency to nake and nake has the system issue with stdio.h differing |
15:27:55 | Araq | as I said, patch io.nim |
15:28:48 | BehrangDadsetan | will 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:09 | narimiran | yeah, nimx doesn't work with 1.2.x (and it is disabled on devel) |
15:31:26 | narimiran | i don't remember by heart why/when we disabled it |
15:36:01 | narimiran | Araq: this is PR which disabled it: https://github.com/nim-lang/Nim/pull/14293 |
15:36:02 | disbot | ➥ diable nimx (CI failure) |
15:36:11 | BehrangDadsetan | Ok. 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:02 | disruptek | i think it's wise to stick with 1.0. |
15:37:07 | Araq | you can try 1.0.x for nimx for now yes |
15:37:30 | BehrangDadsetan | understood. thanks! |
15:37:31 | Araq | but 1.2.2 is just around the corner too :-) |
15:37:36 | leorize[m] | it was disabled due to nimx itself being broken |
15:52:31 | dcmertens | I 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:00 | dcmertens | Nim is faster, about 3.7s vs Perl's 4.7s |
15:53:36 | dcmertens | though the Perl code is shorter because it uses a regular expression instead of a string of parse statements |
15:53:50 | dcmertens | interestingly, though I *get* *different* *results* |
15:54:10 | dcmertens | The Perl parser tells me that the most popular page is "en.mw en 5493928 146752070214" |
15:54:26 | dcmertens | whereas the Nim parser tells me that the most popular page is ("en", "Main_Page", 271165, 4791147476) |
15:54:28 | disruptek | maybe it's a matter of opinion. |
15:54:40 | dcmertens | disruptek, which part? |
15:54:48 | disruptek | which page is more popular. |
15:55:02 | dcmertens | for those who have not read the book, we are comparing page hits, which is the third entry |
15:55:25 | dcmertens | it appears that en.mw is hit 5,493,928 times, whereas Main_Page is hit 271,165 times |
15:55:34 | disruptek | well, you have to admit... |
15:55:39 | disruptek | 271,165 is a lot. |
15:55:42 | FromDiscord | <Rika> what is en.mw |
15:55:49 | dcmertens | Rika, I have no idea |
15:55:50 | FromDiscord | <Recruit_main707> how can you check if an object has no been initialised yet? |
15:55:58 | disruptek | most people would be happy with that many hits. |
15:56:09 | dcmertens | disruptek, your insight is invaluable here |
15:56:14 | dcmertens | :-) |
15:56:21 | FromDiscord | <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:26 | disruptek | decide who is right and who is nim, and then fix the bug. |
15:56:50 | FromDiscord | <Rika> issues with that are object variants and when the assignment is using default(Type) |
15:57:03 | dcmertens | disruptek, the problem is that I can't see why the Nim example *doesn't* report en.mw |
15:57:17 | disruptek | what's the code? |
15:57:22 | * | dcmertens digs up a paste |
15:57:28 | dcmertens | where do we paste? |
15:57:37 | disruptek | ~paste |
15:57:37 | disbot | paste: 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:00 | disruptek | the bot will turn ix urls into playground urls and post them to #nim-news |
15:58:02 | disruptek | ~news |
15:58:03 | disbot | news: 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:16 | dcmertens | doh |
15:59:30 | dcmertens | I see, we are checking that the domain code is "en" |
15:59:30 | disruptek | there's a nim-based ix poster in here: |
15:59:32 | dcmertens | that'd be it |
15:59:33 | disruptek | !repo xs |
15:59:35 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 2⭐ 0🍴 |
16:00:12 | * | bung quit (Ping timeout: 265 seconds) |
16:00:30 | dcmertens | ok, fixed the bug in the Perl code, now it runs faster than the Nim. :-P |
16:00:54 | dcmertens | Here's the nim code: https://play.nim-lang.org/#ix=2o24 |
16:00:55 | disruptek | sounds right to me. |
16:02:31 | disruptek | who wrote this? |
16:02:31 | dcmertens | Perl: https://nopaste.nl/eRwfzL51bB |
16:02:54 | dcmertens | disruptek, Nim in Action was written by Dominik Picheta |
16:02:59 | dcmertens | I more-or-less copied his code |
16:03:07 | disruptek | jesus christ. |
16:03:07 | FromDiscord | <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:54 | dcmertens | with my fixed Perl code (pasted to nopaste.nl above), I get timing of 2.5s |
16:04:05 | dcmertens | vs Nim's 4.7s |
16:04:07 | disruptek | holdon, i'm watching a cop chase. |
16:04:20 | dcmertens | disruptek, from your house? |
16:04:23 | disruptek | if i can understand what you're trying to do, from the perl i mean, i'll write something that works. |
16:04:36 | dcmertens | disruptek, how familiar are you with Perl? |
16:04:39 | disruptek | people ask me why i drink. |
16:04:42 | disruptek | code like this is why. |
16:04:53 | disruptek | i wrote perl back when perl was a thing. |
16:05:17 | disruptek | it's thermal camera footage. |
16:05:28 | FromDiscord | <Rika> dcmertens: with d:release? |
16:05:40 | dcmertens | Rika, almost certainly. I'll check again, though |
16:05:43 | disruptek | i just don't understand why people think they can outrun a fucking cop's radio. |
16:05:50 | dcmertens | Rika, yes |
16:06:14 | FromDiscord | <Rika> Can I see both code :P |
16:06:25 | FromDiscord | <Rika> Oh nvm |
16:06:29 | FromDiscord | <Rika> Found the links |
16:06:44 | dcmertens | yeah, probably should have used a gist for that |
16:06:50 | dcmertens | sorry |
16:07:18 | disruptek | rika can write a 3-liner that's idiomatic, i'm kinda curious to see what she comes up with. |
16:07:30 | FromDiscord | <Rika> No I can't wtf |
16:07:32 | FromDiscord | <Rika> LMAO |
16:07:38 | disruptek | dude, get on that shit. |
16:07:46 | FromDiscord | <Rika> disruptek you literally write compiler code |
16:07:52 | disruptek | i'm trying to catch up with LivePD. |
16:07:53 | FromDiscord | <Rika> I write peasant libs no one uses lmao |
16:08:09 | disruptek | gtfo i've seen your work. |
16:08:18 | disruptek | and no one will see my compiler code. |
16:09:08 | FromDiscord | <Rika> Nah man you got the big brain codes and I got the simple ass "anyone can do" code lmao |
16:09:34 | disruptek | if that were true i wouldn't have a ticket open to use one of your libs. |
16:10:08 | FromDiscord | <Rika> what |
16:10:11 | dcmertens | So, 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:31 | disruptek | !search progress bar author:disruptek |
16:10:31 | FromDiscord | <Rika> try using nitely/regex |
16:10:31 | disbot | https://github.com/disruptek/nimph/issues/109 -- 3add a progress bar |
16:10:45 | dcmertens | (It is also a reminder to me that if I have a simple file parsing problem, I should probably just use Perl) |
16:10:58 | disruptek | nitely's regexp will let you compile the re at compile time. |
16:11:18 | dcmertens | Rika, was that for me? |
16:11:19 | disruptek | but i don't think it's a regexp problem iiuc. |
16:11:24 | FromDiscord | <Rika> bruh |
16:11:29 | dcmertens | I don't either |
16:11:32 | FromDiscord | <Rika> yeah dcmertens |
16:11:40 | dcmertens | I use a regex in Perl because that's what Perl gives me |
16:11:47 | dcmertens | but I thought Nim's parse tools would be faster |
16:11:47 | disruptek | of course, as you should. |
16:11:48 | FromDiscord | <Rika> but as disruptek said it might not improve the performance |
16:11:52 | dcmertens | as they're just wrappers around while loops |
16:12:02 | disruptek | okay, christ. |
16:12:13 | FromDiscord | <Rika> ? |
16:12:16 | disruptek | what's the link to the perl one? |
16:12:22 | disruptek | i can't even read this nim crap. |
16:12:23 | FromDiscord | <Rika> https://nopaste.nl/eRwfzL51bB |
16:12:23 | dcmertens | https://nopaste.nl/eRwfzL51bB |
16:12:36 | dcmertens | disruptek, any style recommendations? |
16:12:41 | dcmertens | I'm open to suggestions |
16:12:43 | disruptek | okay, you open a file, you read lines. |
16:12:50 | disruptek | you're counting what, most hits? |
16:12:53 | dcmertens | yeah |
16:12:53 | FromDiscord | <Rika> oh oh oh |
16:12:54 | disruptek | and saving the line that has same. |
16:12:56 | FromDiscord | <Rika> maybe strscans? |
16:13:06 | disruptek | strscans or split |
16:13:11 | disruptek | and parseInt |
16:13:37 | disruptek | split to an array that you save for reconstitution. |
16:13:46 | FromDiscord | <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:54 | disruptek | it could be done at compile-time, in which case the runtime will be very, very fast. |
16:14:18 | disruptek | but we'll write something idiomatic that runs at runtime. |
16:14:25 | disruptek | fairness isn't a thing. |
16:14:32 | disruptek | it's already unfair. |
16:14:32 | FromDiscord | <Rika> that is true |
16:14:53 | dcmertens | disruptek, do you mean compiling the regex at compile time? that's fine |
16:14:54 | disruptek | to compare perl to nim is to completely miss the forest for the trees. |
16:14:56 | dcmertens | that's what Perls is doing, for sure |
16:15:08 | disruptek | no; you can just compile the answer at compile time. |
16:15:20 | dcmertens | disruptek, until I change the file I want to analyze. :-P |
16:15:33 | disruptek | well fuck, dude, isn't that what perl is doing? |
16:15:46 | dcmertens | ?? |
16:16:10 | disruptek | perl is compiled at runtime. nim can be run at compile time. wtf are we talking about here? |
16:16:14 | disruptek | absolutely nothing. |
16:16:34 | disruptek | if you want it created at compile-time, you can do that with nim. |
16:16:39 | dcmertens | well, if you want me to throw the compile times into my timing data... |
16:16:42 | disruptek | if you want it created at run-time, you can do that with nim. |
16:16:51 | dcmertens | time nim c -r -d:release wikiparse.nim |
16:16:52 | dcmertens | ... |
16:16:56 | FromDiscord | <Rika> dc: how are you timing this in the first |
16:16:57 | FromDiscord | <Rika> ah |
16:16:59 | FromDiscord | <Rika> you just sent it |
16:17:04 | FromDiscord | <Rika> but wait |
16:17:08 | FromDiscord | <Rika> that counts the compile time too |
16:17:10 | FromDiscord | <Rika> is that intended? |
16:17:37 | FromDiscord | <Rika> it should be more like `nim c -d:release wikiparse.nim && time ./wikiparse` no? |
16:17:41 | dcmertens | no, Rika, that's not what I did at first |
16:17:53 | dcmertens | disruptek was talking about performingg the parse at compile time |
16:17:57 | dcmertens | or that's what I took him to mean |
16:18:11 | FromDiscord | <Rika> well, is perl performing tthe parse at compile time? |
16:18:19 | dcmertens | no |
16:18:29 | dcmertens | it's compiling the regex "at *script* compile time" |
16:18:30 | disruptek | gimme the data file; i wanna write the idiomatic solution. |
16:18:42 | disruptek | i have an idea on how to prove my point. |
16:18:46 | FromDiscord | <Rika> what the heck is script compile time |
16:19:06 | disruptek | scripts have to compile their shit, too, you know. |
16:19:11 | dcmertens | disruptek: https://dumps.wikimedia.org/other/pagecounts-all-sites/2016/2016-01/pagecounts-20160101-050000.gz |
16:19:30 | disruptek | okay, thanks. |
16:19:48 | dcmertens | Rika, 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:03 | dcmertens | then it executes the process defined by that data structure. That's "Run time" |
16:20:18 | dcmertens | if you create a module that includes C code, that's all put together at "build time" |
16:21:09 | disruptek | it's the third field, right? |
16:21:09 | dcmertens | The reason Perl would win here is because it minimizes data copying and it has really good I/O |
16:21:15 | dcmertens | disruptek, yeah |
16:21:49 | dcmertens | I suspect I'm copying data somewhere silly |
16:22:12 | dcmertens | like, when I build up the tuple? Whereas in the Perl I just store the whole line? |
16:22:19 | FromDiscord | <Rika> well perl is like a few multipliers older than nim |
16:22:25 | dcmertens | Rika, very true |
16:22:40 | dcmertens | but we're performing a tight loop, where Perl is supposed to suck |
16:23:04 | dcmertens | we're also using regular expressions, which I would have expected to run slower than straight parsing |
16:23:36 | FromDiscord | <Rika> pcre is no joke apparently |
16:23:45 | dcmertens | Perl still has to walk a data structure to perform its execution, whereas Nim bakes the while() loops into machine code |
16:23:58 | dcmertens | Rika, I have no idea, Perl doesn't use PCRE |
16:24:53 | FromDiscord | <dom96> wait, is this from my book? |
16:25:01 | FromDiscord | <Rika> afaik yes |
16:25:06 | FromDiscord | <Rika> hi dom lmao |
16:25:13 | dcmertens | dom96, yeah |
16:25:17 | dcmertens | :-) |
16:25:20 | FromDiscord | <dom96> does that mean my implementation is worse than perl? lol |
16:25:34 | dcmertens | dom96 |
16:25:36 | FromDiscord | <Rika> apparently |
16:25:43 | dcmertens | I just realized I haven't gotten to the parallelized part |
16:25:51 | dcmertens | so maybe your parallelized version would run faster |
16:26:04 | FromDiscord | <Rika> than unparallelized perl?? |
16:26:11 | FromDiscord | <Rika> that would be a gut punch ngl |
16:26:30 | dcmertens | Rika, yeah, we're comparing unparallelized versions of both languages |
16:26:59 | disruptek | do i need perl6 for this? |
16:27:04 | dcmertens | disruptek, no |
16:27:16 | dcmertens | I've running on Perl 5.22 |
16:27:55 | disruptek | i have 5.30.1 i guess. |
16:28:01 | dcmertens | that should work |
16:28:30 | disruptek | my first version is 3.5s to perl's 1.5s. |
16:29:39 | dcmertens | I apparently have a slow machine |
16:29:43 | disruptek | 3.2 with arc. |
16:29:51 | disruptek | but what's the right answer? |
16:30:12 | disruptek | oh, there's spaces or something? |
16:30:36 | dcmertens | the right output? It should be ("en", "Main_Page", 271165, 4791147476) |
16:30:42 | dcmertens | yeah, four field, space separated |
16:30:57 | FromDiscord | <dom96> what are the timings for Nim vs. Perl for this? |
16:31:00 | disruptek | zu.mw zu 36 279751 |
16:31:15 | dcmertens | disruptek, english only (seconod field is en) |
16:31:22 | disruptek | oh |
16:31:32 | disruptek | index 1, you mean? |
16:31:38 | dcmertens | yea |
16:31:59 | dcmertens | dom96, 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:16 | dcmertens | but for Perl I run `time perl wikiparse.pl` and get 2.54 real seconds |
16:32:27 | disruptek | that gets me to 3.00 |
16:32:56 | dcmertens | with nim I run your non-parallelized code with `time ./wikiparse` and get 3.8 user |
16:33:43 | dcmertens | now my HD cache has slowed down and I get about 2.6s for Perl and 4.1s for nim |
16:33:46 | disruptek | my output is now: en.mw en 5493928 146752070214 |
16:33:57 | dcmertens | disruptek, that's what I had before |
16:34:14 | dcmertens | ah, yeah, the *first* field needs to be "en" |
16:34:16 | dcmertens | sorry |
16:34:27 | * | dcmertens has confused himself |
16:34:43 | disruptek | no biggie; it changes nothing. |
16:35:43 | dcmertens | yeah, my Perl script was wrong. |
16:35:52 | dcmertens | but fixing it doesn't change the timing really |
16:36:41 | dcmertens | Oh, fun, a better regex for Perl (using beginning-of-line anchor) speeds it up a tick |
16:37:00 | disruptek | yeah, i should optimize perl first. |
16:37:34 | dcmertens | disruptek, the proper regex is /^en\s\S+\s(\S+)\s\S+\s/ |
16:38:35 | disruptek | there are some trailing re format specifiers that let you change the pcre options. |
16:38:40 | dcmertens | oh, I bet I know the problem |
16:38:41 | disruptek | i just don't remember the deets. |
16:38:55 | disruptek | like, /asdfasdf/i is case-insensitive and stuff. |
16:39:03 | dcmertens | If 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:10 | dcmertens | how do I "continue" a for loop in Nim? |
16:40:12 | disruptek | switch to a string is .3s slower. |
16:40:16 | disruptek | continue |
16:40:20 | dcmertens | thanks |
16:43:14 | disruptek | that kinda blows my mind. |
16:43:58 | disruptek | 1.9s for markAndSweep |
16:47:48 | disruptek | i got a little under 1.0s now. |
16:54:21 | dcmertens | disruptek, can you post your solution? |
16:54:53 | dcmertens | I 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:58 | disruptek | how so? |
16:56:13 | dcmertens | never mind, I'm an idio |
16:56:40 | disruptek | i'm trying to wrap criterion around it and it reminds me that i really need to learn more of these switches. |
16:57:00 | disruptek | 'cause it's, like, running the damned thing 256 times or some shit. |
16:57:30 | dcmertens | I had a bug where I was not actually storing the highest count in the highest count variable. :-P |
16:57:46 | disruptek | i did that, too. |
16:58:29 | dcmertens | If 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:32 | dcmertens | bah, how do you get the length of a string? |
17:02:36 | dcmertens | string.lenght() is failing me |
17:02:54 | dcmertens | ok, string.len |
17:07:16 | * | couven92 joined #nim |
17:08:34 | FromDiscord | <Rika> haha |
17:09:37 | Zevv | oh are we parsing and microoptimizing! Can I play? |
17:09:43 | disruptek | okay, i got criterion working. |
17:09:55 | disruptek | welcome to the party, zevv |
17:10:07 | Zevv | \o/ |
17:10:16 | dcmertens | I finally have a Nim version that runs about as quickly as the Perl version |
17:10:27 | dcmertens | ^^ this should make some people sad |
17:10:42 | * | fredrikhr quit (Ping timeout: 260 seconds) |
17:11:05 | dcmertens | https://play.nim-lang.org/#ix=2o2h |
17:12:16 | dcmertens | Zevv, the Perl version we're competing against is here: https://nopaste.nl/cnOOcSbTi0 |
17:12:21 | FromDiscord | <Recruit_main707> just do it at compile time |
17:12:25 | FromDiscord | <Recruit_main707> https://tenor.com/view/feel-me-think-about-it-gif-7715402 |
17:12:26 | disruptek | 0.82s |
17:12:53 | FromDiscord | <dom96> tried using `re`? |
17:13:15 | disruptek | no, i wanna believe our assumptions are faster. |
17:13:33 | disruptek | once we're in c-land, it's not a nim victory. |
17:13:48 | dcmertens | dom96, any regular expression solution should have a hand-coded version that's faster |
17:14:01 | dcmertens | the reason you'd reach for regex is only if the match is complicated |
17:14:08 | dcmertens | in this case, it's not |
17:14:25 | Zevv | My 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:50 | dcmertens | Zevv, share |
17:14:50 | dcmertens | ? |
17:15:06 | dcmertens | Now I'm getting Perl at 2.25s and Nim at 2.3s |
17:15:06 | disruptek | well, i'll be honest. it's starting to look a little less idiomatic. |
17:15:14 | FromDiscord | <Rika> oh zevv's here |
17:15:16 | FromDiscord | <Rika> save me |
17:15:30 | FromDiscord | <Rika> is it proven that you can match parentheses with PEGs? |
17:15:38 | FromDiscord | <Rika> (and how T_T) |
17:15:39 | disruptek | i wish arc was faster here. it's troubling. |
17:15:52 | disruptek | we need to annotate strutils, maybe? |
17:20:56 | Zevv | http://ix.io/2o2l that runs at 70% of the time for perl |
17:21:13 | disruptek | nice! |
17:21:48 | FromDiscord | <dom96> > dom96, any regular expression solution should have a hand-coded version that's faster |
17:21:55 | FromDiscord | <dom96> yes, but it doesn't hurt to try and get a baseline |
17:22:06 | FromDiscord | <dom96> that way you will know exactly how much overhead Nim adds |
17:22:56 | disruptek | the perl version is 20 lines. my idiomatic version was 20 lines. but it was also 3s. |
17:23:00 | disruptek | or, 2x perl. |
17:23:26 | disruptek | i could write my own lines() iterator, but where are we going, here? |
17:23:36 | FromDiscord | <dom96> Let's all just use Perl |
17:23:46 | disruptek | dude, that's what /i/ said. |
17:24:50 | dcmertens | When I try to write a regex version in Nim, it's a little slower |
17:25:25 | dcmertens | https://play.nim-lang.org/#ix=2o2n |
17:25:39 | * | dcmertens checks out Zevv's version |
17:26:07 | Zevv | rule #1: if you want speed, parse by hand |
17:29:22 | disruptek | wow, golden disagrees with `time`. |
17:29:53 | Zevv | does golden read wall time or cpu time |
17:30:09 | disruptek | got me. |
17:31:44 | dcmertens | what is golden? |
17:31:56 | disruptek | !repo golden |
17:31:56 | disbot | https://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 19⭐ 0🍴 |
17:33:08 | dcmertens | ah, thanks |
17:33:38 | * | dadada quit (Ping timeout: 260 seconds) |
17:33:51 | livcd | is not perl's regex engine pretty optimized? |
17:33:54 | dcmertens | livcd, extremely |
17:34:10 | dcmertens | which is why I thought this would be fun |
17:34:28 | dcmertens | Zevv, is $0 the current match? |
17:34:28 | dcmertens | when I run your version, I get "en", not the page title |
17:35:23 | dcmertens | livcd, 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:56 | livcd | disruptek disrupted arc |
17:35:57 | disruptek | i guess that's not really a feature. |
17:36:26 | dcmertens | hahaha |
17:37:06 | disruptek | okay, now it just segv. |
17:37:14 | disruptek | whew. |
17:38:52 | disruptek | when it doesn't run out of memory, it suffers an error in parseInt. |
17:39:11 | FromDiscord | <dom96> btw I hope you've tried wrapping the Nim code in a `main` proc |
17:39:16 | * | aeverr_ joined #nim |
17:39:19 | FromDiscord | <dom96> that's a classic that seems to improve perf |
17:39:31 | disruptek | it's because i have to use var params instead of out params. |
17:40:02 | dcmertens | dom96, Ah, I didn't |
17:41:52 | dcmertens | dom96, do you mean isMainModule? |
17:42:00 | FromDiscord | <dom96> no |
17:42:04 | FromDiscord | <dom96> proc main() = ... |
17:42:08 | FromDiscord | <dom96> main() |
17:42:23 | FromDiscord | <zetashift> Really weird that trick |
17:42:56 | dcmertens | well, when I do that, the running time drops to 0.0 |
17:43:00 | dcmertens | and no output |
17:43:01 | dcmertens | :-) |
17:43:09 | * | aeverr quit (Ping timeout: 265 seconds) |
17:43:12 | dcmertens | I thought Nim automatically detected and called main() fnctions |
17:44:28 | FromDiscord | <dom96> no, you need to call the main function |
17:45:09 | dcmertens | yeah, that leads to a big speedup |
17:45:51 | FromDiscord | <dom96> lol, really? |
17:46:44 | dcmertens | with main() trick, 2.0s; without main() trick, 2.25s |
17:46:49 | dcmertens | compare to Perl at 2.25s |
17:48:21 | dcmertens | Perl 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:39 | FromDiscord | <Clyybber> dcmertens: Its because otherwise your variables are globals |
17:50:08 | dcmertens | Clyybber, thanks that makes a *lot* of sense |
17:52:03 | livcd | https://github.com/lh3/biofast |
17:52:52 | FromDiscord | <Clyybber> disruptek: Is markandsweep a lot faster than arc? |
17:52:59 | disruptek | yeah. |
17:53:09 | disruptek | 2x |
17:53:16 | FromDiscord | <Clyybber> I guess rc ops are the bottleneck here then |
17:53:37 | disruptek | i wouldn't think so. |
17:53:48 | FromDiscord | <Clyybber> Could try making lines return lent string |
17:54:05 | disruptek | strutils has no annotations, for example. |
17:54:48 | FromDiscord | <Clyybber> what annotations? |
17:54:53 | FromDiscord | <Clyybber> lent annotations? |
17:55:16 | disruptek | yeah, or sinks. |
17:57:05 | * | stefantalpalaru quit (Changing host) |
17:57:05 | * | stefantalpalaru joined #nim |
17:57:27 | dcmertens | Alright, I got the Nim version to speed up using skipUntil rather than parseUntil |
17:57:30 | dcmertens | which makes sense |
17:58:13 | disruptek | c'mon, i told you that was shit. |
17:58:34 | dcmertens | but that doesn't mean I knew how to fix it! |
17:58:37 | disruptek | think about how you think about the problem. |
17:58:46 | disruptek | you take the third field. |
17:58:51 | disruptek | how do you know it's the third? |
17:58:57 | disruptek | because it's the third group of non-whitespace. |
17:59:13 | disruptek | so you split on whitespace. take the third such value. |
17:59:24 | dcmertens | disruptek, I'm not splitting on whitespace |
17:59:33 | disruptek | if you wanna make it faster, make an iterator. |
17:59:45 | dcmertens | I find that doubtful |
17:59:56 | dcmertens | splitting on whitespace will perform a bunch of allocations, won't it? |
18:00:03 | disruptek | a simple state machine that barfs out numbers would be pretty damned fast. |
18:00:13 | dcmertens | splitting on whitespace has to read the entire line |
18:00:20 | disruptek | if you have a faster version than mine, i'll look. |
18:00:30 | dcmertens | sure, I never saw your version |
18:00:37 | dcmertens | could you post it? |
18:00:50 | disruptek | i thought i did. |
18:00:53 | disruptek | http://ix.io/2o2G/nim |
18:00:59 | dcmertens | thanks |
18:01:24 | disruptek | i put an (unlikely) in there for danny. |
18:02:30 | FromDiscord | <Clyybber> you cursed fella |
18:02:31 | FromDiscord | <Clyybber> haha |
18:02:48 | disruptek | you like that? |
18:03:03 | disruptek | i thought you might. |
18:04:48 | disruptek | also, it's the same length as the perl version; shorter if you leave the main loop global. |
18:05:31 | disruptek | which is also less than half as long as dom's abomination. |
18:06:09 | FromDiscord | <Clyybber> how fast is it compared to doms or zevvs? |
18:06:24 | disruptek | zevv will have to tell us. |
18:06:49 | disruptek | dom's is like 40 lines long. |
18:07:12 | dcmertens | Nice: line.startsWith("en ") |
18:07:19 | dcmertens | very readable |
18:07:40 | dcmertens | I checked the string by hand with line[0] != 'e' and line[1] != 'n'... |
18:07:44 | dcmertens | which seemed gross |
18:07:57 | disruptek | i vomited a little into my mouth. |
18:08:28 | FromDiscord | <Rika> im crying from how disgusting that looks |
18:08:32 | disruptek | i was talking to my mother today and she asked how some code could look nicer than other code. |
18:08:46 | disruptek | old folks are so funny. |
18:08:49 | dcmertens | well, that's what I would have written in C for super-fast stuff |
18:09:01 | dcmertens | :-P |
18:09:21 | disruptek | the point is that idiomatic code is fast code. |
18:09:36 | FromDiscord | <Recruit_main707> tell that to assembly |
18:09:49 | disruptek | short code is fast code. |
18:09:53 | disruptek | no code is fastest. |
18:10:04 | FromDiscord | <dom96> short code is not always fast code |
18:10:24 | disruptek | thanks, doctor. |
18:11:27 | leorize[m] | disruptek: sink can now be inferred, but not lent :( |
18:11:31 | * | Vladar quit (Remote host closed the connection) |
18:11:43 | disruptek | yeah but sink inference is too sketchy for my taste. |
18:11:50 | disruptek | i don't recommend it for mortals. |
18:12:16 | disruptek | specifying it in stdlib just makes sense. |
18:12:17 | leorize[m] | @dom96 can you take a look at this? https://github.com/nim-lang/Nim/issues/14524 |
18:12:19 | disbot | ➥ future mismatch with callbacks ; snippet at 12https://play.nim-lang.org/#ix=2o2P |
18:12:40 | disruptek | that's the third time today a UFO has just hovered outside my window. |
18:12:55 | disruptek | like, come in if you're going to come in, already! |
18:12:59 | disruptek | christ. |
18:13:07 | disruptek | i don't have time for this shit. |
18:13:31 | FromDiscord | <dom96> It's Trump stealing your hamburgers |
18:13:32 | disruptek | you have no idea how much tv i need to catch up on. |
18:14:05 | Zevv | dcmertens: wel, 'n' is the page title of the en.wm langpage, right? |
18:14:59 | dcmertens | no, en.wm is not a valid page for these purposes |
18:15:07 | dcmertens | you're supposed to identify the main landing page |
18:15:13 | Zevv | oh I got my logic wrong, sorry :) |
18:15:26 | dcmertens | I think everybody who has tried this problem made that mistake today |
18:15:27 | dcmertens | :-) |
18:15:38 | Zevv | well, I got the proper page, I just id return not lal of the line |
18:15:59 | FromDiscord | <dom96> leorize: replied |
18:16:51 | dcmertens | Zevv, how does your npeg compare to the peg in the standard library? |
18:17:46 | disruptek | use zevv's. |
18:18:06 | leorize[m] | npeg is peg but better |
18:18:08 | Zevv | this runs at 20% of the perl time: http://ix.io/2o2W |
18:18:21 | leorize[m] | except that you can't use peg syntax the last time I checked (not that I care about that) |
18:18:23 | disruptek | that's twice as fast as mine. |
18:18:52 | FromDiscord | <Rika> npeg uses peg syntax but prefixed instead of suffixed afaik, am i right |
18:19:17 | Zevv | yes, because of limitations in the Nim syntax. But that doesn't matter because Nim's syntax is flexible enough anyway |
18:19:33 | FromDiscord | <Rika> LMAO |
18:19:50 | Zevv | Well, it got merged :) |
18:20:03 | dcmertens | Zevv, your last solution looks like what I would have written in C |
18:20:06 | FromDiscord | <dom96> lol, is this a meme now |
18:20:27 | Zevv | dcmertens: I always write like I write C if it needs to be fast. |
18:20:29 | FromDiscord | <dom96> Zevv: you may as well go to asm at that point lol |
18:20:46 | Zevv | well, if I let nim do stuff for me, it starts allocating and slicing away |
18:20:53 | Zevv | schlump does the performance |
18:21:05 | Zevv | convenience vs power. That's why I love nim, you can do both |
18:21:17 | Zevv | Did you ever look at mratsims projects? He kind of abandons most of nim. |
18:22:19 | disruptek | i love how zevv doesn't use single character variables when he can add a digit on the end. |
18:22:57 | dcmertens | Zevv, *that* is exactly why I'm here. Easy to "drop" into C when needed. That's hard to do in Perl. |
18:23:14 | Zevv | I 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:34 | FromDiscord | <Recruit_main707> i also do that sometimes |
18:23:45 | disruptek | agree. |
18:24:24 | FromDiscord | <Rika> i do that too |
18:24:51 | FromDiscord | <dom96> That reminds me of Haskell |
18:25:11 | Zevv | dcmertens: 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:23 | Zevv | it is just when I want to do stuff with captures that the performance goes boink |
18:25:33 | Zevv | because it will allocate and create slices of the captures |
18:25:45 | disruptek | zevv, stop it. |
18:25:47 | Zevv | if/when nim gets proper slices, this will drastically improve NPegs speed |
18:25:49 | disruptek | you're making my pants tight. |
18:26:07 | Zevv | I'm safe here, overseas |
18:26:23 | disruptek | no one is safe from me. |
18:26:32 | Zevv | anyway, 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:41 | Zevv | Which can also mean I type crawppy raw state machines |
18:27:05 | disruptek | you turned a bad character flaw into a career. |
18:27:53 | Zevv | and of course it draws pretty graphs on the fly |
18:27:53 | Zevv | http://zevv.nl/div/t.png |
18:27:58 | Zevv | everybody likes pretty graphs |
18:28:09 | dcmertens | yeah, I saw that. It was cute! |
18:28:22 | Zevv | I bet perl can not do that! |
18:28:49 | Zevv | I should really make a mode in npeg where it does not slice but pass the offsets as captures |
18:29:55 | dcmertens | Zevv, be careful, you're implicitly competing against Damian Conway |
18:30:27 | dcmertens | I don't think the Peg parser system for Perl does that |
18:30:30 | dcmertens | but I never used it |
18:30:31 | Zevv | nah. 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:41 | FromDiscord | <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:53 | Prestige | Are there any ML libs in Nim yet? |
18:45:19 | Zevv | arraymancer |
18:45:30 | Zevv | it's not really ML, but offers most of the stuff you'd need |
18:45:46 | FromDiscord | <Recruit_main707> nimtorch *should* work |
18:46:01 | FromDiscord | <Recruit_main707> its a bit outdated i think, and installation is hard |
18:46:09 | FromDiscord | <Recruit_main707> at least i wasnt able to do it :P |
18:46:22 | * | lqdev[m] quit (Ping timeout: 244 seconds) |
18:55:48 | dcmertens | Regarding the use of channels to send/receive data in parallel processes, are these efficient? |
18:55:59 | dcmertens | If I send an string, does it copy the string? |
18:56:14 | dcmertens | Also, is barrier synchronization available? |
18:56:15 | disruptek | it copies it. |
18:56:23 | dcmertens | disruptek, bummer |
18:56:35 | disruptek | you can do a barrier sync manually; i dunno of an automatic method. |
18:57:20 | dcmertens | cool |
18:57:52 | disruptek | leorize would be a good person to ask. |
18:58:16 | disruptek | i have to do some barriers for uring support. |
18:58:32 | dcmertens | looks like I should look into Weave: https://github.com/mratsim/weave |
18:59:17 | disruptek | weave is about work-stealing inside one process, n threads. |
18:59:40 | dcmertens | well, it uses message-passing, which I'm familiar with |
18:59:43 | dcmertens | I've used MPI before |
19:02:34 | disruptek | there's a shared heap under arc, if that's what you're after. |
19:02:51 | * | Senketsu quit (Ping timeout: 252 seconds) |
19:02:57 | dcmertens | No, I'm writing simulations, Euler or Runge-Kutta-4 |
19:03:24 | disruptek | i think there's at least one channel impl in weave. |
19:03:28 | dcmertens | I 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:31 | disruptek | it's probably where you should start. |
19:13:27 | Avatarfighter | yo yo yo what's is up party people |
19:14:23 | * | thelounge4229 joined #nim |
19:16:15 | * | thelounge4229 quit (Client Quit) |
19:17:47 | alehander92 | oi |
19:17:51 | alehander92 | i am back in Sofia |
19:18:23 | alehander92 | zevv i think haskell |
19:18:30 | alehander92 | does the `xs` thing |
19:18:33 | alehander92 | haskell people* |
19:20:59 | * | dzamo[m] joined #nim |
19:36:16 | * | NimBot joined #nim |
19:36:58 | FromDiscord | <Rika> Zevv: how do i do a nongreedy + in npeg? |
19:37:05 | FromDiscord | <Rika> i'm kinda lost |
19:43:52 | * | Guest70061 is now known as dadada |
19:45:14 | FromDiscord | <Rika> nvm! i am dumb |
19:46:05 | alehander92 | you're not |
19:46:27 | alehander92 | hm, time to write an `ls` to dogfood |
19:46:39 | alehander92 | do you guys *use* ls a lot? |
19:46:44 | alehander92 | what are the flags you usually use |
19:48:12 | * | dcmertens quit (Quit: Leaving) |
19:48:51 | FromDiscord | <Rika> ls -lah |
19:48:59 | FromDiscord | <Rika> colors on too |
19:54:16 | disruptek | i use lsd; does that help? |
19:55:22 | disruptek | lsd --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:47 | shashlick | Hello world |
19:57:55 | shashlick | voltist codic |
20:01:46 | shashlick | Select all mark read |
20:01:58 | shashlick | Anyone needs anything, please ping |
20:06:16 | * | Trustable joined #nim |
20:06:36 | disruptek | I CAN'T FEEL MY LEGS |
20:06:42 | disruptek | shashlick: are you alright, dude? |
20:15:50 | Zevv | Rika: you found what you need? |
20:16:12 | Zevv | alehander92: yeah it was haskell, I just found my repos |
20:25:30 | FromDiscord | <Rika> zevv: no T_T |
20:26:01 | Zevv | tell me |
20:27:08 | disruptek | runnableExamples: doesn't run in the same env as the compiler. 🤦 |
20:28:07 | disruptek | i mean, the docgen instance. |
20:30:58 | FromDiscord | <Rika> zevv: so i'm trying to match something like this |
20:32:24 | FromDiscord | <Rika> `sometitle [arbitrary amounts of bracketed parts] [here too] [this one's special tho]`↵`^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~title ^~~~~~~~~~~~~~~not title` (both need to be captured) |
20:32:57 | FromDiscord | <Rika> it can also be simply `title [not title]` |
20:33:30 | Zevv | do you have a concrete example, preferable a snippet dump? This stuff does make it throug hIRC well |
20:33:30 | FromDiscord | <Rika> just, the last [] is not part, and that title can be comprised of either non-bracketed or bracketed segments |
20:35:27 | FromDiscord | <Rika> sent a code paste, see http://ix.io/2o3Z |
20:35:34 | FromDiscord | <Rika> ~~yardanico now knows what i'm doing maybe~~ |
20:35:47 | disruptek | NO ONE KNOWS WHAT YOU'RE DOING |
20:36:02 | Zevv | ok, in your example, what are the things you want to match? |
20:37:01 | Zevv | The stuff in the last brackets, right? |
20:37:05 | FromDiscord | <Rika> sent a long message, see http://ix.io/2o41 |
20:37:11 | FromDiscord | <Rika> both the title and the last brackets |
20:37:25 | FromDiscord | <Rika> i'm not sure how i would handle this |
20:37:32 | Zevv | right |
20:38:01 | FromDiscord | <Rika> hey i'm sorry if this is a small brain problem xddd |
20:38:43 | Zevv | nah, it's nasty because it needs backtracking |
20:42:12 | FromDiscord | <Rika> maybe i should just not capture this |
20:43:13 | FromDiscord | <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:54 | alehander92 | rika thank you |
20:48:07 | alehander92 | disruptek hm, i don't think i know `lsd`, have to check it out |
20:50:28 | Zevv | rika: http://ix.io/2o47 |
20:50:52 | Zevv | you have to be explicit with PEGS |
20:51:14 | Zevv | your language is ambigious, so you need a non-blind repetition |
20:51:31 | Zevv | basically, what makes the last [] block special is that it is followed by a newline |
20:52:00 | Zevv | so 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:05 | FromDiscord | <Rika> oh, actually, not a newline, but an extra ] |
20:53:46 | FromDiscord | <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:55 | FromDiscord | <Rika> thanks though |
20:54:03 | Zevv | well, you should have given me the full thing then :) |
20:54:19 | disruptek | rookie move. |
20:54:23 | Zevv | rookie move! |
20:54:48 | disruptek | !last zevv |
20:54:48 | disbot | Zevv spoke in 12#nim 24 seconds ago 12https://irclogs.nim-lang.org/01-06-2020.html#20:54:23 |
20:55:29 | Zevv | and you have a terrible taste for music, also |
20:55:41 | disruptek | jesus, zevv. |
20:55:43 | FromDiscord | <Rika> who? |
20:55:44 | FromDiscord | <Rika> me? |
20:55:46 | Zevv | haha |
20:55:52 | FromDiscord | <Rika> i dont listen to that |
20:55:54 | disruptek | the rook. |
20:55:55 | FromDiscord | <Rika> its not my music lol |
20:55:55 | disruptek | who else. |
20:56:04 | disruptek | c'mon, buddy. |
20:56:11 | disruptek | come on, buddy! |
20:56:14 | alehander92 | get some https://www.youtube.com/watch?v=TvoVuOC_KKE man |
20:56:20 | FromDiscord | <Rika> lmao |
20:56:31 | FromDiscord | <Recruit_main707> dorime |
20:56:32 | alehander92 | it's amazing |
20:56:50 | disruptek | what's what they used to call me in school. |
20:57:00 | disruptek | hector martinez, the angel-voiced one. |
20:57:49 | disruptek | that picture even looks like me. |
20:57:56 | disruptek | hey, where'd you get this album? |
20:58:26 | alehander92 | "I initially had links to purchase, but apparently this album is no longer available on any platform." |
20:58:45 | alehander92 | you can't get that stuff in this world, buddy |
20:59:01 | disruptek | not since i started smoking, no. |
20:59:08 | FromDiscord | <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:25 | disruptek | i'm tryin'. |
20:59:30 | disruptek | lord knows, i'm tryin'. |
20:59:45 | alehander92 | let's not hurry |
21:00:46 | alehander92 | wow, june 2nd. |
21:00:56 | alehander92 | it already arrived for me, guys |
21:01:00 | alehander92 | good to live in the future |
21:01:14 | disruptek | i know, man. i told myself i'd shower in june. |
21:01:31 | disruptek | depending on how it goes, i mean. |
21:01:41 | alehander92 | finally, people started to riot.. |
21:01:47 | alehander92 | just get one bath, man |
21:02:36 | alehander92 | i love what first impression would this chat leave to nim newcomers |
21:03:06 | disruptek | all i can say is, |
21:03:17 | disruptek | it's a good thing you have me sitting on irc. |
21:03:24 | disruptek | keeping the chat clean and on point. |
21:03:36 | Zevv | yeah thanks alehander92 I was about to go to bed |
21:03:47 | Zevv | but now I'm stuck here for 1:06:47 |
21:04:28 | disruptek | i can keep my eye on him if you need some zzzzz. |
21:05:03 | alehander92 | zevv i feel ya! |
21:05:23 | disruptek | track three is a banger. |
21:06:25 | alehander92 | the transition to the 4th one is beautiful |
21:06:46 | alehander92 | i am literally looping the first 4-5 ones since maybe a week |
21:07:19 | alehander92 | i hope you can keep both of your eyes tho |
21:08:00 | FromGitter | <sealmove> ```var ⏎ seq1 = @[1, 2, 3] ⏎ seq2 = seq1``` ⏎ ⏎ is deep copy right? [https://gitter.im/nim-lang/Nim?at=5ed56e30d137513704338a44] |
21:08:10 | disruptek | it's amazing how topical the lyrics manage to feel after so many years. |
21:08:54 | alehander92 | truely timeless |
21:10:19 | alehander92 | you're kidding but some psalms are older than the Beatles |
21:10:28 | disruptek | gtfo |
21:10:30 | Zevv | sure |
21:10:42 | alehander92 | sealmove do you mean if the seq had objects? |
21:10:50 | disruptek | when he gets like this i just humor him, usually. |
21:11:12 | disruptek | but you don't dis george, man. |
21:11:46 | PMunch | What on earth are you guys talking about? :P |
21:12:17 | disruptek | alehander got into grandpa's cough syrup again. |
21:12:18 | alehander92 | george is no david, man |
21:12:26 | shashlick | disruptek: all good, was on a meditation retreat |
21:12:39 | disruptek | shit. |
21:12:53 | disruptek | do you need us to call someone? |
21:13:13 | PMunch | (fixed the links on my NimScript articles by the way) |
21:13:15 | shashlick | that someone is me |
21:13:19 | * | bung joined #nim |
21:13:21 | alehander92 | PMunch awesome |
21:13:54 | shashlick | what I miss last 3 days |
21:14:12 | alehander92 | that's what happens when one turns windows updates off |
21:14:28 | FromDiscord | <Rika> pmunch: so what was the issue lmao |
21:14:31 | alehander92 | probably thats how they started the eternal september |
21:14:42 | PMunch | @Rika: https://www.couchcms.com/forum/viewtopic.php?f=4&t=12680 |
21:15:08 | PMunch | Apparently the sanetizer that CouchCMS uses doesn't like the word "script" in URLs.. |
21:16:25 | FromDiscord | <Rika> makes sense kinda lol |
21:17:26 | PMunch | Yeah I thought it was something like that :P |
21:17:36 | PMunch | But it's still super dumb mistake |
21:17:43 | alehander92 | very strange |
21:19:37 | alehander92 | better safe than sorry! |
21:20:33 | PMunch | I guess.. |
21:20:45 | PMunch | I should rewrite this page as git hooks and Nim |
21:23:10 | * | drewr quit (Ping timeout: 256 seconds) |
21:26:12 | FromGitter | <kaushalmodi> alehander92: See https://github.com/c-blake/lc |
21:26:37 | FromGitter | <kaushalmodi> (just saw you mention about writing an *ls* project) |
21:28:17 | alehander92 | amazing stuff |
21:28:38 | alehander92 | this guy is good with cli!! |
21:29:00 | alehander92 | well, i just want to dogfood another tool with that so i would just implement super small part |
21:29:40 | Zevv | "i hope you can keep both of your eyes tho" |
21:29:50 | Zevv | I think something got lost in translation there |
21:32:29 | alehander92 | sorry! |
21:32:33 | Zevv | :) |
21:34:01 | alehander92 | disruptek, what about a `ls` disbot command |
21:34:12 | alehander92 | i have no idea what it would be listing |
21:34:25 | Zevv | /who #nim |
21:35:10 | alehander92 | yeah! but it would be too long |
21:35:30 | Zevv | omit the lurkers, disbot knows who's vocal and who's not |
21:35:39 | PMunch | Paste it as an ix.io link? |
21:35:47 | PMunch | Sort by last spoken |
21:36:06 | Zevv | I 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:10 | alehander92 | oh man, we can have a `convo_graph` |
21:36:20 | alehander92 | yeah, something like that |
21:36:42 | Zevv | it's hard to guess the right nicks with all those bridges tho |
21:36:45 | alehander92 | i thought only about a daily time-based graph of frequency |
21:36:47 | PMunch | So how often they ping each other? Or jut talking at the same time? |
21:36:54 | Zevv | talk at the same time |
21:37:08 | PMunch | It would be neat to see how timezones cluster the community |
21:37:18 | alehander92 | yeah, that's true |
21:37:24 | Zevv | I ggraphed that some time ago I think |
21:53:45 | * | Trustable quit (Remote host closed the connection) |
22:02:12 | Zevv | http://zevv.nl/div/a.png |
22:02:40 | Zevv | C- for aesthetics tho |
22:03:02 | Prestige | fancy |
22:03:20 | disruptek | wtf am i looking at? |
22:03:38 | disruptek | all i know is, i'm the center of the fucking universe. |
22:03:58 | PMunch | Is this the current one? |
22:04:10 | Zevv | jun 01, .nl time |
22:04:32 | disruptek | pmunch, you're dead to me. |
22:04:35 | disruptek | you hear me? |
22:04:37 | disruptek | DEAD. |
22:04:38 | PMunch | Haha :P |
22:04:51 | PMunch | I'm dead to a lot of people it seems |
22:05:11 | PMunch | But if it's only June 1st it's not that strange since I've been AFK almost all day |
22:05:22 | disruptek | cfg says avatarfighter is in charge. |
22:05:25 | FromDiscord | <exelotl> no fair, bung is on there 3 times and I'm on there zero times |
22:05:27 | alehander92 | my browser |
22:05:33 | alehander92 | says the image says errors!! |
22:05:41 | alehander92 | i want image without errors |
22:05:52 | Zevv | yeah making a new one, all of may |
22:05:54 | alehander92 | oh man i have to sleep |
22:05:55 | Zevv | dot is crunching |
22:05:56 | Zevv | ready |
22:06:22 | Prestige | are the lines drawn from direct pings Zevv ? |
22:06:38 | Zevv | nah it's two successive nick pairs |
22:06:38 | FromDiscord | <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:52 | Zevv | yeah I was a bit distracted by that one as well |
22:06:57 | Prestige | Lol |
22:07:16 | disruptek | one leg of a love triangle between yardanico and rika. |
22:07:22 | alehander92 | ok i wget-ed it |
22:07:25 | alehander92 | my firefox just couldnt |
22:07:54 | Zevv | let's keep it to 1 day |
22:07:54 | Zevv | busy enough here |
22:07:56 | PMunch | Haha, the all of may one was a bit too busy? |
22:07:58 | alehander92 | guys how can you see anything |
22:08:04 | Prestige | I just feh <url> |
22:08:07 | alehander92 | i just see a mess and my pc hangs a bit |
22:08:26 | * | NimBot joined #nim |
22:08:40 | Zevv | http://ix.io/2o4r |
22:08:41 | PMunch | Oh it's the same link :P |
22:09:06 | alehander92 | ok many thick links |
22:09:09 | alehander92 | thanks |
22:09:16 | Zevv | yeah, I have only one link, all I can pay for |
22:09:37 | disruptek | ix.io has really raise their rates. |
22:10:06 | alehander92 | not really sure what to make out of it |
22:10:08 | Prestige | rates> |
22:10:10 | Prestige | what |
22:12:08 | Prestige | do those get deleted automatically? |
22:13:14 | Avatarfighter | wait what am I in charge of |
22:15:22 | * | couven92 quit (Ping timeout: 256 seconds) |
22:15:58 | Zevv | ZzzZZ |
22:16:55 | * | PMunch quit (Quit: leaving) |
22:19:27 | * | sagax joined #nim |
22:35:56 | FromDiscord | <dom96> Nim has really made me uncomfortable with languages that do not have mutable strings |
22:36:11 | FromDiscord | <willyboar> @PMunch why don't you pick another blogging platform? |
22:36:13 | FromDiscord | <dom96> It's fine to create an array, append chars to it and then call `join` right? 😛 |
22:39:56 | Avatarfighter | What language are you appending chars to an array lol dom96 ? |
22:43:18 | FromDiscord | <dom96> javascript |
22:46:19 | FromDiscord | <Rika> Javascript has immutable strings? |
22:48:54 | FromDiscord | <dom96> sure |
22:53:28 | FromDiscord | <Zachary Carter> Immutable strings are like the last thing in JS that makes me uncomfortable with that language |
22:54:16 | FromDiscord | <Zachary Carter> and that also means you're uncomfortable with pretty much all functional languages 😛 |
22:54:39 | FromDiscord | <Zachary Carter> but JS is terrible |
23:02:12 | alehander92 | typescript is ok |
23:02:18 | alehander92 | guys i wondered |
23:02:29 | alehander92 | electron can be replaced by electron-wasm |
23:02:53 | alehander92 | which can be mapped to native code on other platforms and be like a much faster normal electron |
23:03:34 | alehander92 | is this what flutter/etc tries to do? people probably realized that in 2018 |
23:03:47 | disruptek | why don't you just open the vein right now. |
23:03:50 | disruptek | just do it to me. |
23:03:57 | disruptek | do me up like a mountain fucking warrior. |
23:10:23 | alehander92 | ok, no more web tech talk for now |
23:18:37 | FromDiscord | <willyboar> hehe dis really hates web dev |
23:21:25 | FromDiscord | <willyboar> (edit) 'dis' => 'disruptek' |
23:23:15 | FromDiscord | <Zachary Carter> it's the worst |
23:23:32 | FromDiscord | <willyboar> 😛 I see it coming |
23:26:50 | FromDiscord | <willyboar> but i am waiting for your blazor nim clone |
23:27:29 | FromDiscord | <Zachary Carter> every time I start on something web related |
23:27:37 | FromDiscord | <Zachary Carter> I remember 15 minutes later how much I hate web dev |
23:28:17 | FromDiscord | <Zachary Carter> I already have to do it for work - I can't bring myself to do it in my spare time |
23:36:16 | bung | anyone can help me with? https://github.com/bung87/tim_sort/blob/master/src/tim_sort.nim |
23:36:43 | * | blackbeard420 joined #nim |
23:37:07 | bung | I 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:47 | adnan338 | Hi. is `new(result)` only necessary when a function returns a ref object type? |
23:45:52 | FromDiscord | <exelotl> yep |
23:46:02 | FromDiscord | <exelotl> (well, any ref type) |
23:47:07 | adnan338 | ok. Thank you. |
23:47:09 | * | adnan338 quit (Remote host closed the connection) |
23:47:49 | * | adnan338 joined #nim |
23:48:30 | adnan338 | What about Option[Tree[T]] where Tree[T] = ref object of RootObj? Option is not a ref type, is it? |
23:50:06 | FromDiscord | <exelotl> you don't need to new() the Option itself |
23:50:19 | leorize[m] | Option is not a ref type |
23:59:40 | * | dadada quit (Ping timeout: 265 seconds) |